repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
tthhee/tensorpack | [
"199da52172c7ec1343619dc3177e34d227be24ab"
] | [
"tensorpack/train/trainers.py"
] | [
"# -*- coding: utf-8 -*-\n# File: trainers.py\n\nimport multiprocessing as mp\nimport os\nimport sys\nimport tensorflow as tf\n\nfrom ..callbacks import CallbackFactory, RunOp\nfrom ..graph_builder.distributed import DistributedParameterServerBuilder, DistributedReplicatedBuilder\nfrom ..graph_builder.training impo... | [
[
"tensorflow.name_scope"
]
] |
LongerVision/h2o-3 | [
"e19a1e27cb46714e102e86fbc2421ddb551a1932"
] | [
"h2o-py/tests/testdir_jira/pyunit_pubdev_5336.py"
] | [
"import h2o\nimport pandas as pd\nfrom tests import pyunit_utils\n\n\ndef pubdev_5336():\n data = pd.DataFrame({'Origin': ['SFO', 'SAN', 'SFO', 'NYC', None],\n 'Dest': ['SFO', 'SFO', 'SAN', 'SAN', None]})\n frame = h2o.H2OFrame(data)\n frame['Origin'].asfactor()\n frame['Dest'].a... | [
[
"pandas.DataFrame"
]
] |
epfml/byzantine-robust-decentralized-optimizer | [
"5387d600354a0fbf137c3e4346c4441b2f427407"
] | [
"codes/tasks/quadratics.py"
] | [
"import contextlib\nimport copy\nimport math\nimport numpy as np\nimport torch\n\n\nclass LinearModel(torch.nn.Module):\n def __init__(self, d):\n super(LinearModel, self).__init__()\n self.layer = torch.nn.Linear(d, 1, bias=False)\n\n def forward(self, x):\n return self.layer(x)\n\n\ndef... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.nn.MSELoss",
"torch.linalg.svd",
"torch.is_tensor",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"numpy.linalg.solve",
"torch.random.fork_rng",
"torch.diag",
"torch.randn"
]
] |
XuchanBao/ICCV2019-LearningToPaint | [
"777effbd496567c619c6f9896a2f349c1a842850"
] | [
"baseline_modelfree/env.py"
] | [
"import sys\nimport json\nimport torch\nimport numpy as np\nimport argparse\nimport torchvision.transforms as transforms\nimport cv2\nfrom DRL.ddpg import decode\nfrom Renderer.quadratic_gen import get_initialization, generate_quadratic_heatmap\nfrom utils.util import *\nfrom PIL import Image\nfrom torchvision impo... | [
[
"torch.zeros",
"numpy.array",
"numpy.asarray",
"torch.ones",
"torch.cuda.is_available",
"numpy.transpose",
"numpy.random.randint"
]
] |
tansey/hrt | [
"f6d271a34590d073a08f0fc40f40e898f38cdf97"
] | [
"benchmarks/liang/sim_liang_agg.py"
] | [
"import matplotlib\nmatplotlib.use('Agg')\nimport os\nimport numpy as np\nimport matplotlib.pylab as plt\nimport seaborn as sns\nfrom pyhrt.utils import bh_predictions, tpr, fdr, pretty_str\n\ndef p_plot(p_values, S, start=0, end=1):\n plt.close()\n with sns.axes_style('white', {'legend.frameon': True}):\n ... | [
[
"matplotlib.pylab.savefig",
"matplotlib.pylab.ylabel",
"numpy.load",
"numpy.nanmean",
"numpy.sort",
"matplotlib.pylab.xlim",
"numpy.concatenate",
"numpy.full",
"pandas.DataFrame",
"matplotlib.pylab.close",
"numpy.save",
"numpy.arange",
"matplotlib.pylab.plot",
... |
kasmith/OptimTools | [
"1212a66b57e335cb5a4563f23c936aba9dede56f"
] | [
"OptimTools/producer_consumer.py"
] | [
"from __future__ import division, print_function\nfrom multiprocessing import Process, Condition, Event, Queue, cpu_count\nimport numpy as np\nimport time\nimport random\n\n# A Producer that initializes with loaded data then waits for further processing on that data\nclass _Producer(Process):\n def __init__(self... | [
[
"numpy.random.seed"
]
] |
Hirosaji/bert | [
"74b9d39044c4123e0851e7adc1d5182a0d720a3b"
] | [
"server/bert_script/tokenization.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl... | [
[
"tensorflow.io.gfile.GFile"
]
] |
Ronlin1/Sentiment_Analysis | [
"96c9da01931b57cf861fd97c32e2947cb63fb09c"
] | [
"vectoriser.py"
] | [
"# importing the modules\nfrom sklearn.feature_extraction.text import HashingVectorizer\nimport re\nimport os\nimport pickle\n\n# now we open the stopwords we created before\nstop = pickle.load(open('stopwords.pkl', 'rb'))\n\n\ndef tokenizer(text):\n text = re.sub('<[^>]*>', '', text)\n emoticons = re.findall... | [
[
"sklearn.feature_extraction.text.HashingVectorizer"
]
] |
welkin-feng/cs285-homework-2020 | [
"ce2511acd7233e0ecf9ffc030f7d76e1f8919745"
] | [
"hw3/cs285/policies/argmax_policy.py"
] | [
"import numpy as np\n\n\nclass ArgMaxPolicy(object):\n\n def __init__(self, critic):\n self.critic = critic\n\n def get_action(self, obs):\n \"\"\"\n Assert action is discrete.\n\n Args:\n obs (np.ndarray): size [N, ob_dim]\n\n Returns:\n actions (n... | [
[
"numpy.argmax"
]
] |
autoih/addons | [
"b59f0e89ca09837808331be1eee8ae8df8eb9355"
] | [
"tensorflow_addons/activations/tanhshrink_test.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.random.seed",
"tensorflow.convert_to_tensor",
"numpy.random.uniform",
"tensorflow.GradientTape"
]
] |
gridgentoo/h2o-tree | [
"92478be7633fcf3f4b550fe4cbf69bf85112391e"
] | [
"h2o-py/tests/testdir_munging/unop/pyunit_vec_math_ops.py"
] | [
"from builtins import zip\nfrom builtins import range\nimport sys\nsys.path.insert(1,\"../../../\")\nimport h2o\nfrom tests import pyunit_utils\nimport numpy as np\nimport random\nimport math\nimport scipy.special\n\n\ndef vec_math_ops():\n\n sin_cos_tan_atan_sinh_cosh_tanh_asinh_data = [[random.uniform(-10,10) ... | [
[
"numpy.array",
"numpy.arccos",
"numpy.sin",
"numpy.arcsin",
"numpy.cosh",
"numpy.tan",
"numpy.arccosh",
"numpy.tanh",
"numpy.arctan",
"numpy.sinh",
"numpy.cos",
"numpy.arcsinh"
]
] |
Neptune-Trojans/ACTOR | [
"26d548e4e7004a8e8a2a476433fc8397d5dc5435"
] | [
"src/visualize/visualize_dataset.py"
] | [
"import matplotlib.pyplot as plt\nimport os\nimport pandas as pd\nimport plotly.express as px\n\nfrom src.datasets.get_dataset import get_dataset\nfrom src.parser.visualize import parser\nfrom src.visualize.visualize import viz_dataset\n\nplt.switch_backend('agg')\n\n\ndef build_dataset_dist(dataset):\n frames_b... | [
[
"matplotlib.pyplot.switch_backend",
"pandas.DataFrame"
]
] |
BRutan/DynamicETLDashboard | [
"8a40e6f51e53f084d6103ba41cd675916505652f"
] | [
"DynamicETLDashboard/DynamicETL_Dashboard/ETL/DataComparer.py"
] | [
"#####################################\n# DataComparer.py\n#####################################\n# Description:\n# * Generate report comparing two datasets.\n\nimport os\nfrom pandas import DataFrame, MultiIndex\nimport xlsxwriter\n\nclass DataComparer(object):\n \"\"\"\n * Compare two DataFrames.\n \"\"\... | [
[
"pandas.DataFrame"
]
] |
neylsoncrepalde/sysidentpy | [
"d1af4243e7c3d2c0b456fb9b4fe120965a7ededc"
] | [
"sysidentpy/polynomial_basis/tests/test_simulation.py"
] | [
"from numpy.testing._private.utils import assert_allclose\nfrom sysidentpy.polynomial_basis import PolynomialNarmax\nfrom sysidentpy.utils.generate_data import get_miso_data, get_siso_data\nimport numpy as np\nfrom numpy.testing import assert_almost_equal, assert_array_equal\nfrom numpy.testing import assert_raises... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array",
"numpy.testing.assert_raises"
]
] |
iminders/multiagent-particle-envs | [
"6a1341dff68520bd61d3ab97f89dbd32e70dd664"
] | [
"multiagent/scenarios/simple_speaker_listener.py"
] | [
"import numpy as np\n\nfrom multiagent.core import Agent, Landmark, World\nfrom multiagent.scenario import BaseScenario\n\n\nclass Scenario(BaseScenario):\n def make_world(self, num_agents=2):\n world = World()\n # set any world properties first\n world.dim_c = 3\n num_landmarks = 3\n... | [
[
"numpy.square",
"numpy.concatenate",
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.random.uniform"
]
] |
maloyan/jina | [
"93404a9545b3ca1870df61ac8b34910277770f38"
] | [
"tests/integration/rolling_update/test_rolling_update.py"
] | [
"import collections\nimport multiprocessing\nimport os\nimport threading\nimport time\n\nimport numpy as np\nimport pytest\n\nfrom jina import Document, Flow, Executor, requests, Client\n\ncur_dir = os.path.dirname(os.path.abspath(__file__))\nexposed_port = 12345\n\n\n@pytest.fixture\ndef config(tmpdir):\n os.en... | [
[
"numpy.array"
]
] |
FelixFu520/yolov1 | [
"8bf464702d75b03ec09878cdf4090a4442cdac34"
] | [
"utils/dataset.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@Time : 2020/08/07 15:07\n@Author : FelixFu\n@File : train.py\n@Noice :\n@Modificattion : txt描述文件 image_name.jpg x y w h c x y w h c 这样就是说一张图片中有两个目标\n @Author :\n @Time :\n @Detail :\n\"\"\"\n\nimport os\nimport os.path\n\nimport... | [
[
"torch.zeros",
"numpy.array",
"numpy.zeros",
"torch.FloatTensor",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"numpy.clip",
"torch.Tensor",
"numpy.fliplr"
]
] |
ajmal017/ralph-usa | [
"41a7f910da04cfa88f603313fad2ff44c82b9dd4"
] | [
"algDev/run.py"
] | [
"from algDev.preprocessing.feature_generation import *\nfrom algDev.preprocessing import data_generator\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom algDev.models.equity import Equity\nfrom algDev.algorithms.cnn import CNN\nfrom algDev.algorithms.svm import SVM\nfrom algDev.API.indicators import get_i... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
niyoj/AcademicContent | [
"e943b48719f06e5fe60874b84a4b8b8491ed9e99"
] | [
"Events and Hacks/AI Hackathon/Code and Data/5_image_recogniser.py"
] | [
"import scipy\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.externals._pilutil import imread\nimport os\nos.chdir('data/images_part1')\n\ntrainimage = []\nfor i in range(11):\n A = imread(str(i) + '.png', flatten = True)\n B, c, D = np.linalg.svd(A)\n trainimage.append({'original': A, ... | [
[
"matplotlib.pyplot.show",
"numpy.linalg.svd",
"matplotlib.pyplot.imshow"
]
] |
JLivingston01/py_research | [
"928f74287039a933d27c5a5dc3df8db4cb79c152",
"928f74287039a933d27c5a5dc3df8db4cb79c152"
] | [
"scripts/kmeans_dem0.py",
"scripts/pytorch_word_embedding.py"
] | [
"\n\nimport numpy as np\n\nd1 = np.random.normal(3,.5,(10,3))\nd2=np.random.normal(5,.5,(8,3))\n\nd3=np.random.normal(7,.5,(8,3))\n\n\nd = np.vstack((d1,d2,d3))\n\ncentroids=3\n\nc=np.random.normal(np.mean(d),np.std(d),(centroids,d.shape[1]))\n\n\ndef kmeans(dat,centroids,max_iter):\n \n d = dat \n c=np... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.argmin",
"numpy.sum",
"numpy.mean",
"numpy.std",
"numpy.vstack"
],
[
"numpy.array",
"matplotlib.pyplot.annotate",
"torch.nn.MSELoss",
"torch.nn.Sigmoid",
"pandas.DataFrame",
"torch.from_numpy",
"matplotlib.pyp... |
j1c/graspologic | [
"ff34382d1ffa0b7ea5f0e005525b7364f977e86f",
"ff34382d1ffa0b7ea5f0e005525b7364f977e86f"
] | [
"graspologic/align/base.py",
"tests/cluster/test_divisive_cluster.py"
] | [
"# Copyright (c) Microsoft Corporation and contributors.\n# Licensed under the MIT License.\n\nfrom abc import abstractmethod\nfrom typing import TypeVar\n\nimport numpy as np\nfrom sklearn.base import BaseEstimator\nfrom sklearn.utils import check_array\n\nfrom graspologic.types import Tuple\n\nSelf = TypeVar(\"Se... | [
[
"sklearn.utils.check_array"
],
[
"numpy.max",
"numpy.random.normal",
"numpy.testing.assert_allclose",
"numpy.testing.assert_equal",
"numpy.random.seed",
"numpy.testing.assert_array_less",
"sklearn.metrics.adjusted_rand_score",
"numpy.unique",
"numpy.repeat",
"numpy.... |
sakibh/qfit-3.0 | [
"fcc9d56b21d2d16ffb2796da0d48003649a31909"
] | [
"src/qfit/backbone.py"
] | [
"'''\nExcited States software: qFit 3.0\n\nContributors: Saulo H. P. de Oliveira, Gydo van Zundert, and Henry van den Bedem.\nContact: vdbedem@stanford.edu\n\nCopyright (C) 2009-2019 Stanford University\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated do... | [
[
"numpy.asmatrix",
"numpy.dot",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.zeros",
"numpy.linalg.eigh",
"scipy.linalg.null_space",
"numpy.cross"
]
] |
cbilodeau2/chemprop | [
"08903b0af0f62fdb09c497fd2e21fbbe2b5261ae"
] | [
"chemprop/train/loss_funcs.py"
] | [
"\"\"\"Custom loss functions.\"\"\"\n\nimport torch\nimport torch.nn as nn\n\nclass ContrastiveLoss(nn.Module):\n\n def __init__(self):\n \"\"\"\n Initializes contrastive loss with no reduction.\n \"\"\"\n super(ContrastiveLoss, self).__init__()\n self.logsoftmax=nn.LogSoftmax(... | [
[
"torch.nn.LogSoftmax",
"torch.cat"
]
] |
wen0618/simple-faster-rcnn-pytorch | [
"b5c41eeaf9f0641f65bdd6fe0d7f1301bd1cabf3"
] | [
"model/region_proposal_network.py"
] | [
"import numpy as np\nfrom torch.nn import functional as F\nimport torch as t\nfrom torch import nn\n\nfrom model.utils.bbox_tools import generate_anchor_base\nfrom model.utils.creator_tool import ProposalCreator\n\n\nclass RegionProposalNetwork(nn.Module):\n \"\"\"Region Proposal Network introduced in Faster R-C... | [
[
"numpy.concatenate",
"numpy.array",
"torch.arange",
"torch.nn.Conv2d",
"numpy.arange",
"numpy.meshgrid"
]
] |
vijaykiran/mlflow | [
"4edde91d0fa9909f5894bf84529b3416d52d83f6"
] | [
"tests/spark/test_spark_model_export.py"
] | [
"import os\n\nimport json\nimport pandas as pd\nimport pyspark\nfrom pyspark.ml.classification import LogisticRegression\nfrom pyspark.ml.feature import VectorAssembler\nfrom pyspark.ml.pipeline import Pipeline\nfrom pyspark.ml.wrapper import JavaModel\nfrom pyspark.ml.util import _jvm\nfrom pyspark.version import ... | [
[
"pandas.DataFrame",
"sklearn.datasets.load_iris",
"pandas.Series"
]
] |
Jacc0027/pvlib-python | [
"65782fdf24c96cc092329942e29904e78b0b3cce"
] | [
"pvlib/clearsky.py"
] | [
"\"\"\"\nThe ``clearsky`` module contains several methods\nto calculate clear sky GHI, DNI, and DHI.\n\"\"\"\n\nimport os\nfrom collections import OrderedDict\nimport calendar\n\nimport numpy as np\nimport pandas as pd\nfrom scipy.optimize import minimize_scalar\nfrom scipy.linalg import hankel\nimport tables\n\nfr... | [
[
"numpy.minimum",
"numpy.exp",
"scipy.optimize.minimize_scalar",
"numpy.mean",
"numpy.where",
"numpy.radians",
"numpy.cos",
"numpy.cumsum",
"numpy.deg2rad",
"numpy.full_like",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.log",
"pandas.DataFrame",
"nump... |
dodobill/pytorch_tutorial | [
"33b76aa47e2fdba072b049159c0f56512562c203"
] | [
"classifier/second.py"
] | [
"'''\ntraining a classifier\n1. 加载并规范化测试数据\n2. 定义一个卷积网络\n3. 在训练数据上训练神经网络\n4. 在测试数据山测试网络\n'''\nimport torch\nimport torchvision\nimport torchvision.transforms as transforms\n\ntransform = transforms.Compose(\n [transforms.ToTensor(),\n transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])#input[channel] = ... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Conv2d",
"numpy.transpose",
"torch.utils.data.DataLoader",
"torch.load",
"matplotlib.pyplot.show",
"torch.nn.CrossEntropyLoss"
]
] |
d-sot/hdmf | [
"6df64fe9f2f8163d1c688561c4a5a7ae96ae7284"
] | [
"tests/unit/test_io_hdf5_h5tools.py"
] | [
"import os\nimport unittest\nimport tempfile\nimport warnings\nimport numpy as np\n\nfrom hdmf.utils import docval, getargs\nfrom hdmf.data_utils import DataChunkIterator, InvalidDataIOError\nfrom hdmf.backends.hdf5.h5tools import HDF5IO, ROOT_NAME\nfrom hdmf.backends.hdf5 import H5DataIO\nfrom hdmf.backends.io imp... | [
[
"numpy.array",
"numpy.zeros",
"numpy.testing.assert_array_equal",
"numpy.arange",
"numpy.isfinite",
"numpy.all",
"numpy.dtype"
]
] |
wangronin/Bayesian-Optimization | [
"ffbcf4c8813dfa603b9065355e20eda0ccb99e30"
] | [
"unittest/test_warmdata.py"
] | [
"import sys\n\nimport numpy as np\n\nsys.path.insert(0, \"../\")\n\nfrom bayes_optim import BO, DiscreteSpace, IntegerSpace, RealSpace\nfrom bayes_optim.surrogate import GaussianProcess, RandomForest\n\nnp.random.seed(42)\n\n\ndef obj_fun(x):\n x_r, x_i, x_d = np.array(x[:2]), x[2], x[3]\n if x_d == \"OK\":\n... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.asarray",
"numpy.random.seed",
"numpy.sum",
"numpy.ones"
]
] |
bartek-wojcik/graph_classification | [
"313f71bd04c3aed889e29921ff19590c6827dde4"
] | [
"src/models/modules/graph_sage.py"
] | [
"from torch import nn\nfrom torch_geometric.nn import (\n SAGEConv,\n global_add_pool,\n global_max_pool,\n global_mean_pool,\n)\n\n\nclass GraphSAGE(nn.Module):\n \"\"\"Flexible GraphSAGE network.\"\"\"\n\n def __init__(self, hparams: dict):\n super().__init__()\n self.hparams = hpa... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList"
]
] |
plewandowska777/QuIT | [
"1e1ea4d57e16a6074c123ed01b22ad190384329c"
] | [
"tests/test_quit.py"
] | [
"import numpy as np\nimport pytest\nfrom scipy import linalg\n\nfrom quit.basicfunction import (\n basis,\n bell_state,\n bell_state_density,\n bra,\n braket,\n dagger,\n ket,\n ketbra,\n proj,\n res,\n unres,\n unvec,\n vec,\n)\n\n\n@pytest.mark.parametrize(\"phi\", [np.pi, n... | [
[
"numpy.array",
"numpy.asarray",
"numpy.identity",
"scipy.linalg.hadamard",
"numpy.transpose",
"numpy.sqrt",
"numpy.conjugate",
"numpy.kron"
]
] |
RomuloSouza/elections-data-visualization | [
"f089757a5dd2d80d4f5c0835332ab62cd34b74c3"
] | [
"create_insert_candidate.py"
] | [
"import pandas as pd\nimport bisect\n\nMAX_CANDIDATES = 1000\n\nINSERT_CANDIDATE = \"\"\"\nINSERT INTO CANDIDATO (cpf, nomeUrna, sexo, nomeCandidato, dtNascimento)\nVALUES ('{}', '{}', '{}', '{}', {});\n\"\"\"\n\n\ndef create_insert_string(row):\n dt = str(row[6])\n dt = f\"'{dt[-4:]}-{dt[2:4]}-{dt[0:2]}'\"\n... | [
[
"pandas.read_csv"
]
] |
rhasspy/tacotron2-train | [
"9fcd05d6eb10e352d257ab158ccc56e84d2aa616"
] | [
"tacotron2_train/dataset.py"
] | [
"\"\"\"Classes and methods for loading phonemes and mel spectrograms\"\"\"\nimport csv\nimport json\nimport logging\nimport random\nimport typing\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nimport torch.utils.data\n\n_LOGGER = logging.getLogger(\"tacotron2_train.dataset\")\n\n# ------------------... | [
[
"torch.IntTensor",
"torch.FloatTensor",
"torch.Tensor",
"numpy.load"
]
] |
Quinn-5/FRC-2020-Vision-Tests | [
"ed4845856ac141f457d27e1457f9223ceb95e4d9"
] | [
"Final Products/frc_vision_final.py"
] | [
"# Contains most of the vision processing, though the most complete is under Offline_Filter\n# Likely to become the final product file for vision processing\n# The exposure options are likely needed to be adjusted per competition\n# They are currently tuned to the testing area\n# Tuning for the RealSense camera can... | [
[
"numpy.array",
"numpy.arctan",
"numpy.zeros"
]
] |
RnoB/fly-matrix | [
"50733b1be715fccb386c1a4bb9e57f19d82a0078"
] | [
"dbGen/zebraDB.py"
] | [
"import sqlite3\r\nimport itertools\r\nimport numpy as np\r\nfrom random import shuffle\r\n\r\nprojectDB = 'zebraProjects.db'\r\nexpDB = 'zebraExperiments.db'\r\n\r\nproject = 'DecisionGeometry'\r\n\r\nnPosts = 10\r\nnCubes = 3\r\n\r\nposts = range(1,2)\r\nposts = list(itertools.chain.from_iterable(itertools.repeat... | [
[
"numpy.sin",
"numpy.random.randint",
"numpy.amax",
"numpy.cos",
"numpy.unique"
]
] |
michael7198/deeplenstronomy_tests | [
"e310684669f403969e169843185255a468c299d9"
] | [
"exploded_setup_old/test/test_ImSim/test_plot_sims.py"
] | [
"from deeplenstronomy.ImSim import image_sim\nfrom deeplenstronomy.ImSim import plot_sim\nfrom deeplenstronomy.PopSim.population import Population\nimport pytest\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport numpy.testing as npt\n\n\nclass TestPlotSim(object):\n\n def setup(self):\n pass\n\... | [
[
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots"
]
] |
tdeboer-ilmn/hail | [
"98fffc9b4e13cd5d5ced8322112894361d0b7052"
] | [
"hail/python/hail/stats/linear_mixed_model.py"
] | [
"import numpy as np\nimport pandas as pd\n\nimport hail as hl\nfrom hail.linalg import BlockMatrix\nfrom hail.linalg.utils import _check_dims\nfrom hail.table import Table\nfrom hail.typecheck import typecheck_method, nullable, tupleof, oneof, numeric\nfrom hail.utils.java import Env, info\nfrom hail.utils.misc imp... | [
[
"numpy.max",
"pandas.DataFrame.from_records",
"numpy.array",
"numpy.linalg.slogdet",
"numpy.zeros",
"numpy.log",
"numpy.sum",
"numpy.exp",
"scipy.optimize.minimize_scalar",
"scipy.linalg.solve",
"scipy.stats.distributions.chi2.sf",
"numpy.allclose",
"numpy.sqrt"... |
google/alligator2 | [
"d97d4691b292d970b5b0e0e1f0eb243538fc6392"
] | [
"topic_clustering.py"
] | [
"# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.divide",
"tensorflow.compat.v2.get_logger",
"numpy.array",
"tensorflow.compat.v2.math.reduce_max",
"pandas.DataFrame",
"tensorflow.compat.v2.compat.v1.estimator.experimental.KMeans",
"tensorflow.compat.v2.math.argmax",
"pandas.Series",
"tensorflow.compat.v2.reduce_sum",
... |
selvanponraj/qtpylib | [
"f67e9b2de3f8ea124f899386a696c61201332feb"
] | [
"qtpylib/broker.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# QTPyLib: Quantitative Trading Python Library\n# https://github.com/ranaroussi/qtpylib\n#\n# Copyright 2016-2018 Ran Aroussi\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... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"numpy.where",
"pandas.concat"
]
] |
TimO96/NLP2 | [
"83f65a385457f68397c641f38b53df0110282578"
] | [
"Assignment1/model.py"
] | [
"# Copyright (c) 2018-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 torch.nn as nn\nimport torch.utils.data.dataloader\n\n\nclass RNNModel(nn.Module):\n \"\"\"Container modu... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Embedding",
"torch.nn.RNN"
]
] |
xiaotaw/faster-lio | [
"ff0c9092989da5dc3f1f66e798915d648b31b695"
] | [
"result/plot_time.py"
] | [
"# coding=\"utf8\"\nimport sys\nimport pandas as pd\nfrom matplotlib import pyplot as plt\n\n\ndef remove_outlier(x):\n q1 = x.quantile(0.25)\n q3 = x.quantile(0.75)\n m = (x <= q3 + (q3 - q1) * 1.5).all(axis=1)\n return x[m]\n\n\ndef time_plot(log_file):\n # read time log\n # log_file = \"2013011... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
xuehaouwa/VMZ | [
"44492f03c7c43a2add6572a927af6637ddb02f38"
] | [
"app/tools/test_net.py"
] | [
"# Copyright 2018-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable la... | [
[
"numpy.max",
"numpy.mean"
]
] |
jlaneve/astro | [
"4528162c7582f3860d1d21de7af954f20c9f9a6a"
] | [
"tests/operators/transform/test_transform.py"
] | [
"import pathlib\n\nimport pandas as pd\nimport pytest\nfrom airflow.decorators import task\n\nfrom astro import sql as aql\nfrom astro.dataframe import dataframe as adf\nfrom astro.sql.table import Table\nfrom tests.operators import utils as test_utils\n\ncwd = pathlib.Path(__file__).parent\n\n\n@pytest.mark.parame... | [
[
"pandas.DataFrame"
]
] |
omkarmali/dsmp-pre-work | [
"7032b0af8a8571a638915ac88a9b9760814aa25c"
] | [
"Loan-defaulters/code.py"
] | [
"# --------------\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# code starts here\ndf=pd.read_csv(path)\n\ntotal_length=len(df)\nprint(total_length)\n\nfico=0\nfor i in df['fico'] > 700:\n fico+=i\nprint(fico)\n\np_a=fico/total_length\nprint(p_a)\n\ndebt=0\n\nfor i in df['purpose... | [
[
"matplotlib.pyplot.show",
"pandas.Series",
"matplotlib.pyplot.axvline",
"pandas.read_csv",
"matplotlib.pyplot.bar"
]
] |
wadhikar/napari | [
"954fc69a5c6939c473021994d41ff14a384399f4"
] | [
"napari/_qt/layer_controls/qt_image_controls_base.py"
] | [
"from contextlib import suppress\nfrom functools import partial\n\nimport numpy as np\nfrom qtpy.QtCore import Qt\nfrom qtpy.QtGui import QImage, QPixmap\nfrom qtpy.QtWidgets import QLabel, QPushButton, QSlider\n\nfrom ...utils.colormaps import AVAILABLE_COLORMAPS\nfrom ...utils.translations import trans\nfrom ..ut... | [
[
"numpy.issubdtype"
]
] |
yxoos/CorrelationMatrix | [
"556443949be007fef9739c8a25866ea2e8fdee58"
] | [
"Correlation_matrix.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Apr 3 14:58:50 2019\n\n@author: Amirh\n\ncorrelation matrix, collinearity problem\n\n\"\"\"\nfrom scipy.stats import pearsonr\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.stats import norm\nfrom scipy import interpolate\n#%%\ndef correlation_plot... | [
[
"scipy.stats.norm.pdf",
"matplotlib.pyplot.MaxNLocator",
"matplotlib.pyplot.subplots",
"scipy.stats.pearsonr",
"scipy.stats.norm.fit",
"matplotlib.pyplot.subplots_adjust"
]
] |
xiao-aBoy/Microbiome-based-disease-prediction-with-prototypical-network | [
"a981b7fa4cb4770a090d341c806d284d21b00d0c"
] | [
"net/AM1.py"
] | [
"# -*- coding: utf-8 -*-\r\nimport warnings\r\nimport torch\r\nimport torch.nn as nn\r\nimport random\r\nimport torch.nn.functional as F\r\nfrom sklearn.feature_selection import f_classif, SelectKBest\r\nfrom sklearn.metrics import accuracy_score, roc_auc_score, f1_score\r\nfrom sklearn.model_selection import Stra... | [
[
"torch.nn.Linear",
"torch.cuda.manual_seed",
"numpy.random.choice",
"numpy.where",
"sklearn.feature_selection.SelectKBest",
"pandas.read_csv",
"sklearn.metrics.f1_score",
"torch.exp",
"torch.nn.CrossEntropyLoss",
"numpy.concatenate",
"pandas.read_table",
"torch.nn.f... |
supervisely-ecosystem/ritm-training | [
"5fc9617b21449f147d99383f501e75f2067ac721"
] | [
"isegm/data/datasets/coco_lvis.py"
] | [
"from pathlib import Path\nimport pickle\nimport random\nimport numpy as np\nimport json\nimport cv2\nfrom copy import deepcopy\nfrom isegm.data.base import ISDataset\nfrom isegm.data.sample import DSample\n\n\nclass CocoLvisDataset(ISDataset):\n def __init__(self, dataset_path, split='train', stuff_prob=0.0,\n ... | [
[
"numpy.stack"
]
] |
trzhang0116/HRAC | [
"205ec4c68ee6a0b9a7e162f1d91ae60cbc6b7bb8"
] | [
"discrete/agent.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.utils.tensorboard import SummaryWriter\n\nimport os\nimport time\nimport datetime\nimport json\nimport numpy as np\nimport pandas as pd\n\nfrom env import MazeEnv, KeyChestEnv\nfrom model import HRLNet, AN... | [
[
"torch.rand",
"torch.cat",
"torch.min",
"numpy.zeros",
"torch.nn.functional.pairwise_distance",
"pandas.DataFrame",
"numpy.round",
"numpy.ones",
"torch.FloatTensor",
"torch.nn.functional.log_softmax",
"torch.from_numpy",
"torch.ones",
"torch.tensor",
"torch.... |
19ahmed99/l2rpn_opponent_modelling | [
"5a04f74fe065e2b3788d3aa8378acd06ee3d2426"
] | [
"Agents/D3QN_baseline_nn_concat/DoubleDuelingDQN.py"
] | [
"# Copyright (c) 2020, RTE (https://www.rte-france.com)\n# See AUTHORS.txt\n# This Source Code Form is subject to the terms of the Mozilla Public License, version 2.0.\n# If a copy of the Mozilla Public License, version 2.0 was not distributed with this file,\n# you can obtain one at http://mozilla.org/MPL/2.0/.\n#... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.nan_to_num",
"numpy.reshape",
"numpy.zeros",
"tensorflow.summary.trace_on",
"tensorflow.summary.scalar",
"numpy.random.rand",
"numpy.mean",
"numpy.where",
"tensorflow.summary.trace_export",
"numpy.a... |
washizzle/darts | [
"bab599ec2232f5ced4aabed269fafb41306ceced"
] | [
"cnn/architect.py"
] | [
"import torch\r\nimport numpy as np\r\nimport torch.nn as nn\r\n\r\nfrom torch.autograd import Variable\r\nfrom model_search import Network\r\n\r\n\r\ndef _concat(xs):\r\n return torch.cat([x.view(-1) for x in xs])\r\n\r\n\r\nclass Architect(object):\r\n\r\n def __init__(self, model, args):\r\n self.network_mo... | [
[
"torch.zeros_like",
"torch.autograd.Variable"
]
] |
analogdada/object_detection_demo | [
"87115051fedc9a5559fe779c49c3b526232470ef"
] | [
"xml_to_csv.py"
] | [
"\"\"\"\nUsage:\n# Create train data:\npython xml_to_csv.py -i [PATH_TO_IMAGES_FOLDER]/train -o [PATH_TO_ANNOTATIONS_FOLDER]/train_labels.csv\n\n# Create test data:\npython xml_to_csv.py -i [PATH_TO_IMAGES_FOLDER]/test -o [PATH_TO_ANNOTATIONS_FOLDER]/test_labels.csv\n\"\"\"\n\nimport os\nimport glob\nimport pandas ... | [
[
"pandas.DataFrame"
]
] |
thealphadollar/ML-Assignments | [
"547c115d0d62c770aa673bf98fd56ff184bcfbd6"
] | [
"Assignment_3/Assignment3/src/Task3.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 26 01:37:42 2020\n\n@author: praveshj\n\"\"\"\n\nimport numpy as np\nimport math\nimport random\n\nprint(\"Data Loading. May Take Time....\")\n\nX = np.genfromtxt('../data/tfidf.csv',delimiter = ' ')\n\n# print(X.shape)\n\n \n#Cosin... | [
[
"numpy.random.random_integers",
"numpy.genfromtxt",
"numpy.dot",
"numpy.zeros"
]
] |
cpriebe/dldt | [
"8631dc583e506adcd06498095919b5dd42323e1e"
] | [
"tools/accuracy_checker/accuracy_checker/postprocessor/resize_segmentation_mask.py"
] | [
"\"\"\"\nCopyright (c) 2019 Intel Corporation\n\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\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or ag... | [
[
"numpy.array"
]
] |
VolkerH/nd2 | [
"3fb449d28c10b975cd6773be8aa5802b3cb976f6"
] | [
"setup.py"
] | [
"import os\nimport platform\nfrom pathlib import Path\n\nfrom Cython.Build import cythonize\nfrom numpy import get_include\nfrom setuptools import Extension, setup\n\nSYSTEM = platform.system()\nSDK = Path(\"src/sdk\") / SYSTEM\nLIB = SDK / \"lib\"\nINCLUDE = SDK / \"include\"\nLINK = \"shared\" if SYSTEM == \"Linu... | [
[
"numpy.get_include"
]
] |
openvinotoolkit/mmsegmentation | [
"9f50fc158be50594ea4aecf0a07ea652c91ec846"
] | [
"mmseg/core/utils/checkpoint.py"
] | [
"# Copyright (C) 2021 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n#\n\nimport re\n\nimport torch\nimport numpy as np\nfrom terminaltables import AsciiTable\nfrom mmcv.runner.checkpoint import _load_checkpoint\nfrom mmcv.runner.dist_utils import get_dist_info\n\n\ndef _is_cls_layer(name):\n return '... | [
[
"numpy.prod"
]
] |
rachellea/medgenetics | [
"467e82c09dc6ab168a986721ac5be6c71f616fcc"
] | [
"src/visualization1.py"
] | [
"#visualization.py\n\nimport os\nimport numpy as np\nimport pandas as pd\nfrom scipy import stats\nimport sklearn.metrics\n\nimport matplotlib\nmatplotlib.use('agg') #so that it does not attempt to display via SSH\nimport matplotlib.pyplot as plt\nplt.ioff() #turn interactive plotting off\nimport matplotlib.lines a... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.step",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"scipy.s... |
benoitblanc/kloppy | [
"5c3f94ff8806f9e23f8bad095a948a403a06a54c"
] | [
"examples/playing_time.py"
] | [
"import logging\nimport sys\nfrom collections import Counter\n\nfrom kloppy import metrica\nimport matplotlib.pyplot as plt\n\nfrom kloppy.domain import Ground\n\n\ndef main():\n \"\"\"\n This example shows how to determine playing time\n \"\"\"\n logging.basicConfig(\n stream=sys.stdout,\n ... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
unpsjb-rtsg/case-2017 | [
"1048a8de90a99982d574f19be29c7fe13e28a267"
] | [
"wcrt-test-mbed.py"
] | [
"from __future__ import print_function\n\nimport os\nimport sys\nimport serial\nimport xml.etree.cElementTree as et\nimport ntpath\nimport re\nimport struct\nimport glob\nimport datetime as dt\nimport pandas as pd\nimport mbed_lstools\nimport subprocess\nimport json\nimport shutil\nfrom bunch import Bunch, unbunchi... | [
[
"pandas.HDFStore",
"pandas.DataFrame",
"pandas.read_hdf",
"pandas.concat"
]
] |
master-coro/gantt-trampoline | [
"987304ffb73628896219c8b7b5b9e981960cafff"
] | [
"lib/GanttPlot.py"
] | [
"# Importing the matplotlb.pyplot\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\nclass GanttPlot():\n def __init__(self, ylim, xlim, title=None):\n self.fig, self.gnt = plt.subplots(figsize=(12, 8))\n self.gnt.set_ylim(0, ylim+1)\n self.gnt.set_xlim(-1, xlim+1)\n self.ylim ... | [
[
"matplotlib.pyplot.show",
"numpy.random.rand",
"matplotlib.pyplot.subplots"
]
] |
galaxyChen/dl4ir-webnav | [
"09a76395cb414ac2b56cceea06ddb169cefd4f70"
] | [
"op_sentence.py"
] | [
"'''\nCustom theano class to access page sentences.\n'''\nimport numpy as np\nimport theano\nfrom theano import gof\nfrom theano import tensor\nimport utils\nfrom nltk.tokenize import wordpunct_tokenize\nimport nltk\nimport time\nimport parameters as prm\n\nclass Sentence(theano.Op):\n __props__ = ()\n\n def ... | [
[
"numpy.argmax"
]
] |
CBORT-NCBIB/oct-cbort | [
"7f2bc525bb3f5b3bcf2e41622129c87ee710161a"
] | [
"oct/view/colormap.py"
] | [
"from oct import *\nimport colorcet as cc\nimport matplotlib\n\ncp, np, convolve, gpuAvailable, freeMemory, e = checkForCupy()\n\n\nclass Colormap:\n \"\"\"Generate an rgb frame from a greyscale using a chosen colormap\"\"\"\n\n def __init__(self, cmapLabel='hsv'):\n self.cmap = matplotlib.cm.get_cmap(... | [
[
"matplotlib.colors.ListedColormap",
"matplotlib.cm.get_cmap"
]
] |
tsubauaaa/d2go | [
"9f746159ebf78ce79f644c405ca8695bc29d1075"
] | [
"projects_oss/detr/test_op.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n# ------------------------------------------------------------------------------------------------\n# Deformable DETR\n# Copyright (c) 2020 SenseTime. All Rights Reserved.\n# Licensed under the Apache License, Version 2... | [
[
"torch.rand",
"torch.no_grad",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.as_tensor",
"torch.allclose"
]
] |
alexander-manley/MLServer | [
"42eac4715f208f028a8920c984ab296830d90f08"
] | [
"runtimes/alibi-explain/tests/test_alibi_runtime_base.py"
] | [
"import json\nfrom typing import Any, Dict\nfrom unittest.mock import patch\n\nimport numpy as np\nfrom alibi.api.interfaces import Explanation\nfrom numpy.testing import assert_array_equal\n\nfrom mlserver import ModelSettings, MLModel\nfrom mlserver.codecs import NumpyCodec\nfrom mlserver.types import (\n Infe... | [
[
"numpy.array",
"numpy.random.randn",
"numpy.testing.assert_array_equal"
]
] |
ECNU-Text-Computing/Text-Mining | [
"5661bf6f9482183ecac14436bbd0a5e786d61467"
] | [
"tutorials/bilstm_crf.py"
] | [
"# Author: Robert Guthrie\n\nimport torch\nimport torch.autograd as autograd\nimport torch.nn as nn\nimport torch.optim as optim\n\ntorch.manual_seed(1)\n\n\ndef argmax(vec):\n # return the argmax as a python int\n _, idx = torch.max(vec, 1)\n return idx.item()\n\n\ndef prepare_sequence(seq, to_ix):\n i... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.nn.LSTM",
"torch.max",
"torch.no_grad",
"torch.manual_seed",
"torch.randn",
"torch.full",
"torch.tensor",
"torch.exp",
"torch.nn.Embedding"
]
] |
korur/Blog | [
"b34ddfc4a3390e6b600d0699d1e8a1413fba1ac1"
] | [
"pandas_vs_datatable/code/filter.py"
] | [
"import os\nimport re\nimport json\nimport time\nimport numpy as np\nimport pandas as pd\nfrom plotnine import *\n\n# Config\nPATH = os.getcwd()\npath_n = re.split(pattern=r\"/|\\\\\", string=PATH)[1:]\nif os.name == \"posix\":\n path_n = \"/\" + os.path.join(*path_n)\nelse:\n drive = PATH[0:3]\n path_n = ... | [
[
"numpy.max",
"numpy.median",
"pandas.DataFrame",
"numpy.min",
"numpy.mean"
]
] |
RentadroneCL/model-definition | [
"9dab1f1a808a1efc54d64144745277396c145ff7",
"9dab1f1a808a1efc54d64144745277396c145ff7"
] | [
"ssd_keras-master/predict.py",
"GPS_Panel/Utils.py"
] | [
"from keras import backend as K\nfrom keras.models import load_model\nfrom keras.preprocessing import image\nfrom keras.optimizers import Adam\nfrom imageio import imread\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport json\nimport argparse\nimport os\nimport time\n\nfrom models.keras_ssd300 impor... | [
[
"numpy.array",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"numpy.mean",
"matplotlib.pyplot.figure",
"numpy.linspace",
"matplotlib.pyplot.Rectangle",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.imshow"
],
[
"numpy.argmin",
"numpy.median",
"numpy.mean... |
TinyVolt/normalizing-flows | [
"d4510383cdaaf0f5a289d97f9bf3d0ba47df4cac"
] | [
"multi_dim_shared_params/data.py"
] | [
"import numpy as np\nimport pickle\nfrom torch.utils.data import Dataset, DataLoader\n\nFILENAME = 'shapes.pkl'\nwith open(FILENAME, 'rb') as f:\n data = pickle.load(f)\ntraining_data, testing_data = data['train'], data['test']\n# training_data.shape = (10479, 20, 20, 1)\ntraining_data = (training_data > 127.5).... | [
[
"numpy.transpose"
]
] |
kingformatty/E2E-NLG-Project | [
"74185afa0830592d905668eee1e477395ee19cd6"
] | [
"components/trainer/__init__.py"
] | [
"# Based on: http://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html\n\nimport logging\nimport os\nimport time\n\nimport numpy as np\nimport torch\nfrom torch import optim\n\nfrom components.constants import PAD_ID\nfrom components.evaluator.e2e_evaluator import BaseEvaluator\nfrom components.ev... | [
[
"torch.cuda.is_available",
"numpy.mean"
]
] |
ksang/moderu | [
"c7c8c24e86c9d549dd85f4f16b456cbf33f30cb2"
] | [
"lenet5/train.py"
] | [
"import argparse\nimport random\nimport warnings\nimport time\nimport os\n\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nimport torch.distributed as dist\nimport torch.optim as optim\nimport torch.multiprocessing as mp\nfrom torchvision import datasets, transforms\nfrom model import Le... | [
[
"torch.device",
"torch.distributed.init_process_group",
"torch.save",
"torch.no_grad",
"torch.multiprocessing.set_start_method",
"torch.multiprocessing.spawn",
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.cuda.is_availa... |
tlubitz/rba | [
"073b591ff6047ee8df00288ecfe45094e2b7d195"
] | [
"simulator/static/python/rbatools/rba/prerba/manual_annotation.py"
] | [
"\"\"\"Interface to manual annotation.\"\"\"\n\n# python 2/3 compatibility\nfrom __future__ import division, print_function, absolute_import\n\nimport os.path\nfrom collections import namedtuple\nimport pandas\n\nfrom .curation_data import CurationData\nfrom .uniprot_data import Cofactor\n\nMetabolite = namedtuple(... | [
[
"pandas.isnull",
"pandas.notnull"
]
] |
parva-jain/DataScientist | [
"7223798adabcd6438151813bbea9b8a107e103f1"
] | [
"datascientist/feature_selection/test/test_pearson.py"
] | [
"#Reading the test file having the data of footballers and target being their\n#overall skill score ( 1-100 ).\nimport pandas as pd\nimport numpy as np\n\nplayer_df = pd.read_csv(\"datascientist/feature_selection/test/CSV/data.csv\")\n\n#Taking only those columns which have numerical or categorical values since \n#... | [
[
"numpy.isnan",
"pandas.DataFrame",
"scipy.stats.pearsonr",
"numpy.abs",
"pandas.read_csv",
"pandas.get_dummies"
]
] |
ashishpatel26/pywick | [
"1afffd1c21c2b188836d3599e802146182757bb5"
] | [
"pywick/models/segmentation/testnets/psp_saeed.py"
] | [
"# Source: https://github.com/saeedizadi/binseg_pytoch/blob/master/models/pspnet.py\n\nimport torch\nimport torch.nn.init as init\nimport torch.nn as nn\nfrom torchvision import models\nimport torch.nn.functional as F\nimport numpy as np\n\nimport math\n\ndef initialize_weights(method='kaiming', *models):\n for ... | [
[
"torch.cat",
"torch.nn.init.constant",
"torch.nn.ModuleList",
"torch.nn.Sigmoid",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.UpsamplingBilinear2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"numpy.sqrt... |
georgios-vassos1/fastsgd | [
"5ccb2fc2f564056e5bd1ccf0993cf6bbd6425305"
] | [
"fastsgd/sgd.py"
] | [
"import os, time\nfrom functools import partial\nfrom scipy.optimize import brentq\nimport pandas as pd\nimport numpy as np\nfrom .learning_rate.__init__ import *\n\n\nclass SGD:\n def __init__(self, n: int, p: int, timer: time, **kwargs):\n self._name = kwargs.get(\"method\", None)\n self._n_param... | [
[
"numpy.abs",
"numpy.mean",
"numpy.arange",
"numpy.zeros"
]
] |
Ritvik19/Text-Data-Augmentation | [
"30e7ba85da514c328e951519ca86a07863ba69ca"
] | [
"text_data_augmentation/synonym_replacement.py"
] | [
"import random\nimport re\n\nimport nltk\nimport numpy as np\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom tqdm.auto import tqdm\n\n\nclass SynonymReplacement:\n \"\"\"Synonym Replacement Augmentation creates Augmented Samples by randomly\n replacing some words with their synonyms based o... | [
[
"numpy.max",
"numpy.ones_like",
"numpy.sum",
"numpy.mean",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
zongdaoming/CMT | [
"fc3773bb6c6b1ab091688addfffca3fb1e382ae4"
] | [
"lib/models/HyperDensenet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport sys,os\nsys.path.append('/home/zongdaoming/cv/multi-organ/multi-organ-ijcai/')\nfrom lib.models.BaseModelClass import BaseModel\nfrom torchsummary import summary\n\n\"\"\"\nCodes are borrowed and modified from this repo: https://github.co... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.cat",
"torch.device",
"torch.nn.Dropout",
"torch.nn.BatchNorm3d",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.nn.Upsam... |
Neronjust2017/Bayesian-neural-networks | [
"9d7f781f5c2dfa8fadf26300b4b5b64366c939cd"
] | [
"Experiments/BostonHousing/mc_dropout_hetero.py"
] | [
"import json\n\nfrom sklearn.linear_model import LinearRegression,Lasso,Ridge\nfrom sklearn.datasets import load_boston\nimport os\nimport sys\n\ncurPath = os.path.abspath(os.path.dirname(__file__))\nrootPath = curPath\nfor i in range(2):\n rootPath = os.path.split(rootPath)[0]\nsys.path.append(rootPath)\n\nimpo... | [
[
"numpy.array",
"numpy.zeros",
"numpy.min",
"numpy.mean",
"numpy.save",
"numpy.multiply",
"numpy.std",
"numpy.sign",
"torch.cuda.is_available"
]
] |
lorenzocorneo/surrounded-by-the-clouds | [
"536375943f8a6c23b31d6528403624d586ce1270"
] | [
"src/plot-figure-7.py"
] | [
"from collections import defaultdict\n\nimport matplotlib.pyplot as plt\n\nfrom boxes import generate_legend_handles, group_boxplot\nfrom commons import WIDTH_IN\n\nwith open(\"data/hops.csv\") as f:\n ret = defaultdict(list)\n for l in f.readlines()[1:]:\n split = l.rstrip(\"\\n\").split(\",\")\n ... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots"
]
] |
tomuram/mb_aligner_adisuissa | [
"325a97711c5e34e9d55584a2cf6e1a93943a0c66"
] | [
"mb_aligner/dal/mfov.py"
] | [
"import numpy as np\nimport os\nimport json\nfrom .tile import Tile\n\nclass Mfov(object):\n \"\"\"\n Represents a single Multibeam-Field-of-View (61 tiles) in the system\n \"\"\"\n\n def __init__(self, tiles=[], **kwargs):\n self._tiles = tiles\n\n # Initialize default values\n sel... | [
[
"numpy.array"
]
] |
top-on/hackathon-kit | [
"a7c7493d9f9c86c894c7aa9b0fba8a8388bb95d4"
] | [
"h2o-samples/classification.py"
] | [
"\nimport pandas as pd\nimport h2o\nfrom h2o.estimators import H2OXGBoostEstimator\nfrom h2o.automl import H2OAutoML\nfrom matplotlib import pyplot\n\n# start h2o\nh2o.init() # h2o.shutdown()\n\n# load data\ndf = pd.read_csv('h2o-samples/data/iris.csv')\nhf = h2o.H2OFrame(df)\n\n# partition data\ntrain, test = hf.... | [
[
"pandas.read_csv"
]
] |
angelolab/toffy | [
"4d6c50fe0dfbf1568ee3f9db2182a04dc9ac85c6"
] | [
"toffy/streak_detection.py"
] | [
"from matplotlib.pyplot import connect\nimport numpy as np\nimport os\nfrom typing import Union, Tuple\nfrom pathlib import Path\nfrom skimage import (\n filters,\n exposure,\n restoration,\n measure,\n draw,\n util,\n io,\n)\nfrom dataclasses import dataclass\nimport pandas as pd\nfrom functoo... | [
[
"numpy.zeros",
"numpy.percentile",
"pandas.DataFrame",
"numpy.ones",
"numpy.mean",
"numpy.unique"
]
] |
mansum6/AdelaiDet | [
"7fa8252aa5e785175606a79b08b364f8ac11efa7"
] | [
"demo/maskImages.py"
] | [
"from detectron2.evaluation import COCOEvaluator, inference_on_dataset\nfrom detectron2.data import build_detection_test_loader\nfrom detectron2.data.detection_utils import read_image\nfrom detectron2.engine.defaults import DefaultPredictor\nfrom detectron2.data import MetadataCatalog\nfrom adet.config import get_c... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.where",
"torch.tensor",
"numpy.moveaxis",
"numpy.int0"
]
] |
popura/blinky | [
"d9a81c0c0b8789ce9f0d234d1c768dd24f88d257"
] | [
"python/blinkytools/io.py"
] | [
"# Copyright 2020 Robin Scheibler\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights to\n# use, copy, modify, merge, pub... | [
[
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.dtype"
]
] |
deepkrishna/bullet12 | [
"7356421848b89e37ac91f09f2e3197c9dccf1ba4"
] | [
"examples/pybullet/gym/pybullet_envs/examples/enjoy_TF_InvertedPendulumBulletEnv_v0_2017may.py"
] | [
"#add parent dir to find package. Only needed for source code build, pip install doesn't need it.\nimport os, inspect\ncurrentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\nparentdir = os.path.dirname(os.path.dirname(currentdir))\nos.sys.path.insert(0,parentdir)\n\nimport gym\nimpo... | [
[
"numpy.array",
"numpy.dot",
"numpy.maximum"
]
] |
LakeAndCat/CluOReg | [
"ba50cb056061b3833050d32e532e08152bdc8de2"
] | [
"models/densenet_cluster.py"
] | [
"# -*- encoding: utf-8 -*-\n'''\n@File : densenet2.py \n@Contact : guzhouweihu@163.com\n\n@Modify Time @Author @Version @Desciption\n------------ ----------- -------- -----------\n2020/10/7 20:15 guzhouweihu 1.0 None\n'''\n\n\n\"\"\"dense net in pytorch\n[1] Gao Hu... | [
[
"torch.nn.Linear",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.AdaptiveAvgPool2d",
"torch.Tensor",
"torch.sum"
]
] |
lynphoenix/ignite | [
"7b1e83f3fe7c36d12e01a09a01bf7efe7fd136a1"
] | [
"tests/ignite/handlers/test_checkpoint.py"
] | [
"import os\nimport warnings\nfrom collections import OrderedDict\nfrom unittest.mock import MagicMock\n\nimport pytest\nimport torch\nimport torch.nn as nn\n\nimport ignite.distributed as idist\nfrom ignite.engine import Engine, Events, State\nfrom ignite.handlers import Checkpoint, DiskSaver, EarlyStopping, ModelC... | [
[
"torch.nn.Linear",
"torch.device",
"torch.rand",
"torch.optim.lr_scheduler.ExponentialLR",
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.load",
"torch.nn.DataParallel"
]
] |
falkben/jwql | [
"4f035a0f48d875cad6cc832431f1d8fda67e520e"
] | [
"jwql/utils/preview_image.py"
] | [
"#! /usr/bin/env python\n\n\"\"\"\nCreate a preview image from a fits file containing an observation.\n\nThis module creates and saves a \"preview image\" from a fits file that\ncontains a JWST observation. Data from the user-supplied ``extension``\nof the file are read in, along with the ``PIXELDQ`` extension if\n... | [
[
"matplotlib.use",
"matplotlib.pyplot.rcParams.update",
"numpy.int",
"matplotlib.colors.LogNorm",
"matplotlib.pyplot.gca",
"numpy.sum",
"matplotlib.pyplot.savefig",
"numpy.ones",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.sort",
"matplotlib.pyplo... |
uber-research/metropolis-hastings-gans | [
"41857c9d51da07e87f1de0c7443acdecb8c2c59f"
] | [
"mhgan/contrib/dcgan/dcgan_loader.py"
] | [
"# Modifications Copyright (c) 2018 Uber Technologies, Inc.\nfrom __future__ import print_function\nimport argparse\nimport os\nimport random\nimport torch\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.utils.data\nimport torchvision.datasets as dset\nimport torchvision.transforms as ... | [
[
"torch.device",
"torch.cuda.is_available"
]
] |
andikarachman/Face-Recognition-App | [
"f3bb46e96c27e0f72e7b1123bf4b15a43c21f673"
] | [
"webcam_face_recognition.py"
] | [
"import face_recognition\nimport cv2\nimport numpy as np\nimport glob\nimport os\nimport logging\nimport datetime\n\n\nIMAGES_PATH = './images'\nCROPPED_IMAGES_PATH = './cropped_images'\nCAMERA_DEVICE_ID = 0\nMAX_DISTANCE = 0.6\n\n\ndef get_face_embeddings_from_image(image, convert_to_rgb=False):\n \"\"\"\n T... | [
[
"numpy.any",
"numpy.copy",
"numpy.argmin"
]
] |
yoyonel/twint | [
"bdfd267ff12e8064c37821a814312b23a2e5068c"
] | [
"twint/storage/panda.py"
] | [
"from time import strftime, localtime\nimport pandas as pd\nimport warnings\nfrom .elasticsearch import hour\n\nTweets_df = None\nFollow_df = None\nUser_df = None\n\n_object_blocks = {\n \"tweet\": [],\n \"user\": [],\n \"following\": [],\n \"followers\": []\n}\n\nweekdays = {\n \"Monday\": 1,\n ... | [
[
"pandas.HDFStore",
"pandas.DataFrame",
"pandas.read_pickle",
"pandas.concat"
]
] |
timgates42/statsmodels | [
"ab8ff09e3eb8c385214bd1575aa47b81bf53d584"
] | [
"statsmodels/datasets/utils.py"
] | [
"from statsmodels.compat.python import lrange\n\nfrom io import StringIO\nimport shutil\nfrom os import environ, makedirs\nfrom os.path import expanduser, exists, dirname, abspath, join\nfrom urllib.error import HTTPError, URLError\nfrom urllib.request import urlopen\nfrom urllib.parse import urljoin\n\nimport nump... | [
[
"pandas.Index",
"numpy.asarray",
"pandas.read_stata",
"numpy.logical_and",
"pandas.read_csv"
]
] |
FernandoSBorges/netpyne | [
"e1a7adb56b94aa78f8461397319eb4e9754c2d75"
] | [
"examples/sonata_300_cells/init.py"
] | [
"\"\"\"\ninit.py\n\nInitial script to import, simulate and plot raster of SONATA example 300_cells\n\"\"\"\n\nfrom netpyne import sim\nfrom netpyne.conversion import sonataImport\nimport h5py\nimport json\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n\nrootFolder = '/u/salvadord/Documents/ISB/Models/... | [
[
"numpy.array",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.p... |
swischuk/operator_inference | [
"c495afb79d7d96f20d3ca882725238aad0c049d2"
] | [
"src/rom_operator_inference/pre/_basis.py"
] | [
"# pre/_basis.py\n\"\"\"Tools for basis computation and reduced-dimension selection.\"\"\"\n\n__all__ = [\n \"pod_basis\",\n \"svdval_decay\",\n \"cumulative_energy\",\n \"residual_energy\",\n \"projection_error\",\n ]\n\nimport numpy as np\nimport sci... | [
[
"numpy.concatenate",
"scipy.sparse.linalg.svds",
"numpy.count_nonzero",
"numpy.sum",
"scipy.linalg.svd",
"matplotlib.pyplot.figure",
"numpy.isscalar",
"numpy.sort",
"numpy.arange",
"numpy.cumsum",
"sklearn.utils.extmath.randomized_svd",
"numpy.searchsorted",
"sc... |
dawedawe/traipor | [
"abfb027dec6837a5a912d6470e8e4bb0eca0c815"
] | [
"app/training/parameterfitting.py"
] | [
"from scipy import optimize\nimport lmfit\nimport numpy as np\nimport cma\n\ntry:\n from .fitnessfatigue import performance_over_time as \\\n ff_performance_over_time\n from .fitnessfatigue import performance_over_time2 as \\\n ff_performance_over_time2\n from .perpot import performance_over_... | [
[
"numpy.array",
"scipy.optimize.minimize"
]
] |
bibliolytic/moabb | [
"46799bfd7957b1da3e7a0534286c1973af9c95d9"
] | [
"moabb/paradigms/base.py"
] | [
"from abc import ABCMeta, abstractproperty, abstractmethod\nimport numpy as np\nimport pandas as pd\n\n\nclass BaseParadigm(metaclass=ABCMeta):\n \"\"\"Base Paradigm.\n \"\"\"\n\n def __init__(self):\n pass\n\n @abstractproperty\n def scoring(self):\n '''Property that defines scoring me... | [
[
"numpy.append",
"pandas.concat"
]
] |
TheFebrin/thesis-normals-estimation | [
"43c2b9f902b93ec8eace610bb386d190a58eb4e3"
] | [
"utils/make_plots.py"
] | [
"import numpy as np\nfrom PIL import Image\nimport numba\nimport matplotlib.pyplot as plt\n# import albumentations as A\n# import cv2\nimport pptk\n\nfrom util_functions import (\n get_normals_from_depth,\n depth_image_to_pointcloud,\n normalize,\n get_normals_from_depth_avg,\n)\n\n\ndef plot_images():\... | [
[
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.subplots"
]
] |
tran-khoa/fairseq | [
"558366b3c6970a5dd85ad1909581d43e41fdce9f"
] | [
"fairseq/checkpoint_utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport ast\nimport collections\nimport contextlib\nimport logging\nimport numpy as np\nimport os\nimport re\nimport time\nimport tra... | [
[
"torch.device",
"torch.save",
"numpy.random.randint",
"torch.distributed.barrier",
"torch.serialization.default_restore_location"
]
] |
dprelogo/tools21cm | [
"ba6aa185ced0cd73263e5750df02d6a54a545a98"
] | [
"example/example_BSD.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport tools21cm as t2c\n\n### Setting the simulation environment\nt2c.set_sim_constants(244)\n\n### Reading files\nxfrac_filename = '/disk/dawn-1/garrelt/Reionization/C2Ray_WMAP7/244Mpc/244Mpc_f2_0_250/results/xfrac3d_6.450.bin'\n\nxfrac = t2c.read_c2ray_files(... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
ZhuoyiZou/python-challenge | [
"c4a3e3a0ec54f46fbf98808cfd8b8ab4fe581e74"
] | [
"PyBank/main.py"
] | [
"# Import module \nimport csv\nimport os\nimport numpy as np\n\n\n# Select the csv file through directory \npybank_data = os.path.join(\".\", \"PyBank_Resources_budget_data.csv\") \n\n\ncolumn_1 = []\ncolumn_2 = []\ntotal_amount = 0\n# Read the csv file \nwith open (pybank_data, newline = \"\") as csvfile:\n pyb... | [
[
"numpy.mean"
]
] |
muratcancicek/Deep_RL_For_Head_Pose_Est | [
"03fe9fadc19f0d6dab3a42d9bcf5ec4a12a2c253"
] | [
"DeepRL_For_HPE/TF_RNN/data_processing.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nimport numpy as np\nimport pandas as pd\n\n\ndef x_sin(x):\n return x * np.sin(x)\n\n\ndef sin_cos(x):\n return pd.DataFrame(dict(a=np.sin(x), b=np.cos(x)), index=x)\n\n\ndef rnn_data(data, time_steps, labels=False):... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.sin",
"numpy.cos"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.