repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
canyon289/pymc | [
"4e695f635b2ead24e2e647651eadd2505ab1fa63"
] | [
"pymc3/tests/test_distributions.py"
] | [
"from __future__ import division\n\nimport itertools\nimport sys\n\nfrom .helpers import SeededTest, select_by_precision\nfrom ..vartypes import continuous_types\nfrom ..model import Model, Point, Potential, Deterministic\nfrom ..blocking import DictToVarBijection, DictToArrayBijection, ArrayOrdering\nfrom ..distri... | [
[
"scipy.stats.distributions.halfnorm.logpdf",
"numpy.ones",
"scipy.stats.distributions.invgauss.logpdf",
"numpy.diag",
"scipy.special.logit",
"numpy.random.seed",
"numpy.asarray",
"scipy.stats.distributions.binom.logpmf",
"scipy.stats.distributions.truncnorm.logpdf",
"numpy.... |
riedelx/adaptic-pyproc | [
"cfc14fbaadbc90f01db90440e9bd0d20950cdc77"
] | [
"libraries/adaptic.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n# =============================================================================\n# ADAPTIC classes\n# =============================================================================\nclass adap0: # base class with funtions to read num files\n def __init__(sel... | [
[
"numpy.array",
"numpy.column_stack",
"numpy.zeros"
]
] |
Dabble-of-DevOps-Bio/ella | [
"e38631d302611a143c9baaa684bcbd014d9734e4"
] | [
"src/vardb/util/vcfiterator.py"
] | [
"from typing import Any, Dict, IO, Mapping, Optional, Sequence, Tuple, Union\nimport cyvcf2\nimport logging\nimport numpy as np\n\nlog = logging.getLogger(__name__)\n\n# have to re-declare here since only exist in cyvcf2 stub and fails on execution\nText = Union[str, bytes]\nPrimitives = Union[int, float, bool, Tex... | [
[
"numpy.iinfo",
"numpy.issubdtype"
]
] |
ayanc/learncfa | [
"e3584b51cace5f1feabe22d0ae8102b21df8d60e"
] | [
"run/sensor.py"
] | [
"# Copyright (C) 2016 Ayan Chakrabarti <ayanc@ttic.edu>\nimport numpy as np\n\ndef trunc(img):\n w = img.shape[0]; h = img.shape[1]\n w = (w//8)*8\n h = (h//8)*8\n return img[0:w,0:h,...].copy()\n \n\ndef _clip(img):\n return np.maximum(0.,np.minimum(1.,img))\n\ndef bayer(img,nstd):\n v = np.ze... | [
[
"numpy.random.normal",
"numpy.sum",
"numpy.zeros",
"numpy.minimum"
]
] |
mexxexx/ionsrcopt | [
"889db53f84ea5dd2199b882a5a1b36c256aa5128"
] | [
"visualization/svm.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport warnings\n\nfrom sklearn import svm\nfrom sklearn import metrics\nfrom sklearn import model_selection\nfrom sklearn import preprocessing\n\n\ndef main():\n files = {\n \"./Results/JanNov2016.csv\": {\"label\": 0, \"color\"... | [
[
"numpy.tile",
"numpy.empty",
"numpy.zeros",
"sklearn.svm.SVC",
"pandas.read_csv",
"numpy.nanmean",
"numpy.interp",
"pandas.DataFrame",
"matplotlib.pyplot.get_current_fig_manager",
"matplotlib.pyplot.subplots",
"sklearn.metrics.confusion_matrix",
"sklearn.preprocessi... |
victor-gil-sepulveda/PhD-ANMPythonHelpers | [
"c0e15684cce4aa4da90141b51f043a567a5f8655"
] | [
"anmichelpers/comparison/comparison.py"
] | [
"import numpy\nimport anmichelpers.tools.tools as tools\nimport math\nfrom anmichelpers.tools.tools import norm\nfrom math import exp\n\n# For all measures see http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2350220/\n\ndef overlap(mode_i, mode_j):\n \"\"\"\n Measure of the similarity between 2 modes.\n Overla... | [
[
"numpy.dot",
"numpy.log"
]
] |
1alexandra/collage | [
"671ca1713d8e9f74faae9e824552a03c253adad0"
] | [
"src/CornerCreator.py"
] | [
"import numpy as np\nfrom PIL import Image, ImageFilter\n\n\nclass CornerCreator:\n \"\"\"Create corners with a given curvature from ``0`` to ``1``.\n\n Corners size is defined by ``corner_width``.\n Type of corners are defined by ``corner_curvature``:\n\n - ``0``: no corners,\n - from ``0`` to ``0.5... | [
[
"numpy.ones",
"numpy.logical_or",
"numpy.logical_and",
"numpy.rot90",
"numpy.array"
]
] |
dkim319/NFL_Predictive_Model_v2 | [
"5884e10a681e2e34f54a2280c94d2f42fc442d17"
] | [
"2 - Machine Learning/4_New Model - XGBoost - Final Model.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 14 20:21:23 2017\n\n@author: DKIM\n\"\"\"\n\n#Run 3b- Supporting Functions \nimport pandas as pd\nimport numpy as np\nimport xgboost as xgb\nfrom sklearn import feature_selection\n\nseednumber = 319\n\n# load data\n\nstart_year = 2014\ntarget_year = 2018\n\ndata_... | [
[
"pandas.DataFrame",
"sklearn.feature_selection.SelectPercentile"
]
] |
axelbr/dreamer | [
"775cd521b12d7c8f753e790844285d933e460234"
] | [
"plotting/plot_laptime_evaluation.py"
] | [
"import argparse\nimport time\nimport pathlib\nimport warnings\nfrom datetime import datetime\n\nfrom tensorboard.backend.event_processing.event_accumulator import EventAccumulator\n\nfrom plotting.aggregators import MeanStd, MeanMinMax\nfrom plotting.log_parsers import EvaluationParser\nfrom plotting.plot_test_eva... | [
[
"numpy.nonzero"
]
] |
Data-to-Knowledge/ConsentsReporting | [
"d5152699a26860ea3ff63093ef11bd440a812e0f"
] | [
"process_data.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jun 7 11:41:44 2018\n\n@author: MichaelEK\n\"\"\"\nimport os\nimport argparse\nimport types\nimport pandas as pd\nimport numpy as np\nfrom pdsql import mssql\nfrom datetime import datetime\nimport yaml\nimport itertools\nimport lowflows as lf\nimport util\n\npd.opti... | [
[
"pandas.to_numeric",
"pandas.DataFrame",
"numpy.in1d",
"pandas.to_datetime",
"pandas.merge",
"pandas.concat",
"pandas.DateOffset",
"pandas.isnull",
"numpy.concatenate"
]
] |
phigre/cobi | [
"bb6cd9a49eb22862be6d87f0a2b0c8baf65cadb5"
] | [
"combine2d/sandbox/Borden/perturbed_surface.py"
] | [
"import torch\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport shutil\n\nfrom combine2d.core import gis, test_cases\nfrom combine2d.core.utils import NonRGIGlacierDirectory\nfrom combine2d.core.first_guess import compile_first_guess\nfrom combine2d.core.inversion import InversionDirectory\nfr... | [
[
"numpy.zeros"
]
] |
jinghuix/dgl | [
"fae26dd15caac92458a08ad34889086e1e333ddd"
] | [
"examples/pytorch/graphsage/train_cv_multi_gpu.py"
] | [
"import dgl\nimport numpy as np\nimport torch as th\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch.multiprocessing as mp\nimport dgl.function as fn\nimport dgl.nn.pytorch as dglnn\nimport time\nimport argparse\nimport tqdm\nimport traceback\nfrom _thread import st... | [
[
"torch.nn.init.xavier_uniform_",
"torch.no_grad",
"torch.multiprocessing.Queue",
"torch.nn.ModuleList",
"torch.BoolTensor",
"torch.cat",
"torch.distributed.init_process_group",
"numpy.nonzero",
"numpy.mean",
"torch.cuda.set_device",
"torch.argmax",
"torch.distribute... |
shunk031/allennlp-models | [
"1e89d5e51cb45f3e77a48d4983bf980088334fac"
] | [
"tests/vision/models/visual_entailment_test.py"
] | [
"from torch.testing import assert_allclose\nfrom transformers import AutoModel\n\nfrom allennlp.common.testing import ModelTestCase\nfrom allennlp.data import Vocabulary\n\nfrom allennlp_models import vision # noqa: F401\n\nfrom tests import FIXTURES_ROOT\n\n\nclass TestVEVilbert(ModelTestCase):\n def test_mode... | [
[
"torch.testing.assert_allclose"
]
] |
mhorn11/deepclr | [
"6ee21963a402776851950a51709eef849ff96b5f"
] | [
"deepclr/utils/metrics.py"
] | [
"from enum import auto\nfrom typing import Any, Callable, Dict, Optional\n\nimport torch\nimport torch.nn.functional as F\n\nfrom ..config.config import Config, ConfigEnum\nfrom ..data.labels import LabelType\nfrom ..utils.tensor import prepare_tensor\nfrom .quaternion import qconjugate, qmult\n\n\nMetricFunction =... | [
[
"torch.sum",
"torch.FloatTensor",
"torch.nn.functional.mse_loss",
"torch.pow",
"torch.nn.functional.l1_loss",
"torch.norm",
"torch.cat",
"torch.mean"
]
] |
Treestanx/pylivetrader | [
"7d3244e05996dae8a137ed257350783bdfbcf13d"
] | [
"examples/MACD/macd_example.py"
] | [
"from pylivetrader.api import order_target_percent, record, symbol\nimport pandas as pd\n\n\ndef initialize(context):\n # The initialize method is called at the very start of your script's\n # execution. You can set up anything you'll be needing later here. The\n # context argument will be received by all ... | [
[
"pandas.Series.ewm"
]
] |
SZLSP/reid2020NAIC | [
"d0eaee768e0be606417a27ce5ea2b3071b5a9bc2"
] | [
"fastreid/layers/norm_layers/conditional_instance_norm2d.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass ConditionalInstanceNorm2d(nn.Module):\n \"\"\"Conditional Instance Normalization\n Parameters\n num_features – C from an expected input of size (N, C, H, W)\n num_classes – Number of classes in the datset.\n bias – if set to True, adds a bia... | [
[
"torch.randn",
"torch.nn.Embedding",
"torch.randint",
"torch.nn.InstanceNorm2d"
]
] |
rahulbhadani/RNN | [
"47c288ba9f2ed17a593e6b61d0d867cb2d69c244"
] | [
"crypt_lstm.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Crypt_LSTM\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1guzTMibpzWywlckt9xu2gazsb-jifVDG\n\"\"\"\n\nimport tensorflow as tf\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom skle... | [
[
"tensorflow.reshape",
"tensorflow.matmul",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"tensorflow.global_variables_initializer",
"tensorflow.clip_by_global_norm",
"matplotlib.pyplot.title",
"numpy.mean",
"numpy.zeros",
"pandas.read_csv",
"tensorflow.tanh",
... |
ktruong14/web_scraping_challenge | [
"312714639ea4d3d6d5dcc265620aa0e6d4ea2d29"
] | [
"scrape_mars.py"
] | [
"from splinter import Browser\nfrom bs4 import BeautifulSoup\nimport pandas as pd\nimport time\n\n\ndef init_browser():\n executable_path = {'executable_path': 'chromedriver.exe'}\n browser = Browser('chrome', **executable_path, headless=False)\n return browser\n\n\ndef marsNews():\n browser = init_brow... | [
[
"pandas.read_html"
]
] |
snumrl/skate | [
"a57ec2dc81dc2502da8886b92b870d2c8d65b838"
] | [
"angle2bvh.py"
] | [
"import numpy as np\nfrom PyCommon.modules.Math import mmMath as mm\nimport math\nimport os\nimport bvh\nfrom scipy.spatial.transform import Rotation\n\nclass MakeBvh(object):\n def __init__(self):\n self.skel = None\n self.joint_name = None\n\n def angle2bvh(self):\n file_dir = 'data/moc... | [
[
"scipy.spatial.transform.Rotation.from_rotvec",
"numpy.asarray",
"numpy.zeros"
]
] |
koralturkk/scikit-opt | [
"f62cd7f73d8b355f6d3d1865366794416268460b"
] | [
"examples/demo_sa.py"
] | [
"demo_func = lambda x: x[0] ** 2 + (x[1] - 0.05) ** 2 + x[2] ** 2\n\n# %% Do SA\nfrom sko.SA import SA\n\nsa = SA(func=demo_func, x0=[1, 1, 1], T_max=1, T_min=1e-9, L=300, max_stay_counter=150)\nbest_x, best_y = sa.run()\nprint('best_x:', best_x, 'best_y', best_y)\n\n# %% Plot the result\nimport matplotlib.pyplot a... | [
[
"matplotlib.pyplot.show",
"pandas.DataFrame"
]
] |
liuandrew/training-rl-algo | [
"ca56d65209de0bf88ac1e1db2269bb7daac4da47"
] | [
"a2c_ppo_acktr/model.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport gym\n\nfrom a2c_ppo_acktr.distributions import Bernoulli, Categorical, DiagGaussian\nfrom a2c_ppo_acktr.utils import init\n\n\nclass Flatten(nn.Module):\n def forward(self, x):\n return x.view(x.size(0), -1)\... | [
[
"numpy.sqrt",
"torch.nn.init.calculate_gain",
"torch.nn.Linear",
"torch.nn.init.constant_",
"torch.nn.Tanh",
"torch.nn.GRU",
"torch.nn.Conv2d",
"torch.nn.init.orthogonal_",
"torch.nn.Sequential",
"torch.zeros",
"torch.nn.ReLU",
"torch.cat"
]
] |
KuNyaa/fastNLP | [
"945b30bb6174751130744231aa26119bf9bb2601"
] | [
"reproduction/Summarization/Baseline/tools/Encoder.py"
] | [
"from __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport numpy as np\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import *\r\nimport torch.nn.init as init\r\n\r\nimport data\r\nfrom too... | [
[
"numpy.sqrt",
"torch.stack",
"torch.nn.Linear",
"numpy.zeros",
"torch.zeros",
"torch.nn.Embedding",
"numpy.arange",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.arange",
"numpy.array",
"torch.cat",
"torch.Tensor"
]
] |
WenjayDu/PocketFlow | [
"19ed4858b2fc914541032f74239ca08c0074c237"
] | [
"learners/weight_sparsification/learner.py"
] | [
"# Tencent is pleased to support the open source community by making PocketFlow available.\n#\n# Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.\n#\n# Licensed under the BSD 3-Clause License (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"tensorflow.summary.scalar",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.train.MomentumOptimizer",
"tensorflow.ones",
"tensorflow.variable_scope",
"tensorflow.abs",
"tensorflow.app.flags.DEFINE_float",
"tensorflow.Graph",
"tensorflow.train.get_or_create_global_step",
... |
ckoerber/gsum | [
"a9647d60eb5ef971caad88f97df8f1e9cc5286c2"
] | [
"gsum/models.py"
] | [
"from __future__ import division\nimport docrep\nfrom .helpers import coefficients, hpd, mahalanobis, geometric_sum\nimport numpy as np\nfrom numpy.linalg import solve, cholesky\nimport scipy as sp\nfrom scipy.linalg import cho_solve, solve_triangular, inv, eigh\nfrom scipy.special import loggamma\nimport scipy.sta... | [
[
"numpy.ones",
"numpy.sum",
"numpy.diag",
"numpy.copy",
"numpy.trace",
"numpy.log",
"scipy.linalg.cho_solve",
"numpy.isfinite",
"sklearn.base.clone",
"numpy.transpose",
"scipy.stats.binom",
"numpy.argmin",
"numpy.abs",
"scipy.linalg.eigh",
"scipy.optimize... |
TylerYep/edutorch | [
"6a4a425cbfd7fcdcd851b010816d29c3b5bae8bd"
] | [
"tests/nn/rnn_cell_test.py"
] | [
"import numpy as np\n\nfrom edutorch.nn import RNNCell\nfrom tests.gradient_check import estimate_gradients\n\n\ndef test_rnn_cell_forward() -> None:\n N, D, H = 3, 10, 4\n x = np.linspace(-0.4, 0.7, num=N * D).reshape(N, D)\n\n model = RNNCell(\n prev_h=np.linspace(-0.2, 0.5, num=N * H).reshape(N, ... | [
[
"numpy.allclose",
"numpy.linspace",
"numpy.random.randn",
"numpy.asarray"
]
] |
arielrossanigo/ibis | [
"18e967cac961285b05d8df560f40148bac1a2571"
] | [
"ibis/backends/impala/tests/test_pandas_interop.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pandas.testing as tm\nimport pytest\n\nimport ibis\nimport ibis.expr.datatypes as dt\nimport ibis.expr.schema as sch\nfrom ibis.backends.impala.pandas_interop import DataFrameWriter # noqa: E402\n\npytestmark = pytest.mark.impala\n\n\n@pytest.fixture\ndef exhaustive... | [
[
"numpy.array",
"pandas.testing.assert_frame_equal",
"pandas.Timestamp",
"pandas.date_range"
]
] |
abhiram-krishnan/tensorflow | [
"76069c136cd5042ee8021a7dc15ef591244e5a73"
] | [
"tensorflow/python/eager/backprop.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.eager.tape.push_new_tape",
"tensorflow.python.eager.imperative_grad.VSpace",
"tensorflow.python.eager.tape.pop_tape",
"tensorflow.python.util.nest.flatten",
"tensorflow.python.eager.tape.watch",
"tensorflow.python.ops.math_ops._as_indexed_slices_list",
"tensorflow.py... |
VisExcell/riskmodels | [
"012bbfd563482ba09585cd042b1f9465253ab1f4"
] | [
"RiskAssessment.py"
] | [
"import datetime\nimport numpy as np\n\"\"\"\nClass to define a 'RiskAssessment' from FHIR.\nCurrently only produces JSON.\n{\n \"date\": date assesment was made in ISO format yyyy-mm-dd,\n \"results\": {\n \"five_year_abs\": Five year Absolute Risk for this patient as decimal\n ... | [
[
"numpy.float64"
]
] |
alexgessner/emukit | [
"a068c8d5e06b2ae8b038f67bf2e4f66c4d91651a"
] | [
"emukit/quadrature/acquisitions/squared_correlation.py"
] | [
"# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: Apache-2.0\n\n\nimport numpy as np\nfrom scipy.linalg import lapack\nfrom typing import Tuple\n\nfrom ...core.acquisition import Acquisition\nfrom ...quadrature.methods import VanillaBayesianQuadrature\n\n\nclass ... | [
[
"scipy.linalg.lapack.dtrtrs",
"numpy.transpose"
]
] |
BelleJohn/neuropsychology-NeuroKit | [
"d01111b9b82364d28da01c002e6cbfc45d9493d9",
"d01111b9b82364d28da01c002e6cbfc45d9493d9"
] | [
"neurokit2/complexity/optim_complexity_k.py",
"neurokit2/rsp/rsp_findpeaks.py"
] | [
"from warnings import warn\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\nfrom ..misc import NeuroKitWarning, find_plateau\n\n\ndef complexity_k(signal, k_max=\"max\", show=False):\n \"\"\"Automated selection of the optimal k_max parameter for Higuchi Fractal Dimension (HFD).\n\n ... | [
[
"numpy.sum",
"numpy.vectorize",
"numpy.diff",
"numpy.floor",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.max",
"numpy.log",
"numpy.array",
"numpy.linspace"
],
[
"numpy.diff",
"numpy.asarray",
"numpy.median",
"numpy.where",
"numpy.add",
"... |
c3sr/go-pytorch | [
"0d1f6edbc6e48f0f68055274af0997e2ff9b0ce1"
] | [
"scripts/convert_model.py"
] | [
"import pretrainedmodels as pm\nimport torch\n\n# models giving an error\nerrored_model_name = ['fbresnet152', 'bninception', 'inceptionv4', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']\n\n# collect all (model, pretrained) tuples\npm_args = []\nfor model_name in pm.model_names:\n\tfor pretrained in... | [
[
"torch.rand",
"torch.jit.trace"
]
] |
pbarton666/virtual_classroom | [
"a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675"
] | [
"dkr-py310/docker-student-portal-310/course_files/python_for_excel_users/basic_operations/spreadsheet_functions.py"
] | [
"import os\nimport pandas as pd\nfrom openpyxl import load_workbook\n\ndata_dir = \".\"\ntemplate = 'chartme_template.xlsx'\nnew_wkbk = 'chartme_data_added.xlsx'\ntab_name = 'data'\n\nROWS_AXIS = 0\nCOLS_AXIS = 1\n\ndef normalize(series):\n \"\"\"Accepts a column (a pandas.Series object) and returns a normalized... | [
[
"pandas.DataFrame"
]
] |
galenvincent/encapZulate-1 | [
"ed2d749befa64cb9e04aefb0cedee322a2614da2"
] | [
"src/encapzulate/scripts/make_batches_dummy_data.py"
] | [
"from pathlib import Path\n\nimport numpy as np\nimport pandas as pd\n\nif \"ihome\" in str(Path.home()):\n path_photoz = Path.home() / \"photoz\"\n # path_photoz = Path(\"/bgfs\") / \"jnewman\" / \"bid13\" / \"photoZ\"\nelif \"/Users/andrews\" in str(Path.home()):\n path_photoz = Path.home() / \"projects\... | [
[
"numpy.save",
"pandas.read_hdf",
"numpy.load",
"numpy.empty"
]
] |
Wondersui/gluon-cv | [
"a990c2f148efccd3f7dc0cc0ccd81c03a0f91dd5"
] | [
"docs/tutorials/pose/demo_simple_pose.py"
] | [
"\"\"\"1. Predict with pre-trained Simple Pose Estimation models\n==========================================\n\nThis article shows how to play with pre-trained Simple Pose models with only a few\nlines of code.\n\nFirst let's import some necessary libraries:\n\"\"\"\n\nfrom matplotlib import pyplot as plt\nfrom glu... | [
[
"matplotlib.pyplot.show"
]
] |
limingwu8/PdM | [
"739b4b118f1c81fae704b15a9aa84d1f8c7b0196"
] | [
"Sensor.py"
] | [
"import matplotlib\n# matplotlib.use('Agg')\nfrom pandas import DataFrame\nfrom pandas import Series\nfrom pandas import concat\nfrom pandas import read_csv\nfrom pandas import datetime\nimport pandas as pd\nfrom sklearn.metrics import mean_squared_error\nfrom sklearn.preprocessing import MinMaxScaler\nfrom keras.m... | [
[
"matplotlib.pyplot.hlines",
"scipy.stats.shapiro",
"pandas.Series",
"numpy.asarray",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"scipy.stats.norm.cdf",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"numpy.where",
"nump... |
SKewLinez/tensorflow | [
"77d8c333405a080c57850c45531dbbf077b2bd0e"
] | [
"tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.data.ops.dataset_ops.make_one_shot_iterator",
"tensorflow.python.data.ops.dataset_ops.Dataset.range",
"tensorflow.python.framework.constant_op.constant",
"tensorflow.python.data.kernel_tests.checkpoint_test_base.default_test_combinations",
"tensorflow.python.ops.math_ops.squ... |
anapaulamendes/chefboost | [
"4628154f054cb6c79ab3f69a642d597c1265b202"
] | [
"chefboost/Chefboost.py"
] | [
"import pandas as pd\r\nimport math\r\nimport numpy as np\r\nimport time\r\nimport imp\r\nimport pickle\r\nimport os\r\nfrom os import path\r\nimport json\r\n\r\nfrom chefboost.commons import functions, evaluate as eval\r\nfrom chefboost.training import Preprocess, Training\r\nfrom chefboost.tuning import gbm, adab... | [
[
"pandas.DataFrame",
"pandas.isna",
"numpy.argmax",
"numpy.array",
"numpy.unique"
]
] |
samize/pandas | [
"700be617eb567fb4ab82aa8151d5c4ee02c22b95"
] | [
"pandas/core/window/rolling.py"
] | [
"\"\"\"\nProvide a generic structure to support window functions,\nsimilar to how we have a Groupby object.\n\"\"\"\nfrom __future__ import annotations\n\nimport copy\nfrom datetime import timedelta\nfrom functools import partial\nimport inspect\nfrom textwrap import dedent\nfrom typing import (\n TYPE_CHECKING,... | [
[
"pandas.core.window.numba_.generate_numba_apply_func",
"pandas.Series",
"pandas.compat.numpy.function.validate_rolling_func",
"pandas.core.apply.ResamplerWindowApply",
"pandas.core.dtypes.common.is_integer",
"pandas.core.indexes.api.MultiIndex.from_arrays",
"pandas.core.dtypes.common.i... |
AvantiShri/dragonn | [
"aeb9674f39b71d07ff62d2c3745bef4a2e55b95f"
] | [
"dragonn/positional_prc.py"
] | [
"from dragonn.utils import rolling_window\nimport numpy as np\nfrom sklearn.metrics import auc, precision_recall_curve\nimport matplotlib.pyplot as plt\nimport pdb\nfrom keras import backend as K\nimport tensorflow as tf\n\n \n\ndef positionalPRC(embeddings, scores,window_stride=1, coverage_thresh_for_positive=0... | [
[
"matplotlib.pyplot.legend",
"numpy.squeeze",
"numpy.zeros",
"sklearn.metrics.auc",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.step",
"matplotlib.pyplot.ylim",
"numpy.maximum",
"sklearn.metrics.precision_recall_curv... |
bguan/plmcbbox | [
"753b1f199194e3e680863010ae3177e680198b49"
] | [
"mcbbox/subcoco_effdet_icevision_fastai.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: 15_subcoco_effdet_icevision_fastai.ipynb (unless otherwise specified).\n\n__all__ = ['SubCocoParser', 'parse_subcoco', 'SaveModelDupBestCallback', 'FastGPUMonitorCallback',\n 'gen_transforms_and_learner', 'run_training', 'save_final']\n\n# Cell\nimport glob\nim... | [
[
"torch.cuda.is_available",
"torch.load"
]
] |
sidharthmiglani/Data-Science | [
"c4f69b85349c73d0a6241f0f91baedc770d2bf58"
] | [
"code/partone.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[21]:\n\n\nimport pandas as pd\nimport numpy as np\nimport json \nimport zipfile\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport re\n\n\n# In[12]:\n\n\nwikidata = pd.read_json('wikidata-movies.json.gz', orient='record', lines=True)\ngenres = pd.read_js... | [
[
"numpy.sum",
"pandas.read_json",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.scatter"
]
] |
kojikoji/STGE | [
"dec9acc59e15eaca287d727a94709926c6be9224"
] | [
"stge/variational_bayes.py"
] | [
"# -*- coding: utf-8 -*-\nimport math\nimport numpy as np\nimport numba\nfrom numpy import linalg as LA\nfrom utils import get_num_break_slice\n\n\n@numba.jit(nopython=True)\ndef calculate_Pi_mDelta(Ys, Mu, Sigma, sigma_s):\n # get number of point in each matrix\n sc_cell_num = Ys.shape[0]\n ref_cell_num =... | [
[
"numpy.sum",
"numpy.linalg.solve",
"numpy.zeros",
"numpy.diag",
"numpy.linalg.inv",
"numpy.linalg.eigvalsh",
"numpy.exp",
"numpy.linalg.cholesky",
"numpy.linalg.slogdet",
"numpy.max",
"numpy.log",
"numpy.concatenate",
"numpy.square",
"numpy.identity"
]
] |
berkeley-stat159/project-alpha | [
"330d025c4eda94d390a82e86deecb791086c9dbf"
] | [
"code/utils/scripts/tgrouping_script.py"
] | [
"\"\"\" Script for the tgrouping function.\nRun with: \n python tgrouping_script.py\n\"\"\"\n# Loading modules.\nfrom __future__ import absolute_import, division, print_function\nimport os\nimport numpy as np\nfrom scipy.stats import gamma\nimport matplotlib.pyplot as plt\nimport nibabel as nib\nimport sys\nimpo... | [
[
"numpy.ones",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.pyplot.colorbar",
"numpy.linspace",
"numpy.loadtxt"
]
] |
matthewmturner/ibis | [
"9360bf9878e78c06cadd6733abd04bf98ee0a090"
] | [
"ibis/tests/all/test_aggregation.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pytest\nfrom pytest import param\n\nimport ibis.expr.datatypes as dt\nfrom ibis.tests.backends import (\n BigQuery,\n Clickhouse,\n MySQL,\n Postgres,\n PySpark,\n SQLite,\n)\nfrom ibis.udf.vectorized import reduction\n\n\n@reduction(input_type=[dt.... | [
[
"pandas.testing.assert_frame_equal",
"numpy.testing.assert_allclose"
]
] |
banbiossa/deep-learning-from-scrach | [
"d183a73ad27c68a79500c35a94c174ce0455940c"
] | [
"src/ch04/gradient_2d.py"
] | [
"# coding: utf-8\n# cf.http://d.hatena.ne.jp/white_wheels/20100327/p3\nimport numpy as np\nimport matplotlib.pylab as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\ndef _numerical_gradient_no_batch(f, x):\n h = 1e-4 # 0.0001\n grad = np.zeros... | [
[
"matplotlib.pylab.xlim",
"numpy.zeros_like",
"matplotlib.pylab.grid",
"numpy.sum",
"matplotlib.pylab.quiver",
"matplotlib.pylab.ylabel",
"matplotlib.pylab.legend",
"matplotlib.pylab.draw",
"matplotlib.pylab.figure",
"matplotlib.pylab.show",
"numpy.arange",
"matplotl... |
ajesse11x/Cirq | [
"ef7b260b9fcdf27f79ab6f0f15ffd27fab7ccd20"
] | [
"cirq/linalg/transformations.py"
] | [
"# Copyright 2018 The Cirq Developers\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 o... | [
[
"numpy.eye",
"numpy.arctan2",
"numpy.sqrt",
"numpy.dot",
"numpy.real",
"numpy.ndindex",
"numpy.imag"
]
] |
tylerhuntington222/biosteam | [
"234959180a3210d95e39a012454f455723c92686"
] | [
"biosteam/units/design_tools/column_design.py"
] | [
"# -*- coding: utf-8 -*-\n# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules\n# Copyright (C) 2020, Yoel Cortes-Pena <yoelcortes@gmail.com>\n# \n# This module is under the UIUC open-source license. See \n# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt\n# for license d... | [
[
"numpy.log",
"numpy.exp"
]
] |
blondegeek/se3cnn | [
"513f5f827c4c511bdc96e3c6ea663c8fbce60f57"
] | [
"examples/point/structure.py"
] | [
"# pylint: disable=C, R, not-callable, no-member, arguments-differ\nimport json\nfrom functools import partial\n\nimport pymatgen\nimport torch\nimport random\nfrom se3cnn.non_linearities import GatedBlock\nfrom se3cnn.non_linearities.rescaled_act import relu, sigmoid\nfrom se3cnn.point.kernel import Kernel\nfrom s... | [
[
"torch.nn.Linear",
"torch.manual_seed",
"torch.no_grad",
"torch.tensor",
"torch.set_default_dtype",
"sklearn.metrics.confusion_matrix",
"torch.cuda.is_available",
"torch.isfinite"
]
] |
thomasnevolianis/biotite | [
"cb238a8d8d7dc82b3bcea274d7d91d5c876badcd"
] | [
"src/biotite/application/msaapp.py"
] | [
"# This source code is part of the Biotite package and is distributed\n# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further\n# information.\n\n__name__ = \"biotite.application\"\n__author__ = \"Patrick Kunzmann\"\n__all__ = [\"MSAApp\"]\n\nimport abc\nfrom tempfile import NamedTemporaryFile\nfrom ... | [
[
"numpy.zeros"
]
] |
rahul1990bhatia/Algorithms | [
"0459c5a23ba5ed23785c1db5d2e2cc050ff553cd"
] | [
"Graph/kruskal.py"
] | [
"import abc #abstract base class\nimport numpy as np\n\n\n#####Adjacency Matrix#########\n# You should use adjacency matrix for small densily connected graphs\n# space complexity O(V^2)\n\n############################################################\n#Base Class representation of class with all interface m... | [
[
"numpy.zeros"
]
] |
youlu860612/IDAR | [
"30e711fafb17731905febc8e86cb51306456d023"
] | [
"src/rule/msl_v2_rule.py"
] | [
"# msl_v2_rule.py\n# Defines the rules for gold standard and ambiguous subjects for msl v2 labels\n#\n# Steven Lu 8/21/2019\n\nimport numpy as np\n\n\nclass MSLV2Rule(object):\n def __init__(self, retirement_count):\n if retirement_count % 2 == 0 and retirement_count < 3:\n raise ValueError('re... | [
[
"numpy.unique"
]
] |
egilbertson-ucsf/basenji | [
"52dc3dbd53aa12f482041007236e89ef94f48cb4",
"3d06ec0f5e12f7c5c4be8dfd17efdad3feefd68f"
] | [
"bin/basenji_data_hic_write.py",
"bin/sonnet_sad_multi.py"
] | [
"#!/usr/bin/env python\n# Copyright 2017 Calico 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 appli... | [
[
"numpy.load",
"numpy.zeros",
"tensorflow.python_io.TFRecordOptions",
"tensorflow.train.Int64List",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.train.BytesList",
"numpy.percentile",
"numpy.minimum"
],
[
"numpy.array",
"numpy.zeros"
]
] |
nisheetpatel/DynamicResourceAllocator | [
"39d196e023e846d2e2ec1e6bccab57998352f7fa"
] | [
"scripts/resourceAllocator.py"
] | [
"import numpy as np\nimport pandas as pd\n\nclass GradientFreeResourceAllocator:\n def __init__(self, depth=3, lmda=1, n_restarts=10, n_trials=int(1e3),\\\n allocationMethod='variablePrecision'):\n # General parameters with default values\n self.lmda = lmda\n self.n_trials = n... | [
[
"numpy.zeros",
"numpy.linalg.inv",
"numpy.linalg.det",
"numpy.random.normal",
"numpy.random.randn",
"numpy.argmax",
"numpy.arange",
"numpy.trace",
"numpy.clip",
"numpy.log",
"numpy.array",
"numpy.square",
"numpy.mean"
]
] |
bisounoursrulio/package_test | [
"905db1bf8398055a9569f8245b00568a5f74c4c4"
] | [
"tests/automatic_tests.py"
] | [
"from __future__ import division\nimport unittest\nimport numpy as np\nimport linvpy as lp\nimport generate_random\nfrom scipy.sparse.linalg import lsmr\nimport matplotlib.pyplot as plt\nimport optimal as opt\nimport mestimator_marta as marta\nimport random\nimport copy\nimport toolboxinverse as inv\n\nTESTING_ITER... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"numpy.linalg.lstsq",
"numpy.random.rand",
"scipy.sparse.linalg.lsmr"
]
] |
HiKapok/DAN | [
"fb726fad86b3f53d12c7bc5b833a705d7d885563"
] | [
"dataset/convert_tfrecords.py"
] | [
"# Copyright 2018 Changan Wang\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to... | [
[
"tensorflow.placeholder",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.app.run",
"tensorflow.train.Int64List",
"tensorflow.train.FloatList",
"tensorflow.gfile.FastGFile",
"numpy.arange",
"tensorflow.image.encode_jpeg",
"tensorflow.Session",
"tensorflow.image.decode_jpe... |
tongni1975/tensorflow | [
"3d452dbcf7e1a71ba449f6acf7342cdd1dd11859"
] | [
"tensorflow/python/ops/control_flow_ops.py"
] | [
"# Copyright 2015 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.core.protobuf.control_flow_pb2.WhileContextDef",
"tensorflow.python.framework.ops.colocate_with",
"tensorflow.python.ops.control_flow_util.IsInXLAContext",
"tensorflow.python.ops.math_ops.maximum",
"tensorflow.python.framework.ops.convert_to_tensor_or_indexed_slices",
"tensorfl... |
sealneaward/pnr-labels | [
"75bcf7778f9bda2db5165be037e47f8dfdbe50d1"
] | [
"pnr/annotation/roles.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn.metrics import mean_squared_error\n\n\ndef get_possession_team(player, movement):\n \"\"\"\n Return the team_id of the ball_handler\n \"\"\"\n team_id = movement.loc[movement.player_id == player, 'team_id'].values[0]\n return team_id\n\n\ndef get... | [
[
"numpy.abs",
"sklearn.metrics.mean_squared_error"
]
] |
fdroessler/pandas | [
"dc86509b44b3fb0cd9a1a6d6ed564b082dc50848"
] | [
"pandas/core/reshape/merge.py"
] | [
"\"\"\"\nSQL-style merge routines\n\"\"\"\n\nimport copy\nimport string\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import hashtable as libhashtable, join as libjoin, lib\nfrom pandas.compat import lzip\nfrom pandas.errors import MergeError\nfrom pandas.util._decorators import Appender, Substitution... | [
[
"pandas.core.common.values_from_object",
"pandas.core.dtypes.common.is_number",
"pandas.core.sorting.is_int64_overflow_possible",
"numpy.any",
"pandas.core.reshape.concat.concat",
"pandas.core.dtypes.common.is_float_dtype",
"pandas.Categorical",
"pandas.core.dtypes.common.ensure_in... |
crazycodeon/flink | [
"a66a876126b2f702fa224be534aca4c729dd6f8a"
] | [
"flink-python/pyflink/fn_execution/utils/operation_utils.py"
] | [
"################################################################################\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 lice... | [
[
"pandas.Series",
"pandas.concat"
]
] |
Leonardo-Maciel/PSO_Maciel | [
"3939448da45716260f3ac7811afdd13be670f346"
] | [
"Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/tests/test_testing.py"
] | [
"import warnings\nimport pytest\nfrom matplotlib.testing.decorators import check_figures_equal\n\n\n@pytest.mark.xfail(\n strict=True, reason=\"testing that warnings fail tests\"\n)\ndef test_warn_to_fail():\n warnings.warn(\"This should fail the test\")\n\n\n@pytest.mark.parametrize(\"a\", [1])\n@check_figur... | [
[
"matplotlib.testing.decorators.check_figures_equal"
]
] |
xishansnow/MLAPP | [
"2f30cd94fd852a3f66fe92a124f65722bd2af509"
] | [
"mlapp/MLAPP_CODE/MLAPP-C6-Code/bootstrapDemo.py"
] | [
"import numpy as np\nfrom unidrnd import unid_rnd\nimport matplotlib.pyplot as plt\nfrom scipy import stats\nplt.rcParams[\"figure.figsize\"]=(10,15)\n# 真实的模型参数值\ntheta = 0.7\n# 采样的样本数量\nn_samples = [10, 100]\nx_label = ['(a)','(b)','(c)','(d)']\nfor index,n_sample in enumerate(n_samples):\n B = 10000 ... | [
[
"numpy.sum",
"scipy.stats.beta.rvs",
"numpy.zeros",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.random.rand",
"numpy.std",
"numpy.mean"
]
] |
Sunmingzhen/CogView | [
"6bc71b7cc07a209d258729674019f7d15a0ac4bb"
] | [
"data_utils/configure_data.py"
] | [
"# -*- encoding: utf-8 -*-\n'''\n@File : configure_data.py\n@Time : 2021/01/11 23:28:38\n@Author : Ming Ding \n@Contact : dm18@mails.tsinghua.edu.cn\n'''\n\n# here put the import lib\nimport os\nimport ipdb\nimport sys\nimport math\nimport random\nfrom tqdm import tqdm\nimport copy\n\nimport numpy as... | [
[
"numpy.array",
"torch.utils.data.DataLoader",
"torch.utils.data.SequentialSampler",
"torch.utils.data.BatchSampler"
]
] |
Evoiis/Robot-Follow-Ahead-with-Obstacle-Avoidance | [
"72a407eafc7cdebf0639314c4f4ad0dd6902e6e8"
] | [
"far_ws/src/follow_ahead_rl/old_script/plot_bag.py"
] | [
"#!/usr/bin/env python\nimport argparse\nimport copy\nimport traceback\n\nfrom os import listdir\nfrom os.path import isfile, join\n\n#from cv_bridge import CvBridge\n\n\nimport math\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nimport random\n# u\nimport numpy as np\nimport cv2 as cv\n\nimport rospy\n# ... | [
[
"numpy.arctan2",
"numpy.matmul",
"numpy.sum",
"numpy.sin",
"numpy.zeros",
"numpy.rad2deg",
"numpy.asarray",
"numpy.copy",
"numpy.cos",
"numpy.arange",
"numpy.sqrt",
"numpy.std",
"numpy.average",
"numpy.mean"
]
] |
ing-a-zepeda/covid19mexico | [
"9988a1e69f549ebc00cdf71fc9a9be696a371eea"
] | [
"python/ml-arima-covid.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom pandas.plotting import lag_plot\nfrom pandas import datetime\nfrom statsmodels.tsa.arima_model import ARIMA\nfrom sklearn.metrics import mean_squared_error\n\ndf = pd.read_csv(\"corona2.csv\")\ndf.head(6)\n\nplt.figure()\nlag_plot(df['I... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.mean_squared_error",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"pandas.plotting.lag_plot",
"matplotlib.pyplot.plot",
"matpl... |
adefossez/audio | [
"19fc580da97baf179395bb257647c5c25b993e42"
] | [
"test/torchaudio_unittest/librosa_compatibility_test.py"
] | [
"\"\"\"Test suites for numerical compatibility with librosa\"\"\"\nimport os\nimport unittest\nfrom distutils.version import StrictVersion\n\nimport torch\nimport torchaudio\nimport torchaudio.functional as F\nfrom torchaudio._internal.module_utils import is_module_available\n\nLIBROSA_AVAILABLE = is_module_availab... | [
[
"numpy.allclose",
"torch.Size",
"numpy.ceil",
"torch.randn",
"scipy.fftpack.dct",
"torch.rand",
"torch.linspace",
"torch.tensor",
"torch.from_numpy",
"torch.dist",
"torch.abs",
"torch.random.manual_seed",
"torch.hann_window"
]
] |
F35H/RandFunc | [
"58868e65389447237013024cf49124d5f1da3a8e"
] | [
"KNOWNALGO/W03/W0301.py"
] | [
"import time\r\nfrom os import system\r\nfrom statistics import stdev\r\nfrom statistics import variance\r\n\r\nimport matplotlib as mpl\r\nimport matplotlib.pyplot as plt\r\n\r\nimport W0302\r\nfrom W0303 import seedList\r\n\r\nif __name__ == \"__main__\":\r\n system(\"cls\")\r\n\r\n tStr = str( time.time() )\r\... | [
[
"matplotlib.use",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
TomLXXVI/pypv | [
"df3dfba586bdec171e3fa9795b7bae48f76f83f2"
] | [
"pypv/lib/nummath/deriv.py"
] | [
"import numpy as np\n\n\nclass Deriv:\n \"\"\"\n Calculate the derivative with given order of the function f(t) at point t.\n \"\"\"\n def __init__(self, f, dt, o=1):\n \"\"\"\n Initialize the differentiation solver.\n Params:\n - f the name of the function object... | [
[
"numpy.array",
"numpy.arange"
]
] |
adrianopls/GRIPy-X | [
"21c7fa1f32f8dbb0a5dff93c2bac5acf1f9181ca"
] | [
"fileio/lis.py"
] | [
"import os\nimport struct\nfrom collections import OrderedDict\nfrom pathlib import PurePath\n\nimport numpy as np\n\nimport app\nfrom fileio.tif import TIFFile\n\n\nPRA = {\n \"Physical Record Type\": (1, 1),\n \"Checksum Type\": (2, 2),\n \"File Number Presence\": (5, 1),\n \"Record Number Presence\":... | [
[
"numpy.asarray"
]
] |
ltgoslo/norBERT | [
"d75d5c12d9b7f9cc11c65757f2228b7e6070b69b"
] | [
"benchmarking/experiments/pos_finetuning.py"
] | [
"#!/bin/env python3\n\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport data_preparation.data_preparation_pos as data_preparation_pos\nimport fine_tuning\nimport utils.model_utils as model_utils\nimport utils.pos_utils as pos_utils\n\n\ndef test(training_lang,\n test_lang,\n split=\"... | [
[
"numpy.arange",
"pandas.DataFrame",
"numpy.array",
"numpy.unique"
]
] |
akizminet/submarine | [
"aa6e865f27167a26050d8daa293e0b4f41a144b6"
] | [
"submarine-sdk/pysubmarine/submarine/ml/tensorflow/input/input.py"
] | [
"# 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\"); you ma... | [
[
"tensorflow.data.TextLineDataset",
"tensorflow.reshape",
"tensorflow.string_to_number",
"tensorflow.string_split",
"tensorflow.split"
]
] |
Yoark/Transformer-Attention | [
"b8c62cb8618a03150ccfd73f705893d2b931b224"
] | [
"tests/tasks/test_sequence_tagging.py"
] | [
"from torchnlp.tasks.sequence_tagging import Tagger, hparams_tagging_base, VOCABS_FILE\n\nimport torch\nimport torch.nn as nn\n\nimport torchtext\nfrom torchtext import data\nfrom torchtext import datasets\n\nimport pytest\n\ndef udpos_dataset(batch_size):\n # Setup fields with batch dimension first\n inputs ... | [
[
"torch.cuda.is_available",
"torch.nn.Linear"
]
] |
dgarciabriseno/sunpy | [
"40f6d7d5ba9d63ac7ffd3ea8587642867caeae25"
] | [
"sunpy/image/tests/test_transform.py"
] | [
"import numpy as np\nimport pytest\nimport skimage.data as images\nfrom matplotlib.figure import Figure\nfrom skimage import transform as tf\n\nfrom astropy.coordinates.matrix_utilities import rotation_matrix\n\nfrom sunpy.image.transform import _rotation_registry, affine_transform\nfrom sunpy.tests.helpers import ... | [
[
"numpy.ones",
"numpy.sum",
"numpy.issubdtype",
"numpy.isclose",
"numpy.asarray",
"numpy.any",
"numpy.vstack",
"numpy.allclose",
"matplotlib.figure.Figure",
"numpy.cos",
"numpy.isnan",
"numpy.zeros",
"numpy.arange",
"numpy.roll",
"numpy.errstate",
"nu... |
ee14b104/sktime | [
"4a84a8257ccd15aa7736557aef5d34e015e16fd1"
] | [
"sktime/forecasting/tests/test_all_forecasters.py"
] | [
"#!/usr/bin/env python3 -u\n# -*- coding: utf-8 -*-\n# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\n\n# test API provided through BaseForecaster\n\n__author__ = [\"Markus Löning\"]\n__all__ = [\n \"test_raises_not_fitted_error\",\n \"test_score\",\n \"test_predict_time_index\",\n ... | [
[
"numpy.random.random",
"numpy.testing.assert_array_equal"
]
] |
sarahbald/BIG_2021_microbiome_evolution | [
"8adb48e9596a30f2db5b49a0f47f0ddc1188fcdf"
] | [
"scripts/calculate_within_person_sfs.py"
] | [
"import parse_midas_data\n#import pylab\nimport sys\nimport numpy\nimport bz2\nimport calculate_snp_prevalences\n\n\n\n################################################################################\n#\n# Standard header to read in argument information\n#\n##########################################################... | [
[
"numpy.array"
]
] |
YukeWang96/pytorch_geometric | [
"3c4466a3f38a2eba92073c730a09953ab5082c3d"
] | [
"torch_geometric/datasets/karate.py"
] | [
"import torch\nimport numpy as np\nimport networkx as nx\nfrom torch_geometric.data import InMemoryDataset, Data\n\n\nclass KarateClub(InMemoryDataset):\n r\"\"\"Zachary's karate club network from the `\"An Information Flow Model for\n Conflict and Fission in Small Groups\"\n <http://www1.ind.ku.dk/complex... | [
[
"torch.stack",
"torch.eye",
"torch.tensor"
]
] |
rgerum/open_gpias | [
"53936c10794328d89df179b2f0a56bccdc1883d8"
] | [
"open_gpias/StimulusFrontEnd.py"
] | [
"#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n# StimulusFrontEnd.py\r\n\r\n# Copyright (c) 2018, Richard Gerum, Achim Schilling, Hinrich Rahlfs, Matthias Streb\r\n#\r\n# This file is part of ASR-Setup.\r\n#\r\n# ASR-Setup is free software: you can redistribute it and/or modify\r\n# it under the terms of the ... | [
[
"numpy.sqrt",
"numpy.load",
"scipy.signal.lfilter",
"scipy.signal.butter"
]
] |
DoktorBotti/Probabilistic-Backpropagation | [
"56c9ca818f88fd11e4c38585eefaceb3c28e2184"
] | [
"theano/PBP_net/PBP_net.py"
] | [
"\nimport numpy as np\n\nimport pickle\n\nimport gzip\n\nimport pbp\n\nclass PBP_net:\n\n def __init__(self, X_train, y_train, n_hidden, n_epochs = 40,\n normalize = False):\n\n \"\"\"\n Constructor for the class implementing a Bayesian neural network\n trained with the probab... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.array",
"numpy.std",
"numpy.concatenate",
"numpy.full",
"numpy.mean"
]
] |
MJYINMC/Wheeled-Robot | [
"7425c9bdf4a2e55b7b4a4420a012a3daa3a6a114"
] | [
"icp_ws/src/course_agv_slam/scripts/mapping.py"
] | [
"#!/usr/bin/env python\nimport math\nimport numpy as np\n\n# f = open('/home/rosuser/catkin_ws/tmp/mapping.log', 'w')\ndef fprint(s):\n return\n f.write(s)\n f.write('\\n')\n f.flush()\n\nclass Mapping():\n def __init__(self, xw, yw, xyreso):\n self.width_x = xw*xyreso\n self.width_y = ... | [
[
"numpy.ones"
]
] |
srl-ethz/diffPD_sim2real | [
"e491668995a163b8ff7542d99f0b4e0c0f4ed2df"
] | [
"python/example/rolling_jelly_3d.py"
] | [
"import sys\nsys.path.append('../')\n\nimport os\nfrom pathlib import Path\nimport time\nimport numpy as np\nimport scipy.optimize\nimport pickle\n\nfrom py_diff_pd.common.common import ndarray, create_folder, rpy_to_rotation, rpy_to_rotation_gradient\nfrom py_diff_pd.common.common import print_info, print_ok, prin... | [
[
"numpy.random.normal",
"numpy.linalg.norm",
"numpy.zeros"
]
] |
Palspal98/inpainting_gmcnn | [
"e9af21043fc665df55ab36bf65463618f88c1b69"
] | [
"tensorflow/net/network.py"
] | [
"import tensorflow as tf\nfrom net.ops import random_bbox, bbox2mask, local_patch\nfrom net.ops import priority_loss_mask\nfrom net.ops import id_mrf_reg\nfrom net.ops import gan_wgan_loss, gradients_penalty, random_interpolates\nfrom net.ops import free_form_mask_tf\nfrom util.util import f2uint\nfrom functools im... | [
[
"tensorflow.layers.conv2d",
"tensorflow.summary.scalar",
"tensorflow.ones_like",
"tensorflow.layers.flatten",
"tensorflow.get_collection",
"tensorflow.reduce_mean",
"tensorflow.variable_scope",
"tensorflow.contrib.layers.max_pool2d",
"tensorflow.abs",
"tensorflow.image.resi... |
jackdbd/hdf5-pydata-munich | [
"3f814c7f58ac460f7bdadfc8deed9d9d44269dcf"
] | [
"snippets/create_synthetic_data.py"
] | [
"\"\"\"Create synthetic data to benchmark PyTables queries.\n\nUsage\n-----\n# Generate 10 datasets of synthetic data\npython create_synthetic_data.py -n 1000000\n\"\"\"\nimport os\nimport argparse\nimport time\nimport tables as tb\nimport numpy as np\n\n\nclass SyntheticDataDescription(tb.IsDescription):\n unsi... | [
[
"numpy.random.normal",
"numpy.random.randint",
"numpy.random.choice"
]
] |
camilorey/signals_package | [
"fe28fe9b4f791a951fb5249ab0da5efbcd54fd5c"
] | [
"signals/perturbations/step_perturbation.py"
] | [
"import warnings\nimport numpy as np\nfrom .perturbation import Perturbation\n\nclass StepPerturbation(Perturbation):\n \"\"\"\n This class will simulate a Step perturbation, with a support beginning at _t0 and ending in _t0+_support,\n that causes a Petrurbation in the form a Step Function.\n\n Paramet... | [
[
"numpy.random.normal"
]
] |
vietlinhtspt/NewFasterRCNN | [
"c2a1f51bfe8445662966d4cf62a098d8d3b373c4"
] | [
"lib/layer_utils/proposal_target_layer.py"
] | [
"# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick, Sean Bell and Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_... | [
[
"numpy.vstack",
"numpy.append",
"numpy.zeros",
"numpy.ascontiguousarray",
"numpy.hstack",
"numpy.round",
"numpy.where",
"numpy.array"
]
] |
redkfa/Dual-model-CNN-keras | [
"0ee8ff4778bc213a0336a166c5c61d8ae067200a"
] | [
"CODE/pc0_224ver.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Nov 13 05:13:27 2018\n\n@author: s207\n\"\"\"\n\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 10 02:43:10 2018\n\n@author: s207\n\"\"\"\nfrom keras.callbacks import TensorBoard\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.layers import... | [
[
"sklearn.metrics.confusion_matrix",
"numpy.argmax",
"sklearn.metrics.classification_report"
]
] |
tanaylab/metacells | [
"ecd957b306bd6af2fcfd56efb246ce15b0d8238a"
] | [
"metacells/pipeline/consistency.py"
] | [
"'''\nSplit\n-----\n'''\n\nfrom re import Pattern\nfrom typing import Collection, Optional, Tuple, Union\n\nimport numpy as np\nfrom anndata import AnnData\n\nimport metacells.parameters as pr\nimport metacells.tools as tl\nimport metacells.utilities as ut\n\nfrom .direct import compute_direct_metacells\n\n__all__ ... | [
[
"numpy.sum",
"numpy.any",
"numpy.arange",
"numpy.max",
"numpy.full"
]
] |
gcode-ai/rayml | [
"92c4f3c6041f465fee27a6c03bd7959c4ef21124"
] | [
"rayml/tests/component_tests/test_exponential_smoothing_regressor.py"
] | [
"from unittest.mock import patch\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom rayml.model_family import ModelFamily\nfrom rayml.pipelines.components import ExponentialSmoothingRegressor\nfrom rayml.problem_types import ProblemTypes\n\npytestmark = [\n pytest.mark.noncore_dependency,\n pyt... | [
[
"numpy.zeros"
]
] |
hackingmaterials/duramat | [
"8e7c0efecc1af89cdc27a3ed569b8c5f1d985888"
] | [
"clearsky_detection/cities_mapper.py"
] | [
"\n\nimport pandas as pd\nimport os\n\ngeological_info = pd.read_json('./cities.json')\ngeological_info = geological_info.drop(['growth_from_2000_to_2013', 'population'], axis=1)\ngeological_info['city'] = geological_info['city'].apply(lambda x: x.replace(' ', ''))\ngeological_info['state'] = geological_info['state... | [
[
"matplotlib.pyplot.show",
"pandas.read_json"
]
] |
arlain23/pydensecrf | [
"dee24b055d92dbbc906d50b282e0862d83c0cf80"
] | [
"tests/issue29.py"
] | [
"# probs of shape 3d image per class: Nb_classes x Height x Width x Depth\n# assume the image has shape (69, 51, 72)\nimport numpy as np\nimport pydensecrf.densecrf as dcrf\nfrom pydensecrf.utils import unary_from_softmax, create_pairwise_gaussian\n\n###\n\n#shape = (69, 51, 72)\n#probs = np.random.randn(5, 69, 51)... | [
[
"numpy.random.randn",
"numpy.argmax",
"numpy.prod"
]
] |
oxoxlol/api_key_detector | [
"e0ca322cda65e619479109fbcb8a7dda9483a0e9"
] | [
"sequentiality.py"
] | [
"import math\nimport sys\n\nimport matplotlib\n\nmatplotlib.use('Agg') # Avoid tkinter dependency\nimport matplotlib.pyplot as plt\n\nfrom . import charset as cset\n\n\ndef string_sequentiality(string, charset, plot_scatterplot=False):\n \"\"\"\n Computes how much a string contains sequence of consecutive or... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.use",
"matplotlib.pyplot.scatter"
]
] |
AK391/RealBasicVSR | [
"41a27d90447b324296e932da7b08b7a42aa7a613"
] | [
"generate_video_demo.py"
] | [
"import glob\n\nimport cv2\nimport mmcv\nimport numpy as np\n\n\nclass VideoDemo:\n ''' Generate video demo given two sets of images.\n\n Please note that there will be video compression when you save the output\n as a video. Therefore, the result would be inferior to the actual outputs.\n\n Args:\n ... | [
[
"numpy.copy"
]
] |
shixingxing/tf-learn | [
"4fa2eee3a51328fcf12665495356d0ce05cc537a"
] | [
"pachong/gupiao.py"
] | [
"import requests\nimport re\nimport pandas as pd\nimport _thread\n\n\n# 用get方法访问服务器并提取页面数据\ndef getHtml(cmd, page):\n url = \"http://nufm.dfcfw.com/EM_Finance2014NumericApplication/JS.aspx?cb=jQuery112406115645482397511_1542356447436&type=CT&token=4f1862fc3b5e77c150a2b985b12db0fd&sty=FCOIATC&js=(%7Bdata%3A%5B(x)... | [
[
"pandas.DataFrame"
]
] |
Nik6198/Advanced-DataStructure | [
"c7c6154b8dd5ff94825ad91020dccd8637d73fb1"
] | [
"Fibonacci Heap/dijstra_using_fib_heap.py"
] | [
"import _fib_heap\nimport random\nimport time \nimport matplotlib.pyplot as plt\nclass graph:\n\n def __init__(self,n):\n self.graph=[]\n \n for i in range(n):\n temp=[random.randint(0,1001) for i in range(n)]\n temp[i]=0\n self.graph.append(temp)\n \n \n def accept(self):\n for i... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
tomMEM/nltools | [
"848112e9c3f973e1c2a4b3790682ef9e5afc5b45"
] | [
"examples/01_DataOperations/plot_adjacency.py"
] | [
"\"\"\"\nAdjacency Class\n===============\n\nNltools has an additional data structure class for working with two-dimensional\nsquare matrices. This can be helpful when working with similarity/distance\nmatrices or directed or undirected graphs. Similar to the Brain_Data class,\nmatrices are vectorized and can store... | [
[
"matplotlib.pyplot.title",
"numpy.ones",
"numpy.random.randn",
"numpy.zeros"
]
] |
willwheelera/pyscf | [
"1de7f6fb8403bb0769a05eade2c2e7aa4f8a160e"
] | [
"pyscf/pbc/df/test/test_ft_ao.py"
] | [
"#!/usr/bin/env python\n# Copyright 2014-2018 The PySCF Developers. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LIC... | [
[
"numpy.eye",
"numpy.einsum",
"numpy.diag",
"numpy.random.seed",
"numpy.tril_indices",
"numpy.random.random",
"numpy.array",
"numpy.dot",
"numpy.linalg.norm"
]
] |
knutdrand/bdgtools | [
"18d21586515ec03e5fb96e959447f6b35e5350de"
] | [
"bdgtools/splitregions.py"
] | [
"import numpy as np\nfrom .regions import Regions\nclass SplitRegions:\n def __init__(self, regions, offsets):\n self._regions = regions\n self._offsets = offsets\n\n def get_signals(self, bedgraph):\n signals = bedgraph.extract_regions(self._regions)\n return signals.join_rows(sel... | [
[
"numpy.all"
]
] |
wishprophet/TensorFlow | [
"aacb173a65fe9e392c1a72309aff58ed02f5c32d"
] | [
"test_tensorboard.py"
] | [
"# encoding: utf-8\n\n\"\"\"\n@version: ??\n@author: Mouse\n@license: Apache Licence\n@contact: admin@lovexing.cn\n@software: PyCharm\n@file: tensorboard.py\n@time: 2018/5/10 9:36\n\"\"\"\n\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\n\n\ndef main():\n # 载入数据\n mnist =... | [
[
"tensorflow.placeholder",
"tensorflow.zeros",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.global_variables_initializer",
"tensorflow.truncated_normal",
"tensorflow.train.AdamOptimizer",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.... |
OctaveLauby/olfactory | [
"679b67459c12002041a8f77e1bdffe33d776500b"
] | [
"olfactory/tests/test_preprocessing.py"
] | [
"import numpy as np\nimport pytest\n\nfrom olfactory import preprocessing\n\n\ndef test_pipe_filter():\n\n class Elem(dict):\n\n def __init__(self, dic):\n super().__init__(dic)\n self.id = dic['id']\n self.flags = set()\n\n def __getattr__(self, attribute):\n ... | [
[
"numpy.array",
"numpy.sort",
"numpy.flip"
]
] |
Ohtani-y/open_model_zoo | [
"280b59fc6c00455889a1949c795558252fdad96f",
"2543996541346418919c5cddfb71e33e2cdef080"
] | [
"tools/accuracy_checker/openvino/tools/accuracy_checker/annotation_converters/kaldi_speech_recognition_pipeline.py",
"demos/multi_camera_multi_target_tracking_demo/python/mc_tracker/sct.py"
] | [
"\"\"\"\nCopyright (c) 2018-2021 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 ... | [
[
"numpy.load"
],
[
"numpy.transpose",
"numpy.argmin",
"scipy.optimize.linear_sum_assignment",
"numpy.arange",
"numpy.amin",
"numpy.delete",
"numpy.array",
"scipy.spatial.distance.cosine"
]
] |
eddddddy/Pyxelate | [
"9c7656c35fc8fda497fa496b6758c395716507aa"
] | [
"pyxelate/universe.py"
] | [
"from copy import copy\nfrom typing import List, Tuple, Union, Iterator, Iterable\n\n\nimport numpy as np\n\n\nclass Size:\n def __init__(self, size: Union[int, None]):\n \"\"\"\n Create a Size object with the given size. If the size passed\n in is None, then it is treated as infinite\n ... | [
[
"numpy.array",
"numpy.pad",
"numpy.all",
"numpy.copy"
]
] |
PedroAbreuQB/kedro | [
"a38552a0266d4ad7b823f1640e98aefa6175fd33"
] | [
"kedro/io/hdf_dataset.py"
] | [
"# Copyright 2018-2019 QuantumBlack Visual Analytics Limited\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# THE SOFTWARE IS P... | [
[
"pandas.HDFStore"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.