repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
chrisranderson/3DLocalMultiViewDesc
[ "4cc5911d972cc15479b8a2fe3f4eda6077ff85d7" ]
[ "soft_renderer/transform.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\n\nimport math\nimport numpy as np\nimport os.path as osp\nimport sys\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport time\n\nROOT_DIR = osp.abspath('../')\nif ROOT_DIR not in sys.path:\n sys.path.append(ROOT_DI...
[ [ "torch.abs", "torch.transpose", "torch.cat", "torch.sin", "torch.zeros", "torch.sum", "torch.norm", "torch.ones", "torch.from_numpy", "numpy.stack", "torch.tensor", "numpy.sin", "numpy.zeros", "torch.ones_like", "torch.cos", "torch.nn.Parameter", ...
DSAAR/amorf
[ "5cc5e346e6d4f918d588ff527aaa45136f036851" ]
[ "examples/cross_validations/NN_CV.py" ]
[ "import amorf.datasets as ds\nimport amorf.neuralNetRegression as nn\nimport amorf.metrics as metrics\nimport numpy as np\nfrom sklearn.model_selection import KFold\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.metrics import make_scorer\n\n\ndef perform_GridSearch(X, y):\n scorer = make_scorer...
[ [ "numpy.std", "numpy.mean", "sklearn.metrics.make_scorer", "sklearn.model_selection.KFold" ] ]
GirishHiremath/models
[ "a40fe5ab8a42603f3ac7b157b6b57a763a8894bb" ]
[ "official/resnet/keras/keras_common.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.data.Dataset.from_tensors", "tensorflow.compat.v1.ConfigProto", "tensorflow.constant", "tensorflow.python.keras.optimizer_v2.gradient_descent.SGD", "tensorflow.random.truncated_normal", "tensorflow.compat.v1.logging.debug", "tensorflow.random.uniform", "tensorflow.cast"...
KatiaJDL/CenterPoly
[ "42811d9f5f85d9fef91a03275fe6ad113ccb163c", "42811d9f5f85d9fef91a03275fe6ad113ccb163c" ]
[ "src/lib/models/model.py", "cityscapesStuff/Tools/show_boxes.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\n\nfrom .networks.msra_resnet import get_pose_net\nfrom .networks.dlav0 import get_pose_net as get_dlav0\nfrom .networks.pose_dla_dcn import get_pose_net as get_dla_dcn\nfrom .networks.res...
[ [ "torch.save", "torch.load" ], [ "matplotlib.use", "matplotlib.patches.Rectangle", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.pause" ] ]
jspoorta/mlflow
[ "e95805b849e71d9f7ba8374631840961454b5557" ]
[ "tests/keras_autolog/test_keras_autolog.py" ]
[ "import pytest\nimport numpy as np\nimport keras\nimport keras.layers as layers\n\nimport mlflow\nimport mlflow.keras\nfrom distutils.version import LooseVersion\n\nclient = mlflow.tracking.MlflowClient()\n\n\n@pytest.fixture\ndef random_train_data():\n return np.random.random((1000, 32))\n\n\n@pytest.fixture()\...
[ [ "numpy.arange", "numpy.random.random", "numpy.zeros", "numpy.random.randint" ] ]
Quansight/lsst_dashboard
[ "837cc271ae7d590efa93f37c2f5108ba1af6e8c8" ]
[ "lsst_dashboard/partition.py" ]
[ "import distributed\nfrom dask import delayed\nfrom kartothek.io.dask.dataframe import update_dataset_from_ddf, read_dataset_as_ddf\nfrom kartothek.io.eager import read_dataset_as_dataframes\nfrom storefact import get_store_from_url\nfrom functools import partial\nimport pandas as pd\nimport numpy as np\nimport das...
[ [ "pandas.read_parquet", "pandas.concat", "pandas.DataFrame" ] ]
gfudenberg/cooltools
[ "2c5efcfa2810414f5e1cfeba8806b23d626abaa2" ]
[ "cooltools/api/sample.py" ]
[ "import numpy as np\nimport pandas as pd\n\nimport cooler\nimport cooler.tools\n\n\ndef sample_pixels_approx(pixels, frac):\n pixels[\"count\"] = np.random.binomial(pixels[\"count\"], frac)\n mask = pixels[\"count\"] > 0\n\n if issubclass(type(pixels), pd.DataFrame):\n pixels = pixels[mask]\n eli...
[ [ "numpy.random.choice", "numpy.asarray", "numpy.round", "numpy.bincount", "numpy.searchsorted", "numpy.random.binomial" ] ]
Tim55667757/FuzzyClassificator
[ "1dd5086a51c3c98497ef85b31178588a89d8951e", "1dd5086a51c3c98497ef85b31178588a89d8951e" ]
[ "pybrain/tests/unittests/tools/test_rlgluebridge.py", "pybrain/supervised/knn/lsh/minhash.py" ]
[ "\"\"\"\n\n >>> from pybrain.tools.rlgluebridge import adaptAgent\n >>> from rlglue.types import Action as RLGlueAction\n >>> from rlglue.types import Observation as RLGlueObservation\n\nLet's take a pseudo agent to test with and make an object of it\n\n >>> klass = adaptAgent(PseudoPybrainAgent)\n >...
[ [ "scipy.array" ], [ "scipy.array", "numpy.random.permutation" ] ]
babichjacob/vhs-stitcher
[ "b09793c951949475dc6a6ff24b3178b13d355a9b" ]
[ "vhs_stitcher/combine.py" ]
[ "from collections import defaultdict\nfrom datetime import timedelta\nfrom pathlib import Path\nfrom shlex import quote\nfrom subprocess import run\nfrom typing import Dict, Iterable, List, Tuple, TypeVar\n\nfrom imageio import imread\nfrom numpy import argmax, array, floor, linspace\nfrom PIL import Image\nfrom PI...
[ [ "numpy.floor", "numpy.array", "numpy.linspace" ] ]
blazeCCC/OpenPCDet-Noted
[ "f33241752b1659c53ef98fd621bcd0ed0e1af971", "f33241752b1659c53ef98fd621bcd0ed0e1af971" ]
[ "pcdet/datasets/dataset.py", "pcdet/models/dense_heads/target_assigner/anchor_generator.py" ]
[ "from collections import defaultdict # 当字典中的key不存在但被查找时,返回默认值,而不是keyError\nfrom pathlib import Path\n\nimport numpy as np\nimport torch.utils.data as torch_data\n\nfrom ..utils import common_utils\nfrom .augmentor.data_augmentor import DataAugmentor\nfrom .processor.data_processor import DataProcessor\nfrom .proces...
[ [ "numpy.pad", "numpy.stack", "numpy.concatenate", "numpy.array", "numpy.zeros" ], [ "torch.stack", "torch.meshgrid", "torch.arange", "torch.cat" ] ]
HarshCasper/MNIST-Digit-Recognition
[ "41312669b226ee2045c6d5a16b600388fb0d18c8" ]
[ "tf/softmax/inference.py" ]
[ "# -*- coding: utf-8 -*-\nimport tensorflow as tf\n\nINPUT_NODE = 784 \nOUTPUT_NODE = 10 \n\n\ndef get_weight_variable(shape, regularizer=None):\n \n weights = tf.get_variable(\"weight\", initializer=tf.truncated_normal(shape, stddev=.1))\n\n \n if regularizer is not None:\n tf.add_to_collectio...
[ [ "tensorflow.constant", "tensorflow.matmul", "tensorflow.truncated_normal", "tensorflow.name_scope" ] ]
lamby/gnocchi
[ "87928a7c92d46b31bf0e8333064a4d0b83e6131b" ]
[ "gnocchi/storage/__init__.py" ]
[ "# -*- encoding: utf-8 -*-\n#\n# Copyright © 2016-2018 Red Hat, Inc.\n# Copyright © 2014-2015 eNovance\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.o...
[ [ "numpy.sort" ] ]
sanjass/MultiTaskLearning
[ "b1a9cefba49d19d2c833585d1dd7fe025aaafaa2" ]
[ "evaluate.py" ]
[ "import argparse\n# import openai\nimport os\nimport numpy as np\nimport pandas as pd\nimport time\nfrom transformers import pipeline\n\nfrom crop import crop\n\n# openai.api_key = \"INSERTYOURKEYHERE\"\nchoices = [\"A\", \"B\", \"C\", \"D\"]\n\n\ndef softmax(x):\n z = x - max(x)\n numerator = np.exp(z)\n ...
[ [ "numpy.concatenate", "numpy.mean", "numpy.exp", "numpy.array", "numpy.sum" ] ]
Xuezhi-Liang/forte
[ "7dc6e6c7d62d9a4126bdfc5ca02d15be3ffd61ca" ]
[ "tests/forte/data/audio_annotation_test.py" ]
[ "# Copyright 2022 The Forte 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...
[ [ "numpy.squeeze", "numpy.array", "numpy.array_equal" ] ]
LindenLiu/gluon-nlp
[ "a2c6806a34c373d44bde2ebf24c11b030a22dbec" ]
[ "src/gluonnlp/data/stream.py" ]
[ "# coding: utf-8\n\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the...
[ [ "numpy.random.seed", "numpy.random.randint" ] ]
azshue/semseg
[ "b103cf7747114812239b733338121c78ba4aab76" ]
[ "tool/demo.py" ]
[ "import os\nimport logging\nimport argparse\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn.functional as F\nimport torch.nn.parallel\nimport torch.utils.data\n\nfrom util import config\nfrom util.util import colorize\n\ncv2.ocl.setUseOpenCL(False)\n\n\ndef get...
[ [ "torch.nn.functional.softmax", "numpy.expand_dims", "torch.load", "numpy.uint8", "numpy.ceil", "numpy.argmax", "torch.no_grad", "torch.nn.functional.interpolate", "torch.nn.DataParallel", "numpy.zeros", "numpy.loadtxt" ] ]
ChetWei/yolov3_pytorch
[ "bfdac113c8c458790bff48466df1a6d662e3bd41" ]
[ "models/Yolo3Body.py" ]
[ "# !/usr/bin/env python\n# -*-coding:utf-8 -*-\n\n\"\"\"\n# Time :2021/11/3 13:49\n# Author :thomas\n# Description:\n\"\"\"\nfrom itertools import chain\n\nfrom collections import OrderedDict\nimport torch\nimport torch.nn as nn\n\nfrom .Backbone import darknet53\n\n\"\"\"\n一个完整的卷积 包括 conv2d bn relu\n\"\"...
[ [ "torch.zeros", "torch.cat", "torch.nn.Conv2d", "torch.exp", "torch.nn.Upsample", "torch.rand", "torch.nn.BatchNorm2d", "torch.arange", "torch.nn.LeakyReLU", "torch.stack" ] ]
gepcel/ipyvolume
[ "6aa11202c0262cb5c7985816a7b4a2c09782048c" ]
[ "ipyvolume/test_all.py" ]
[ "from __future__ import absolute_import\nimport ipyvolume\nimport ipyvolume.pylab as p3\nimport ipyvolume as ipv\nimport ipyvolume.examples\nimport ipyvolume.datasets\nimport ipyvolume.utils\nimport ipyvolume.serialize\nimport numpy as np\nimport os\nimport shutil\nimport json\nimport pytest\n\n\n# helpful to remov...
[ [ "numpy.random.random", "numpy.meshgrid", "numpy.asarray", "numpy.arange", "numpy.random.rand", "numpy.array", "numpy.zeros" ] ]
jgolden17/titanic-survival-predictions
[ "f55626c726ea949a15d2e4d0f97a97b7eb86888c" ]
[ "main.py" ]
[ "\"\"\"\nPredict the likelihood of surviving the Titanic sinkings\n\"\"\"\nimport pandas as pd\nimport numpy as np\nfrom sklearn.cluster import KMeans\nfrom sklearn.preprocessing import LabelEncoder\n\ndef get_training_data():\n \"\"\"\n Get the training data set from Kaggle\n \"\"\"\n train_url = 'http...
[ [ "sklearn.preprocessing.LabelEncoder", "numpy.array", "pandas.read_csv", "sklearn.cluster.KMeans" ] ]
sujason/quantitative
[ "42b7fdea05629934f513a7b15e5b03c7697c5c46" ]
[ "autodiff/symbolic.py" ]
[ "import numpy as np\nimport theano\nimport theano.tensor as tt\nimport types\nimport inspect\n\nfrom autodiff.context import Context\nfrom autodiff.compat import OrderedDict\nimport autodiff.utils as utils\n\n\ndef clean_int_args(*args, **kwargs):\n \"\"\"\n Given args and kwargs, replaces small integers with...
[ [ "numpy.asarray", "numpy.any", "numpy.int16" ] ]
excel-analytics/telegram_chat_bot
[ "7e58fcedeb56567d02cf334b965ff3efa9474212" ]
[ "retrieval_based/udc_test.py" ]
[ "import os\nimport time\nimport itertools\nimport sys\n\nimport tensorflow as tf\n\nimport udc_model\nimport udc_hparams\nimport udc_metrics\nimport udc_inputs\nfrom dual_encoder import dual_encoder_model\n\n\ntf.flags.DEFINE_string(\"test_file\", \"./data/test.tfrecords\", \"Path of test data in TFRecords format\"...
[ [ "tensorflow.flags.DEFINE_string", "tensorflow.contrib.learn.RunConfig", "tensorflow.logging.set_verbosity", "tensorflow.flags.DEFINE_integer" ] ]
bebound/recommender
[ "64cb1031e9e9e05009bb36284c0d4ed5d99b7395" ]
[ "recommender.py" ]
[ "import math\nimport sys\n\nfrom scipy.spatial.distance import pdist\n\nfrom db_api import *\n\n_DEBUG = False\n_NEAREST_NUMBER = 15\n\n\ndef print_user_info(user_id):\n print(get_user_by_id(user_id))\n\n\ndef print_movie_info(movie_id):\n print(get_movie_by_id(movie_id))\n\n\ndef print_actual_rating(user_id,...
[ [ "scipy.spatial.distance.pdist" ] ]
openvinotoolkit/nncf
[ "020d1da45fa7d79ee74e70bd7932b5b16edde10f" ]
[ "nncf/torch/pruning/filter_pruning/layers.py" ]
[ "\"\"\"\n Copyright (c) 2020 Intel Corporation\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 http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agr...
[ [ "torch.no_grad", "torch.ones" ] ]
sanjaynarang10/machine-learning-engineering-for-production-public
[ "95859887eaed9d6079835559b298efb65caf7528" ]
[ "course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py" ]
[ "import pickle\nimport numpy as np\nfrom typing import List\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel, conlist\n\n\n\napp = FastAPI(title=\"Predicting Wine Class with batching\")\n\n# Open classifier in global scope\n# Sanjay Test\nwith open(\"models/wine.pkl\", \"rb\") as file:\n clf = pickle...
[ [ "numpy.array" ] ]
Ruth-Seven/skiplists_benchmark
[ "870abe27b92f63cf41780cd55c1c2ea66248fd74" ]
[ "tools/visualize_csv.py" ]
[ "#!/usr/bin/python3\n# coding: utf-8\nimport argparse\nfrom pathlib import Path\n\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\nreg = {\n \".*RandomInserts\":\"RandomInserts.png\",\n \"^(?!.*Worst)(?!.*Random).*Inserts$\": \"Insert.png\",\n \"^.*Worst...
[ [ "pandas.read_csv" ] ]
wiewel/LatentSpaceSubdivision
[ "3d5e7d3633625d0ef036e8674a9ed5d5214ea5e8" ]
[ "scene/smoke_mov_xz.py" ]
[ "import argparse\nimport sys\nfrom datetime import datetime\nimport time\nimport os\nfrom tqdm import trange\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom collections import deque\nfrom perlin import TileableNoise\nfrom random import random, seed\n\ntry:\n\tfrom manta import *\n\timport gc\nexcept Im...
[ [ "numpy.random.seed", "matplotlib.pyplot.ylim", "numpy.finfo", "matplotlib.pyplot.plot", "numpy.savez_compressed", "numpy.load", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
clrrrr/promp_plus
[ "26f3a80061f85336880241aa3571c92342149f39" ]
[ "meta_policy_search/tester.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport time\nfrom meta_policy_search.utils import logger\n\n\nclass Tester(object):\n def __init__(\n self,\n algo,\n env,\n sampler,\n sample_processor,\n policy,\n eff,\n sess=N...
[ [ "tensorflow.global_variables", "tensorflow.variables_initializer", "tensorflow.is_variable_initialized", "tensorflow.Session" ] ]
shijieg2/pyray
[ "4e743e323b1727e841e5f1643913003023e78832" ]
[ "pyray/shapes/polyhedron.py" ]
[ "'''\nAll kinds of polyhedra. Like Platonic solids, Archimedean solids, Tetartoids, etc.\n'''\nimport numpy as np\nfrom scipy.spatial import ConvexHull\nfrom pyray.misc import *\nfrom pyray.rotation import *\nfrom pyray.color import *\nfrom pyray.shapes.cube import *\nimport abc\n\n\ndef render_solid_planes(planes,...
[ [ "numpy.dot", "numpy.sqrt", "scipy.spatial.ConvexHull", "numpy.transpose", "numpy.copy", "numpy.flip", "numpy.cross", "numpy.array", "numpy.zeros" ] ]
fgebhart/pandas
[ "524fc9c6790ddc4b151b6fb910a27073961c5fba" ]
[ "pandas/core/arrays/_mixins.py" ]
[ "from typing import Any, Optional, Sequence, TypeVar\n\nimport numpy as np\n\nfrom pandas._libs import lib\nfrom pandas._typing import Shape\nfrom pandas.compat.numpy import function as nv\nfrom pandas.errors import AbstractMethodError\nfrom pandas.util._decorators import cache_readonly, doc\nfrom pandas.util._vali...
[ [ "pandas.errors.AbstractMethodError", "pandas.core.algorithms.unique", "pandas._libs.lib.is_integer", "pandas.core.dtypes.common.is_dtype_equal", "pandas._libs.lib.is_scalar", "pandas.core.dtypes.missing.array_equivalent", "pandas.util._validators.validate_fillna_kwargs", "numpy.con...
ahmad-asadi/PoetLSTM
[ "e1689be33a4d99e3d23d6073364713a87d117d68" ]
[ "Classifiers/CNN.py" ]
[ "from __future__ import division, print_function, absolute_import\n\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\nclass CNN:\n def __init__(self, dataset, label2ind, ind2label, test_set_percent=0.2, learning_rate=0.001, num_steps=2000,\n batch_size=128, num_in...
[ [ "tensorflow.metrics.accuracy", "tensorflow.gfile.Exists", "tensorflow.layers.dropout", "tensorflow.gfile.GFile", "tensorflow.cast", "tensorflow.contrib.layers.flatten", "tensorflow.train.AdamOptimizer", "tensorflow.get_default_graph", "tensorflow.Graph", "tensorflow.import_...
jongja/jongja
[ "7293edfd1e66b5ddb990954dcadae76b4723d7bb" ]
[ "Projects/ICSL_Detector/CSCA_Detection/run_stress.py" ]
[ "# CSCA detector run code.\n# Created by JongHyeon Cho in kwangwoon uni. 2019\n# Copyright @ 2019 JongHyeon Cho All right reserved.\n\nimport subprocess\nimport os\nimport numpy as np\nimport time\nimport sys\nimport tensorflow as tf\n\ncur_line = 0 #for skip line.\npid = os.fork()\nfilecnt = 1\n\nif pid == 0: #mus...
[ [ "tensorflow.matmul", "tensorflow.nn.softmax", "tensorflow.train.latest_checkpoint", "tensorflow.placeholder", "tensorflow.train.import_meta_graph", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.get_default_graph", "tensorflow.argmax" ] ]
Bhaskers-Blu-Org1/translucent-answer-prediction
[ "1214e0356f24e1a4b1ad64f2eb0edac0baf37a79" ]
[ "tap2/bottom_machine/model_sf.py" ]
[ "import torch\nimport torch.nn as nn\nfrom tap2.bottom_machine.hypers import HypersSF\n\nfrom pytorch_pretrained_bert.modeling import (\n PreTrainedBertModel,\n BertEncoder,\n BertModel,\n BertConfig\n)\n\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\nclass PassageEncoder(nn.Module):\n ...
[ [ "torch.nn.Dropout", "torch.sigmoid", "torch.cat", "torch.zeros", "torch.nn.BCELoss", "torch.nn.Linear", "torch.nn.ReLU" ] ]
brilhana/quantnet
[ "730b23ae1c5218469d32c72a5b087df7917bcfe4" ]
[ "quantnet/baseline.py" ]
[ "import pickle\nimport random\nfrom time import time\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.gaussian_process import GaussianProcessRegressor\nfrom sklearn.gaussian_process.kernels import (\n RBF,\n ExpSineSquared,\n RationalQuadratic,\n WhiteKernel,\n)\nfrom sklearn.linear_model import...
[ [ "numpy.multiply", "pandas.DataFrame", "numpy.concatenate", "sklearn.linear_model.LinearRegression", "numpy.sum" ] ]
puvvadapc/Spark
[ "4d6d8192c807006ff89488a1d38bc6f7d41de5cf" ]
[ "python/pyspark/ml/tests.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "numpy.abs", "numpy.array_equal", "numpy.arange", "numpy.ones", "numpy.all", "numpy.str_", "numpy.array", "numpy.isclose" ] ]
vsriram11/statsmodels
[ "9ea6a46507f0db0c22d2c072627233f47d4004d9" ]
[ "statsmodels/graphics/boxplots.py" ]
[ "\"\"\"Variations on boxplots.\"\"\"\n\n# Author: Ralf Gommers\n# Based on code by Flavio Coelho and Teemu Ikonen.\n\nimport numpy as np\nfrom scipy.stats import gaussian_kde\n\nfrom . import utils\n\n\n__all__ = ['violinplot', 'beanplot']\n\n\ndef violinplot(data, ax=None, labels=None, positions=None, side='both',...
[ [ "numpy.linspace", "numpy.min", "numpy.asarray", "numpy.median", "numpy.max", "numpy.size", "scipy.stats.gaussian_kde", "matplotlib.artist.setp", "numpy.interp", "numpy.mean", "numpy.std", "numpy.random.uniform" ] ]
YTLogos/bcbio-nextgen
[ "f964a25ab74a31551273b7e50518f3451c90f473" ]
[ "bcbio/ngsalign/tophat.py" ]
[ "\"\"\"Next-gen alignments with TopHat a spliced read mapper for RNA-seq experiments.\n\nhttp://tophat.cbcb.umd.edu\n\"\"\"\nimport os\nimport shutil\nimport sys\nimport glob\nimport subprocess\n\nimport numpy\nimport pysam\n\nfrom bcbio.pipeline import config_utils\nfrom bcbio.ngsalign import bowtie, bowtie2\nfrom...
[ [ "numpy.median" ] ]
YIDING-CODER/ig-markets-api-python-library
[ "8d1a55f6239a242949e521edfd2ab4a713018542" ]
[ "tests/test_accounts.py" ]
[ "from trading_ig.rest import IGService\nimport responses\nimport json\nimport pandas as pd\n\n\"\"\"\nunit tests for accounts methods\n\"\"\"\n\n\nclass TestAccounts:\n\n # fetch_accounts\n\n @responses.activate\n def test_fetch_accounts_happy(self):\n\n with open('tests/data/accounts_balances.json'...
[ [ "pandas.set_option", "pandas.isna" ] ]
mike-grayhat/petastorm
[ "1e307a7ce423aeff348bc0f21843642370061f38" ]
[ "petastorm/tests/test_parquet_reader.py" ]
[ "# Copyright (c) 2017-2018 Uber Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app...
[ [ "numpy.testing.assert_equal" ] ]
shivupa/hf_rosetta
[ "19a4f497fa097bc53aea0c7f39582af5888018b3" ]
[ "hf_rosetta/runner.py" ]
[ "import numpy as np\nimport numpy.testing as npt\nimport time\nimport subprocess\nimport textwrap as tw\n\ndef print_output(code,result,runtime):\n value = (float)(result.stdout.decode(\"utf-8\"))\n npt.assert_almost_equal(-76.02679819986787,value,decimal=6)\n print(\"{:^79}\".format(\"{:<15}: {:>21}\".for...
[ [ "numpy.testing.assert_almost_equal" ] ]
rishigarg94/pandas-visual-analysis
[ "c9569878a44fb0f5d0acd8779ff65d51e1c1bd95" ]
[ "src/pandas_visual_analysis/data_source.py" ]
[ "import os\nimport typing\nfrom enum import Enum\nfrom blinker import Signal\nfrom pandas import DataFrame\nimport pandas as pd\n\nimport pandas_visual_analysis.utils.validation as validate\nfrom pandas_visual_analysis.utils.column_store import ColumnStore\n\n\nclass SelectionType(Enum):\n STANDARD = 1\n ADDI...
[ [ "pandas.read_table", "pandas.read_csv", "pandas.read_json" ] ]
R-N/covid-forecasting-joint-learning
[ "cb2edad1f3df987e523a8b8e0252c2265b1e5b23", "cb2edad1f3df987e523a8b8e0252c2265b1e5b23" ]
[ "covid_forecasting_joint_learning/model/loss.py", "covid_forecasting_joint_learning/model/comparison/sird.py" ]
[ "import torch\nfrom torch import nn\nfrom optuna.structs import TrialPruned\nfrom . import util as ModelUtil\n\nclass NaNPredException(TrialPruned):\n def __init__(self):\n super(NaNPredException, self).__init__(\"Pred has NaN!\")\n\nclass NaNLossException(TrialPruned):\n def __init__(self):\n s...
[ [ "torch.sum", "torch.mean", "torch.square", "torch.isnan" ], [ "pandas.read_excel", "numpy.linspace", "pandas.DataFrame", "scipy.integrate.odeint", "numpy.concatenate", "numpy.array" ] ]
watsonjj/ctapipe
[ "fc98748d7a38f50040f1fbe3ce5e174ad8c0ba0a" ]
[ "ctapipe/tools/muon_reconstruction.py" ]
[ "from tqdm.auto import tqdm\nimport numpy as np\nfrom astropy.coordinates import SkyCoord\n\nfrom ..containers import TelEventIndexContainer\nfrom ..calib import CameraCalibrator\nfrom ..core import Provenance\nfrom ..core import Tool, ToolConfigurationError\nfrom ..core import traits\nfrom ..core.traits import fla...
[ [ "numpy.isnan", "numpy.abs", "numpy.sqrt", "numpy.count_nonzero" ] ]
moatary/dimensionality-reduction-visualizer
[ "e944c147800d0d7a7ebf8a5b2d811205944e8157" ]
[ "dim_reductions_supervised.py" ]
[ "import numpy as np\r\nimport sklearn\r\n\r\n\r\ndef lda_usual(class1,class2,finaldim):\r\n from sklearn.decomposition import PCA\r\n from scipy import sparse\r\n import numpy\r\n if isinstance(class1, numpy.ndarray) == False:\r\n input = class1.todense()\r\n if isinstance(class2, numpy.ndarra...
[ [ "numpy.diag", "numpy.isnan", "numpy.ones", "numpy.concatenate", "numpy.asmatrix", "numpy.mean", "sklearn.discriminant_analysis.LinearDiscriminantAnalysis", "numpy.argsort", "sklearn.decomposition.PCA" ] ]
zoezou2015/abs_pretraining
[ "f9da4626c7603eac46e6aa9ed4bf49ef109b6727", "f9da4626c7603eac46e6aa9ed4bf49ef109b6727" ]
[ "fairseq/models/lightconv.py", "fairseq/modules/character_token_embedder.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\r\n# All rights reserved.\r\n#\r\n# This source code is licensed under the license found in the LICENSE file in\r\n# the root directory of this source tree. An additional grant of patent rights\r\n# can be found in the PATENTS file in the same directory.\r\n\r\nimport m...
[ [ "torch.nn.GLU", "torch.Tensor", "torch.nn.functional.dropout", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.Embedding", "torch.nn.Linear", "torch.nn.init.normal_", "torch.nn.init.xavier_uniform_", "torch.nn.functional.linear" ], [ "torch.LongTensor", ...
uadlq/PhyPiDAQ-PiOS11
[ "fc6060551be2cc0143a157081341bf3c338d9fbd", "fc6060551be2cc0143a157081341bf3c338d9fbd" ]
[ "phypidaq/AS7265xConfig.py", "phypidaq/ReplayConfig.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division, unicode_literals\nfrom __future__ import absolute_import\nimport numpy as np\nimport time\nimport sys\nfrom smbus import SMBus # Module for I2C\n\n# code of driver classes included below\n\n# AS7265x defaults\nAS_I2CADDR = 0x49\nBUS = 1\nAS...
[ [ "numpy.amax" ], [ "numpy.loadtxt" ] ]
AlexLTC/LRP-HAM_git
[ "a8b4ff675a8abfd5023670044d6d594636da3780" ]
[ "lib_drl/roi_data_layer/minibatch.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Xinlei Chen\n# --------------------------------------------------------\n\n\"\"\"Compute minibatch blobs for training ...
[ [ "numpy.array", "numpy.where" ] ]
JTeijema/asreview-XGBoost
[ "a682088ef51c6e771be62376f6150f3c9a22726f" ]
[ "asreviewcontrib/models/xgboost.py" ]
[ "from asreview.models.classifiers.base import BaseTrainClassifier\n\nimport xgboost as xgb\n\nfrom sklearn.model_selection import GridSearchCV\n\nclass XGBoost(BaseTrainClassifier):\n \"\"\"XGBoost classifier\n\n This classifier is based on the XGBClassifier.\n\n \"\"\"\n\n name = \"xgboost\"\n\n def...
[ [ "sklearn.model_selection.GridSearchCV" ] ]
dongyaoli10x/txgcv
[ "5189edae394b804ec44abe786161c23e45f82296" ]
[ "txgcv/registration/img_regist.py" ]
[ "import numpy as np\nimport time\nimport random\nimport SimpleITK as sitk\nfrom typing import List, Tuple, Callable, Dict\nfrom txgcv.base import Algorithm, Parameter\n\n\nclass ImageRegister(Algorithm):\n\n _param_dict = {\n \"sampling_rate\": Parameter(\n value=0.01,\n val_type=flo...
[ [ "numpy.arctan2", "numpy.linalg.lstsq", "numpy.zeros", "numpy.abs" ] ]
csy1204/recsys_2019_conf_ver
[ "f7b7d89c02098ad45e22b25b6cc924b4b57d4de8" ]
[ "src/setup.py" ]
[ "from Cython.Build import cythonize\nfrom numpy import get_include\nfrom setuptools import setup, Extension\n\nextensions = [Extension(name=\"recsys.mrr\", sources=[\"recsys/*.pyx\"])]\n\nsetup(\n name=\"recsys\",\n version=\"0.1\",\n author=\"LogicAI\",\n packages=[\"recsys\"],\n ext_modules=cythoni...
[ [ "numpy.get_include" ] ]
jlianglab/CAiD
[ "d6e923c34a91e64790f3ebca43690614f5b42c1f" ]
[ "segmentation_models_pytorch/transskipunet/transformer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nDETR Transformer class.\n\nCopy-paste from torch.nn.Transformer with modifications:\n * positional encodings are passed in MHattention\n * extra LN at the end of encoder is removed\n * decoder returns a stack of activations fr...
[ [ "torch.nn.Dropout", "torch.nn.MultiheadAttention", "torch.zeros_like", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.nn.init.xavier_uniform_", "torch.stack" ] ]
KingPixil/perception
[ "4e73fb0f966a19b647bf48cc1c6b284e5eed34f0" ]
[ "src/random/__init__.py" ]
[ "import numpy as np\nnp.seterr(over=\"ignore\")\n\n# Slash\nprime = np.uint64(0xA01731A5AC74E8DB)\neight = np.uint64(8)\nfiftySix = np.uint64(56)\n\ndef slash(key):\n result = np.uint64(key) * prime\n result = (result >> eight) | (result << fiftySix)\n return result.item()\n\n# Random\nseed = (slash(ord('I...
[ [ "numpy.seterr", "numpy.uint64" ] ]
sentinel-hub/eo-grow
[ "458202fc55c01cc95a17b442144ef2c935103c80" ]
[ "eogrow/tasks/testing.py" ]
[ "\"\"\"\nImplements tasks for testing purposes\n\"\"\"\nimport datetime as dt\nfrom typing import Optional, Tuple, Union\n\nimport numpy as np\n\nfrom eolearn.core import EOPatch, EOTask, FeatureTypeSet\nfrom eolearn.core.utils.common import is_discrete_type\n\nfrom ..utils.types import Feature, TimePeriod\n\n\ncla...
[ [ "numpy.random.default_rng", "numpy.full" ] ]
shashwat623/pytorch-ssd
[ "0d6cbeae69b7043a294efa47fc269df61ea47029" ]
[ "vision/nn/mobilenetv3.py" ]
[ "'''MobileNetV3 in PyTorch.\n\nSee the paper \"Inverted Residuals and Linear Bottlenecks:\nMobile Networks for Classification, Detection and Segmentation\" for more details.\n'''\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import init\n\n\n\nclass hswish(nn.Module):\n def...
[ [ "torch.nn.Sequential", "torch.nn.BatchNorm1d", "torch.nn.init.constant_", "torch.randn", "torch.nn.functional.avg_pool2d", "torch.nn.Conv2d", "torch.nn.functional.relu6", "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d", "torch.nn.init.normal_", "torch.nn.BatchNorm2d", ...
BotanAtomic/anomaly-detection
[ "6617880f19a4955d70a34a3bbee83f157eb087f8" ]
[ "models/estimator_2D.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom models.base import BaseModule\nfrom models.utils import ListModule\n\n\nclass MaskedConv2d(BaseModule, nn.Conv2d):\n \"\"\"\n Implements a Masked Convolution 2D.\n This is a 2D convolution with a masked kernel.\n \"\"\"\n def __init__(self, mask_type: str,...
[ [ "torch.nn.Sequential", "torch.nn.LeakyReLU", "torch.unsqueeze", "torch.cat" ] ]
eynaij/X-Temporal
[ "7dde0457b10be703e70329312ea55b14d7364f88" ]
[ "tools/predict-multilabel.py" ]
[ "# coding=utf-8\n# author=yphacker\n\nimport os\nimport argparse\nfrom tqdm import tqdm\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom torch.utils.data import DataLoader\nfrom conf import config\nfrom model.net import Net\nfrom utils.data_utils import MyDataset\nfrom utils.data_utils import test_trans...
[ [ "pandas.concat", "pandas.read_csv", "torch.load", "torch.utils.data.DataLoader", "pandas.DataFrame", "numpy.argmax", "torch.no_grad", "torch.cuda.is_available", "torch.nn.DataParallel", "numpy.array" ] ]
iit-DLSLab/crocoddyl
[ "2b8b731fae036916ff9b4ce3969e2c96c009593c" ]
[ "bindings/python/crocoddyl/utils/biped.py" ]
[ "import crocoddyl\nimport pinocchio\nimport numpy as np\n\n\nclass SimpleBipedGaitProblem:\n \"\"\" Defines a simple 3d locomotion problem\n \"\"\"\n def __init__(self, rmodel, rightFoot, leftFoot):\n self.rmodel = rmodel\n self.rdata = rmodel.createData()\n self.state = crocoddyl.Stat...
[ [ "numpy.matrix", "matplotlib.pyplot.legend", "numpy.asscalar", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.eye", "matplotlib.pyplot.plot", "numpy.asmatrix", "matplotlib.pyplot.subplot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.ar...
davideprez/Italy-Trigger-Word-Detection
[ "5cbf0055ad2a14e12ee7bb6e2ffad11f26db1884" ]
[ "td_utils.py" ]
[ "import matplotlib.pyplot as plt\nfrom scipy.io import wavfile\nimport os\nfrom pydub import AudioSegment\n\n# Calculate and plot spectrogram for a wav audio file\ndef graph_spectrogram(wav_file):\n rate, data = get_wav_info(wav_file)\n nfft = 200 # Length of each window segment\n fs = 8000 # Sampling freq...
[ [ "matplotlib.pyplot.specgram", "scipy.io.wavfile.read" ] ]
usplm/imageprocessing
[ "600ed9da00b9e123a8378fcc1c2f92ce69133a3b" ]
[ "micasense/image.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\"\"\"\nRedEdge Image Class\n\n An Image is a single file taken by a RedEdge camera representing one\n band of multispectral information\n\nCopyright 2017 MicaSense, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software ...
[ [ "numpy.mat", "numpy.dot", "numpy.linalg.inv", "numpy.arange", "numpy.eye", "numpy.cos", "numpy.rad2deg", "numpy.sin", "numpy.deg2rad", "numpy.polyval", "numpy.array", "numpy.zeros", "numpy.hypot" ] ]
kemaloksuz/BoundingBoxGenerator
[ "9b7034325faed3af977d0bad9c97629e9298564f" ]
[ "mmdet/core/bbox/samplers/OFB_with_OHNM.py" ]
[ "import numpy as np\nimport torch\nfrom .ohem_sampler import OHEMSampler\n\nclass OFBwithOHNM(OHEMSampler):\n\n def _sample_pos(self, assign_result, num_expected, **kwargs):\n\n pos_inds = torch.nonzero(assign_result.gt_inds > 0)\n if pos_inds.numel() != 0:\n pos_inds = pos_inds.squeeze(...
[ [ "torch.nonzero" ] ]
mobulan/TransFG
[ "222ddf16824220e76f7234289dde7041e4c49bf3" ]
[ "train.py" ]
[ "# coding=utf-8\nfrom __future__ import absolute_import, division, print_function\n\nimport logging\nimport argparse\nimport os\nimport random\nimport numpy as np\nimport time\n\nfrom datetime import timedelta\n\nimport torch\nimport torch.distributed as dist\n\nfrom tqdm import tqdm\nfrom torch.utils.tensorboard i...
[ [ "torch.nn.CrossEntropyLoss", "numpy.random.seed", "torch.cuda.set_device", "torch.load", "torch.manual_seed", "torch.argmax", "torch.distributed.barrier", "torch.tensor", "torch.no_grad", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.manual_seed_all", "torch....
odidev/mahotas
[ "41f77d05fa92aa2b2ffe143136ffcd4d42de644f", "41f77d05fa92aa2b2ffe143136ffcd4d42de644f" ]
[ "mahotas/io/freeimage.py", "mahotas/tests/test_median_filter.py" ]
[ "import sys\nimport os\nimport ctypes\nimport ctypes.util\n\nimport numpy as np\n\n\n_API = {\n 'FreeImage_AllocateT': (\n ctypes.c_void_p,\n [ctypes.c_int, # type\n ctypes.c_int, # width\n ctypes.c_int, # height\n ctypes.c_int, # bpp\n ctypes.c_uint, # red_mask...
[ [ "numpy.dot", "numpy.dstack", "numpy.dtype", "numpy.array", "numpy.ctypeslib.load_library" ], [ "numpy.random.seed", "numpy.arange", "numpy.ones", "numpy.all", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.random.randint" ] ]
yaogood/dynamic_background_of_zoom
[ "6e3b5e8f5fae1dd983d3c59ad6f7576715967295" ]
[ "background.py" ]
[ "import numpy as np\nimport cv2 as cv\nfrom matplotlib import pyplot as plt\nfrom PIL import Image\nimport io\nfrom rembg.bg import remove\n\ndef im_crop_center(img, w, h):\n img_width, img_height = img.size\n left, right = (img_width - w) / 2, (img_width + w) / 2\n top, bottom = (img_height - h) / 2, (img...
[ [ "matplotlib.pyplot.show" ] ]
rth/predicu
[ "7b1afc89ac42f7ecc8b5eca07435cfd2a8cd46a7", "7b1afc89ac42f7ecc8b5eca07435cfd2a8cd46a7" ]
[ "predicu/__main__.py", "predicu/data.py" ]
[ "import datetime\nimport logging\nimport os\n\nimport click\n\nfrom predicu.data import load_bedcounts\nfrom predicu.plot import generate_plots\nfrom predicu.preprocessing import preprocess_bedcounts\n\n\n@click.group()\ndef cli():\n pass\n\n\n@cli.command(name=\"export\")\n@click.option(\"--output-dir\", \"-o\"...
[ [ "matplotlib.use" ], [ "pandas.read_hdf", "pandas.read_csv", "pandas.to_datetime", "pandas.read_json" ] ]
peterkuma/alcf
[ "781026a0686193680b9c3155db29d75b6c27192e" ]
[ "alcf/misc.py" ]
[ "import copy\nimport numpy as np\nimport astropy.coordinates\nimport astropy.time\nimport astropy.units\nimport ds_format as ds\nimport aquarius_time as aq\n\ndef parse_time(time):\n\tif len(time) != 2:\n\t\traise ValueError('Invalid time: %s' % time)\n\tstart = aq.from_iso(time[0])\n\tend = aq.from_iso(time[1])\n\...
[ [ "numpy.arange", "numpy.maximum", "numpy.minimum", "numpy.full" ] ]
gkmaro634/mne-python
[ "5409a89233b764f3f3f3136cf9bf6b8d5fb0a4fe" ]
[ "mne/viz/utils.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Utility functions for plotting M/EEG data.\"\"\"\n\n# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Denis Engemann <denis.engemann@gmail.com>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n# Eric Larson <larson.eric.d@gmail.com>\...
[ [ "matplotlib.patheffects.Normal", "numpy.sqrt", "numpy.linspace", "numpy.asarray", "numpy.flipud", "numpy.all", "numpy.concatenate", "numpy.max", "numpy.mean", "numpy.fix", "numpy.ma.masked_where", "numpy.where", "numpy.allclose", "numpy.clip", "numpy.uni...
mrshihabullah/federated-predicted-euclidean-distance
[ "4b7ec03e9a93cdac9d64032728028c2bec46c916" ]
[ "code/FEDM_PEDM_using_N_generated_spikes_using_variance_blob.py" ]
[ "import random\nimport sys\nimport numpy as np\nfrom sklearn.datasets import make_blobs\nfrom sklearn.metrics.pairwise import euclidean_distances\nimport participant_utils as pu\nimport coordinator_utils as cu\n\n# Declare for experimental purpose\ntotal_no_samples=5000\nD1_sample_size = random.randint(1, total_no_...
[ [ "numpy.concatenate", "sklearn.metrics.pairwise.euclidean_distances", "numpy.random.random" ] ]
oDestroyeRo/LANL-Earthquake-Prediction
[ "771351c05b81d8924bbafbd43b88deb5469f9471" ]
[ "train.py" ]
[ "import os \nfrom pyspark.sql.types import IntegerType\nfrom pyspark.ml.linalg import Vectors\nfrom pyspark.ml.feature import VectorAssembler\nimport numpy as np\nimport keras, math\nfrom keras.utils.training_utils import multi_gpu_model\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout,...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "sklearn.metrics.mean_absolute_error", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.max", "numpy.array" ] ]
tgandor/K3D-jupyter
[ "a2ab323595c2c0ce8176591b4f926452fd059076" ]
[ "k3d/helpers.py" ]
[ "\"\"\"\nUtilities module.\n\"\"\"\n\nimport itertools\nimport numpy as np\nimport os\nimport zlib\n\n\n# import logging\n#\n# from pprint import pprint, pformat\n#\n# logger = logging.getLogger(\"k3d\")\n# fh = logging.FileHandler('k3d.log')\n# logger.addHandler(fh)\n# logger.setLevel(logging.DEBUG)\n\n\n# pylint:...
[ [ "numpy.nanmax", "numpy.asarray", "numpy.ascontiguousarray", "numpy.nanmin", "numpy.frombuffer", "numpy.shape", "numpy.interp", "numpy.array" ] ]
dklopfenstein/biocode
[ "1960a276279b3b7667ae37264b56252f0d2562ee", "1960a276279b3b7667ae37264b56252f0d2562ee" ]
[ "src/pydvkbiology/matplotlib/ColorObj.py", "src/bin/colorset_hexvals.py" ]
[ "\"\"\"From colormaps, get discrete colors.\"\"\"\n\n# Copyright (C) 2014-2015 DV Klopfenstein. All rights reserved.\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n...
[ [ "matplotlib.use", "matplotlib.cm.ScalarMappable", "matplotlib.pyplot.get_cmap", "matplotlib.colors.Normalize" ], [ "matplotlib.pyplot.scatter", "matplotlib.use", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.text", "matplotlib.pyplot.show...
avikejriwal/Codenames
[ "de62912a7515b34951013d86a9aae540f596bbdc" ]
[ "game.py" ]
[ "import numpy as np\nfrom agents.proto_agent import Proto_Agent\n#import pdb\nimport copy\n\nclass Game:\n\n def __init__(self, words, agent):\n def get_game_words(words):\n game_words = np.random.choice(words, replace=False, size=25)\n game_words = [i.replace('-', ' ').replace('_', ...
[ [ "numpy.random.shuffle", "numpy.random.choice" ] ]
ckrilow/dev-ckrilow
[ "2a3d8697b8cd899799069b1946b6901dbd144f7f", "2a3d8697b8cd899799069b1946b6901dbd144f7f" ]
[ "pipelines/0025-qc_cluster/bin/0028-plot_predicted_sex.py", "pipelines/0025-qc_cluster/bin/plot_anndataobs_distribution_across_cells.py" ]
[ "#!/usr/bin/env python\n\n\n__author__ = 'Monika Krzak'\n__date__ = '2020-05-20'\n__version__ = '0.0.1'\n\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport scanpy as sc\nimport plotnine as plt9\nimport matplotlib.pyplot as plt\nplt.rcParams[\"figure.figsize\"] = (10, 10)\n\n\ndef main():\n \"\"\"...
[ [ "numpy.in1d", "pandas.read_csv" ], [ "numpy.log10", "numpy.any" ] ]
EmotiVoice/emotivoice_model
[ "9e7e419f8f6124a4d155f78af54af8cdbf488973" ]
[ "model_tacotron2.py" ]
[ "from math import sqrt, ceil\nimport torch\nfrom torch.autograd import Variable\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom layers import ConvNorm, ConvNorm2D, LinearNorm\nfrom utils import to_gpu, get_mask_from_lengths\nfrom fp16_optimizer import fp32_to_fp16, fp16_to_fp32\nfrom gst_modules i...
[ [ "torch.nn.BatchNorm1d", "torch.nn.functional.softmax", "torch.sigmoid", "torch.max", "torch.cat", "torch.nn.functional.dropout", "torch.zeros", "torch.nn.ModuleList", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.Embedding", "torch.nn.LSTMCell", "torch.tanh",...
longhuei/tree2seq-terminology-translation
[ "c7502d42e7e1c9f76ee7a31e78956275177bdbf0" ]
[ "onmt/model_builder.py" ]
[ "\"\"\"\nThis file is for models creation, which consults options\nand creates each encoder and decoder accordingly.\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn.init import xavier_uniform_\n\nimport onmt.inputters as inputters\nimport onmt.modules\nfrom onmt.encoders.rnn_encoder import RNNEncoder\...
[ [ "torch.device", "torch.nn.init.xavier_uniform_", "torch.nn.LogSoftmax", "torch.load" ] ]
DirSampling/PrivateDPS
[ "a3df4cb799389ed16a620e322491c35a4cf4c797" ]
[ "PrivPSRL.py" ]
[ "import numpy as np\nfrom scipy.special import polygamma\nfrom scipy import optimize\n\n\ndef concentrated_objective(x,epsilon,lambda_,n):\n return epsilon-2*n*lambda_*polygamma(1,x-lambda_+1)\n\ndef concentrated_objective_derivative(x,epsilon,lambda_,n):\n return [-2*n*lambda_*polygamma(2,x-lambda_+1)]\n\nde...
[ [ "scipy.optimize.fsolve", "numpy.sqrt", "numpy.clip", "numpy.arange", "numpy.max", "numpy.random.normal", "numpy.apply_along_axis", "numpy.argmax", "scipy.special.polygamma", "numpy.random.gamma", "numpy.zeros" ] ]
fratullii/Udacity_Advanced-Lane-Finding
[ "d9a3fc9145bb86bff1b4fc735ce2fb9f0edc7bba" ]
[ "lanetracker.py" ]
[ "#!/usr/bin/python\nimport numpy as np\nimport cv2\n\ndef undistort(img, mtx, dist):\n \"\"\"\n Undistort image\n \"\"\"\n undist = cv2.undistort(img, mtx, dist, None, mtx)\n return undist\n\ndef sobel_filter(img, mode='x', low_thresh=0, high_thresh=255, kernel=3):\n \"\"\"\n Sobel filter imple...
[ [ "numpy.polyfit", "numpy.sqrt", "numpy.linspace", "numpy.concatenate", "numpy.int", "numpy.max", "numpy.zeros_like", "numpy.mean", "numpy.polyval", "numpy.hstack", "numpy.copy", "numpy.argmax", "numpy.float32", "numpy.int_", "numpy.append", "numpy.arr...
mxl1n/CodeGen
[ "e5101dd5c5e9c3720c70c80f78b18f13e118335a" ]
[ "codegen_sources/wrappers/models.py" ]
[ "# Copyright (c) 2019-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nimport os\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import CrossEntrop...
[ [ "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.nn.functional.dropout", "torch.load", "torch.nn.Tanh", "torch.tanh", "torch.nn.Linear", "torch.arange", "torch.nn.MSELoss", "torch.save" ] ]
andyklimczak/Stupid-Simple-Lineup-Exposure-Calculator
[ "177c0985e0e217c877ffc13437a90288faa764bb" ]
[ "app.py" ]
[ "import os, json, csv, io, math\nimport pandas as pd\nfrom collections import defaultdict, OrderedDict\nfrom flask import Flask, url_for, request, redirect, send_from_directory, session, render_template, flash\n\nALLOWED_EXTENSIONS = set(['csv'])\n\napp = Flask(__name__)\napp.secret_key = '123'\n\ndef calculateFoot...
[ [ "pandas.concat", "pandas.read_csv" ] ]
Alexa-TWIZ/BLINK
[ "908e3028288f15f5b79ddd98417c922cd03d0ddc" ]
[ "blink/crossencoder/data_process.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\nimport torch\nimport sys\n\nimport numpy as np\nfrom tqdm import tqdm\nimport blink.biencoder.data_process as d...
[ [ "numpy.asarray", "torch.LongTensor" ] ]
hkaneko1985/transfer_learning
[ "56020909c81f46973e24e9e03e7dcbb7120eb593" ]
[ "demo_of_transfer_learning_3_dataset_autoscale_x.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: hkaneko\r\n\"\"\"\r\n\r\nimport math\r\n\r\nimport matplotlib.figure as figure\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn import model_selection, svm\r\nfrom sklearn.cross_decomposition import PLSRegression\r\nfrom s...
[ [ "pandas.Series", "numpy.linalg.matrix_rank", "sklearn.linear_model.ElasticNet", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.max", "sklearn.gaussian_process.kernels.ConstantKernel", "pandas.read_csv", "matplotlib.figure.figaspect", "numpy.arange", "sklearn.linea...
NicePit/Practical_RL
[ "3460b35ce807f9274ff3c2d8c1181761973563cd" ]
[ "week05_explore/bayes.py" ]
[ "\"\"\"\nA single-file module that makes your lasagne network into a bayesian neural net.\nOriginally created by github.com/ferrine , rewritten by github.com/justheuristic for simplicity\n\nSee example in the notebook\n\"\"\"\n\nimport numpy as np\n\nfrom theano import tensor as T\nfrom theano.sandbox.rng_mrg impor...
[ [ "numpy.expm1", "numpy.exp", "numpy.log", "numpy.isfinite" ] ]
JamesDownsLab/particletracking
[ "17d14139d7d16c6aeae2213a02544d0fde94b602" ]
[ "particletracking/preprocessing/__init__.py" ]
[ "import numpy as np\nimport cv2 \nfrom labvision import images \nfrom particletracking.preprocessing import methods, crops \n\n\nclass PreProcessor:\n \n def __init__(self, parameters):\n self.parameters = parameters\n self.crop_method = self.parameters['crop method']\n self.mask_im = np....
[ [ "numpy.array" ] ]
vincnardelli/covid19-italia
[ "79339e4497d00118933b3345b79ca24e3ba83c67" ]
[ "macroregioni/macroregioni.py" ]
[ "import numpy as np\nfrom scipy.integrate import odeint\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom scipy.optimize import minimize\n\n# The SIR model differential equations.\ndef deriv(y, t, N, beta,gamma):\n S,I,R = y\n\n dSdt = -(beta*I/N)*S \n dIdt = (beta*S/N)*I - gamma*I \n dRdt = g...
[ [ "pandas.read_csv", "pandas.to_datetime", "numpy.abs", "numpy.arange", "numpy.around", "scipy.integrate.odeint", "numpy.vectorize", "numpy.argmin", "numpy.transpose", "numpy.exp", "numpy.array", "numpy.sum", "numpy.vstack" ] ]
rickstaa/CDAT
[ "00affee0149cc8211df113991f3596682ba0a3ff" ]
[ "cgdat/cgdat_gui.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nModule containing the main GUI class that is used in the *Conditional game data\nanalyse tool (CGDAT)* was created for a friend of mine to help him with the data\nanalysis he had to do for his graduation project. This tool is licensed under a\n`MIT license <https://github.com/ricks...
[ [ "pandas.concat", "pandas.eval", "pandas.to_datetime", "pandas.DataFrame", "numpy.diff", "pandas.ExcelWriter", "pandas.to_timedelta" ] ]
victech-dev/imitation
[ "1b8731837d6311a57a959933fbf16c30ba0ee17c" ]
[ "tests/test_dagger.py" ]
[ "\"\"\"Tests for DAgger.\"\"\"\nimport glob\nimport os\n\nimport gym\nimport numpy as np\nimport pytest\nfrom stable_baselines.common.policies import BasePolicy\nimport tensorflow as tf\n\nfrom imitation.algorithms import dagger\nfrom imitation.policies import serialize\nfrom imitation.util import rollout, util\n\n...
[ [ "tensorflow.variable_scope", "numpy.sum", "numpy.zeros", "numpy.allclose" ] ]
nsfzyzz/loss_landscape_taxonomy
[ "c1ec1fd59a6af5f72d4ff23679abb2f815f69101", "c1ec1fd59a6af5f72d4ff23679abb2f815f69101", "c1ec1fd59a6af5f72d4ff23679abb2f815f69101" ]
[ "workspace/src/code/measure_hessian.py", "workspace/src/code/curves.py", "workspace/src/code/CKA_utils.py" ]
[ "\"\"\"The following code is adapted from \nPyHessian: Neural Networks Through the Lens of the Hessian\nZ. Yao, A. Gholami, K Keutzer, M. Mahoney\nhttps://github.com/amirgholami/PyHessian\n\"\"\"\n\nfrom __future__ import print_function\n\nimport numpy as np\nimport random\nimport argparse\nimport torch\nimport tor...
[ [ "torch.nn.CrossEntropyLoss", "numpy.mean", "torch.load" ], [ "torch.nn.functional.batch_norm", "torch.abs", "torch.ones", "torch.Tensor", "torch.zeros", "numpy.arange", "torch.nn.functional.conv2d", "torch.sum", "torch.tensor", "torch.nn.modules.utils._pair"...
hmshreyas7/SketchyGAN
[ "854d283291048d67c3641e44c03a2b514df09a59" ]
[ "data_processing/tfrecord.py" ]
[ "import csv\n\nimport numpy as np\nimport tensorflow as tf\nimport cv2\n\n\ndef check_repeat(seq):\n seen = set()\n seen_add = seen.add\n seen_twice = set(x for x in seq if x in seen or seen_add(x))\n return list(seen_twice)\n\n\ndef binarize(sketch, threshold=245):\n sketch[sketch < threshold] = 0\n...
[ [ "numpy.arange", "numpy.zeros", "tensorflow.train.BytesList", "tensorflow.train.Int64List" ] ]
manhlab/vi-nlp
[ "614e07bf2de4d9eb4bc71823ec06999cc0086c6d" ]
[ "ner/network.py" ]
[ "\"\"\"\nCopyright 2017 Neural Networks and Deep Learning lab, MIPT\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applic...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.concat", "tensorflow.control_dependencies", "tensorflow.layers.dropout", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.train.AdamOptimizer", "tensorflow.contrib.crf.crf_log_likelihood", "tensorflow.Variabl...
Laende/Bacheloroppgave-droneteknologi
[ "15d9b2cd0eeba47fd2e9615fb01d598516826194", "15d9b2cd0eeba47fd2e9615fb01d598516826194" ]
[ "utils/flip_images.py", "utils/convert_yoloV3_weighs_to_tf.py" ]
[ "import os\r\nfrom os import listdir\r\nfrom os.path import join, isfile\r\nimport xml.etree.ElementTree as ET\r\nimport numpy as np\r\nimport cv2\r\nimport tqdm\r\n\r\nDATA_DIR = 'C:/Users/gieri/OneDrive/Skole/UiT/Droneteknologi/6. semester/Bacheloroppgave/Hovedprosjekt/Data'\r\nos.chdir(DATA_DIR)\r\n\r\nIMAGE_DIR...
[ [ "numpy.hstack", "numpy.array" ], [ "numpy.random.random" ] ]
laggingreflex/models
[ "7212436440eaa11293ca84befcc5d8327109ea76" ]
[ "official/resnet/keras/keras_imagenet_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.device", "tensorflow.keras.mixed_precision.experimental.Policy", "tensorflow.keras.mixed_precision.experimental.set_policy", "tensorflow.test.is_built_with_cuda", "tensorflow.keras.backend.set_image_data_format", "tensorflow.keras.backend.set_learning_phase" ] ]
yusukeorito/ayniy
[ "5f7b15d757dd46696e0f5c440a958b34c1536eaa" ]
[ "ayniy/model/model_cat.py" ]
[ "import os\n\nimport catboost as cb\nimport numpy as np\nimport pandas as pd\n\nfrom ayniy.model.model import Model\nfrom ayniy.utils import Data\n\n\nclass ModelCatClassifier(Model):\n def train(\n self,\n tr_x: pd.DataFrame,\n tr_y: pd.DataFrame,\n va_x: pd.DataFrame = None,\n ...
[ [ "pandas.DataFrame" ] ]
tprodanov/parascopy
[ "fb3b201334c20761389ff3a9876e15c5e97dd724" ]
[ "src/parascopy/inner/variants.py" ]
[ "import sys\nimport operator\nimport itertools\nimport pysam\nimport numpy as np\nfrom enum import Enum\nfrom scipy.stats import poisson, multinomial\nfrom scipy.special import logsumexp\nfrom functools import lru_cache\nfrom collections import namedtuple, defaultdict\n\nfrom . import duplication as duplication_\nf...
[ [ "numpy.product", "numpy.max", "numpy.exp", "numpy.clip", "numpy.uint8", "numpy.full", "numpy.argmax", "numpy.repeat", "numpy.zeros", "numpy.log", "numpy.isnan", "numpy.floor", "numpy.errstate", "numpy.argsort", "numpy.array", "numpy.sum", "scipy....
Lucas-Gui/OpenNMT-tf
[ "3a4d303503f03ed1784f32e20b3f92a4d758860a" ]
[ "opennmt/models/model.py" ]
[ "\"\"\"Base class for models.\"\"\"\n\nimport abc\n\nimport tensorflow as tf\n\nfrom opennmt import optimizers\nfrom opennmt import schedules\nfrom opennmt.utils import exporters\nfrom opennmt.utils import losses\nfrom opennmt.utils import misc\n\n\nclass Model(tf.keras.layers.Layer):\n \"\"\"Base class for models...
[ [ "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.expand_dims", "tensorflow.function", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.TensorSpec.from_spec", "tensorflow.sequence_mask" ] ]
mmtaksuu/OpenCV_Python_Tutorial
[ "d945e79f939ee0a529f1068b0f504260eb13c8c9" ]
[ "ImgSegment06.py" ]
[ "import cv2\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\ndef main():\r\n\t\r\n\tpath = \"C:\\\\Users\\\\enesa\\\\Documents\\\\MATLAB\\\\blobs_objects.jpg\"\r\n\r\n\timg = cv2.imread(path, 1)\r\n\timg = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)\r\n\t\r\n\tfilter1 = np.array(([0, -1, 0], [-1, 5, -1], [0...
[ [ "numpy.array", "matplotlib.pyplot.show", "numpy.ones" ] ]
dargueso/SkewT
[ "723c5d7b6a1acc82d565203d7da0a6adad849311" ]
[ "skewt/skewx_projection.py" ]
[ "# This serves as an intensive exercise of matplotlib's transforms\n# and custom projection API. This example produces a so-called\n# SkewT-logP diagram, which is a common plot in meteorology for\n# displaying vertical profiles of temperature. As far as matplotlib is\n# concerned, the complexity comes from having X...
[ [ "matplotlib.spines.Spine.linear_spine", "matplotlib.axis.YAxis", "matplotlib.transforms.Affine2D", "matplotlib.transforms.IdentityTransform", "matplotlib.axis.XAxis.__init__", "matplotlib.axes.Axes._set_lim_and_transforms" ] ]
nirvanasupermind/tetra
[ "e15100ce28d95028e5931543e6f2919e513ab6c4" ]
[ "scripts/iterate.py" ]
[ "import numpy as np\nimport deriv\nimport math\n\ndef fac(x):\n #Q&D recursive factorial for carlemanmatrix\n if x == 0:\n return 1\n else:\n return x*fac(x-1)\n\ndef sqrtm(a):\n #Finds the square root of np matrix\n y = a\n z = np.matrix(np.identity(a.shape[0]))\n #Perform Denman...
[ [ "numpy.matrix", "numpy.polyfit", "numpy.array", "numpy.identity" ] ]
CamDavidsonPilon/bambi
[ "c4af6c9be58aeef927b29fce43ec495b04dc0443" ]
[ "bambi/models.py" ]
[ "# pylint: disable=no-name-in-module\n# pylint: disable=too-many-lines\nimport logging\nimport warnings\nfrom copy import deepcopy\n\nimport numpy as np\nimport pandas as pd\nimport pymc3 as pm\n\nfrom arviz.plots import plot_posterior\nfrom arviz.data import from_dict\nfrom numpy.linalg import matrix_rank\nfrom fo...
[ [ "numpy.dot", "pandas.read_csv", "numpy.linalg.matrix_rank", "numpy.atleast_2d", "numpy.vstack" ] ]
robert-giaquinto/survae_flows
[ "4d7dc638f77c48ad3c8393b967c33ac9dbad60fe", "4d7dc638f77c48ad3c8393b967c33ac9dbad60fe" ]
[ "experiments/gbnf/experiment/flow_experiment.py", "examples/mnist_vae.py" ]
[ "import torch\nimport torchvision.utils as vutils\n\nfrom survae.distributions import DataParallelDistribution\nfrom survae.utils import elbo_bpd, cond_elbo_bpd\nfrom .utils import get_args_table, clean_dict\n\n# Path\nimport os\nimport time\nfrom survae.data.path import get_survae_path\n\n# Experiment\nfrom .base ...
[ [ "torch.cuda.amp.GradScaler", "torch.no_grad", "torch.cuda.amp.autocast" ], [ "torch.no_grad", "torch.cuda.is_available" ] ]
argriffing/hmmus
[ "c91696735eed420bbf13b3cb177d3a652efaff69" ]
[ "example/zygosity3.py" ]
[ "\"\"\"\nAnalyze a fasta file using a three-state HMM.\n\"\"\"\n\nimport numpy as np\n\nfrom hmmus import zygohelper\n\n# state 0: homozygous\n# state 1: heterozygous\n# state 2: bad\n\n# emission 0: ACGT\n# emission 1: MRWSYK\n# emission 2: N\n\ng_letter_to_emission = {\n 'A':0, 'C':0, 'G':0, 'T':0,\n ...
[ [ "numpy.array" ] ]
mkstratos/stj_pv
[ "092dc88fab708084a3136a1c1c08153ea6157721" ]
[ "STJ_PV/input_data.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Generate or load input data for STJ Metric.\"\"\"\nimport os\nimport numpy as np\nimport pkg_resources\nimport datetime as dt\nimport xarray as xr\n# Dependent code\nimport STJ_PV.utils as utils\n\n__author__ = \"Penelope Maher, Michael Kelleher\"\n\n\ndef package_data(relpath, file_...
[ [ "numpy.prod" ] ]
zivadinac/CSBDeep
[ "2c374d5641f1eba8aafbb8d2b858814bc281701a" ]
[ "csbdeep/data/generate.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import print_function, unicode_literals, absolute_import, division\nfrom six.moves import range, zip, map, reduce, filter\nfrom six import string_types\n\nimport numpy as np\nimport sys, os, warnings\n\nfrom tqdm import tqdm\nfrom ..utils import _raise, consume, compose, no...
[ [ "scipy.ndimage.filters.maximum_filter", "numpy.expand_dims", "numpy.take", "numpy.random.choice", "numpy.empty_like", "numpy.percentile", "numpy.ones", "numpy.all", "numpy.random.uniform", "numpy.zeros_like", "numpy.prod", "numpy.moveaxis", "numpy.isscalar", ...