repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
TayaPenskaya/Diploma | [
"dee4e13eccdd0d0ddc4f667d2eb94260a7ed3847"
] | [
"pose_transfer/models/PATN_Fine.py"
] | [
"import numpy as np\nimport torch\nfrom collections import OrderedDict\nimport util.util as util\nfrom util.image_pool import ImagePool\nfrom .base_model import BaseModel\nfrom . import networks\n# losses\nfrom losses.SegmentsStyleLoss import SegmentsSeperateStyleLoss\n\n\nclass TransferModel(BaseModel):\n def n... | [
[
"torch.cat",
"numpy.zeros"
]
] |
pakallis/TileDB-Py | [
"e02824be50fdac445c81f78c6b1586ab1ec79696"
] | [
"examples/writing_dense_multiple.py"
] | [
"# writing_dense_multiple.py\n#\n# LICENSE\n#\n# The MIT License\n#\n# Copyright (c) 2018 TileDB, Inc.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, includi... | [
[
"numpy.array"
]
] |
hkchekc/python-neo | [
"d2873e7e340b25059f91876129e88f1bb4628ae8"
] | [
"neo/core/basesignal.py"
] | [
"# -*- coding: utf-8 -*-\n'''\nThis module implements :class:`BaseSignal`, an array of signals.\nThis is a parent class from which all signal objects inherit:\n :class:`AnalogSignal` and :class:`IrregularlySampledSignal`\n\n:class:`BaseSignal` inherits from :class:`quantities.Quantity`, which\ninherits from :cla... | [
[
"numpy.hstack",
"numpy.arange"
]
] |
BushMinusZero/deep-learning-skunk-works | [
"9178455c460940adbe6943e2b657c994da4af231"
] | [
"src/train_model.py"
] | [
"from typing import Generator, List, Union, Any\n\nimport torch\nfrom torch import nn, optim, Tensor\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\nfrom torchtext.data import BucketIterator\nfrom tqdm import tqdm\n\nfrom src.config import Config\nfrom src.early_stopping... | [
[
"torch.optim.lr_scheduler.StepLR",
"torch.utils.tensorboard.SummaryWriter"
]
] |
PetitBai/C-3-Framework | [
"cee2985097224db592011c47150e0f82d230e43e"
] | [
"models/CC.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport pdb\n\nclass CrowdCounter(nn.Module):\n def __init__(self,gpus,model_name):\n super(CrowdCounter, self).__init__() \n\n if model_name == 'AlexNet':\n from SCC_Model.AlexNet import AlexNet as net \... | [
[
"torch.nn.MSELoss",
"torch.nn.DataParallel"
]
] |
DatHydroGuy/RayTracer | [
"f870d3eb0408e52b92ee528bb6615187b762bede"
] | [
"tuples.py"
] | [
"import numpy as np\nfrom math import fabs\n\n\nclass Tuple:\n def __init__(self, x, y, z, w):\n self.x = x\n self.y = y\n self.z = z\n self.w = w\n self.vec = np.array([x, y, z, w])\n self.is_point = w == 1.0\n self.is_vector = w == 0.0\n self.mag = np.lin... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.zeros",
"numpy.cross"
]
] |
lewis-weinberger/slap | [
"20cdb5d44b4af998beb0434883bd3b87834235e1"
] | [
"slap/model.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"Generate an LAE population from a dark matter halo population, based on\nthe methods outlined in Weinberger et al. (2019).\n\nExamples:\n--------\n Import the module:\n >>> import model\n\n Generate LAE population:\n >>> lae_pop = slap.LAEM... | [
[
"numpy.ones_like",
"numpy.random.choice",
"numpy.exp",
"numpy.where",
"numpy.divide",
"numpy.vectorize",
"numpy.log",
"numpy.logical_and",
"numpy.arange",
"numpy.trapz",
"scipy.optimize.bisect",
"numpy.sqrt",
"numpy.log10",
"scipy.interpolate.interp1d",
... |
BigDataGrapes-EU/deliverable-D4.4 | [
"03fd7602dc54537408fd9f87d5fa7cb6cf715b2f"
] | [
"scripts/mungetime-gzip.py"
] | [
"import numpy as np\nimport sys\nimport gzip\n\nfrom collections import defaultdict\nbuckets=defaultdict(list)\nwith gzip.open(sys.argv[1],'rt') as f:\n for line in f:\n if line.startswith('[broker]'):\n fields=line.strip().split(\" \")\n arrival_time = float(fields[1])*1000 #sec to ... | [
[
"numpy.percentile"
]
] |
NahsiN/WalkSafe | [
"dbfbe7ede0d1aae9420358c61b365ac5359727ca"
] | [
"heat_map.py"
] | [
"\"\"\"\nOverlay crime costs on roads\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport overpass\nimport geopandas as gpd\nimport matplotlib.pyplot as plt\nfrom ast import literal_eval as make_tuple\nimport psycopg2\nimport ipdb\nimport sys\nimport cost_models\nimport sys\nimport json\nimport matplotlib as... | [
[
"pandas.read_sql"
]
] |
elda27/datasets | [
"9653c3eaeb4f320cf50034543925061e0e5c98a3"
] | [
"tensorflow_datasets/structured/radon.py"
] | [
"# coding=utf-8\n# Copyright 2021 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.int32",
"numpy.float32",
"tensorflow.compat.v2.io.gfile.GFile"
]
] |
harsharaj96/ibis | [
"ab3de68eb6596eca5cc7cba8c3fdb583f6143a4e"
] | [
"ibis/expr/api.py"
] | [
"\"\"\"Ibis expression API definitions.\"\"\"\n\nimport collections\nimport datetime\nimport functools\nimport numbers\nimport operator\nfrom typing import Any, List, Union\n\nimport dateutil.parser\nimport pandas as pd\nimport toolz\n\nimport ibis\nimport ibis.common.exceptions as com\nimport ibis.expr.analysis as... | [
[
"pandas.to_datetime",
"pandas.Timestamp"
]
] |
kwlzn/model-analysis | [
"ff6393bd90b58b2ed8a4a5e45eef68c306992b26",
"ff6393bd90b58b2ed8a4a5e45eef68c306992b26"
] | [
"tensorflow_model_analysis/util_test.py",
"tensorflow_model_analysis/extractors/feature_extractor.py"
] | [
"# Copyright 2018 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 ... | [
[
"tensorflow.test.main"
],
[
"tensorflow.train.Example",
"numpy.array",
"tensorflow.compat.v1.logging.warning",
"numpy.isscalar"
]
] |
bbrighttaer/jova_baselines | [
"336ec88e6069e16ab959cbd38aa58730e15e2e0a"
] | [
"jova/nn/tests/test_models.py"
] | [
"# Author: bbrighttaer\n# Project: jova\n# Date: 6/1/19\n# Time: 11:40 PM\n# File: test_models.py\n\n\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport unittest\n\nimport pandas as pd\nimport rdkit.Chem as ch\nimport torch\n\nimport jova\nfrom... | [
[
"pandas.read_csv",
"torch.randn"
]
] |
phadjido/DiscreteLatticeMech | [
"cd0487c6f6bc12276de76b6e26cc6e4be8b4ba1b"
] | [
"DiscreteLatticeMech/Core/StiffFlexibilTensors.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nConstruction of stiffness and flexibility tensors\n\"\"\"\nimport sys\nimport numpy as np\n\n\ndef StiffFlexTensors(P1, P2, StressVector1, StressVector2):\n # compute the determinant of the transformation matrix\n g = [[0]*2 for _ in range(2)]\n g[0][0] = P1[0]\n g[0][1... | [
[
"numpy.linalg.inv",
"numpy.linalg.det"
]
] |
xyt556/HydroSAR | [
"2142c300e4cf48065626832fdeb9c4aa472627dc"
] | [
"Python_Files/hydrolibs/vectorops.py"
] | [
"# Author: Sayantan Majumdar\n# Email: smxnv@mst.edu\n\nimport geopandas as gpd\nimport pandas as pd\nimport rasterio as rio\nimport numpy as np\nimport subprocess\nimport fiona\nimport os\nimport multiprocessing\nfrom joblib import Parallel, delayed\nfrom glob import glob\nfrom Python_Files.hydrolibs.sysops import... | [
[
"numpy.round",
"numpy.sum",
"pandas.read_csv"
]
] |
stjordanis/imodels | [
"3c31df3f3d600d3b9c07fabdffd375b93e139c50"
] | [
"imodels/experimental/bartpy/samplers/leafnode.py"
] | [
"import numpy as np\n\nfrom imodels.experimental.bartpy.model import Model\nfrom imodels.experimental.bartpy.node import LeafNode\nfrom imodels.experimental.bartpy.samplers.sampler import Sampler\nfrom imodels.experimental.bartpy.samplers.scalar import NormalScalarSampler\n\n\nclass LeafNodeSampler(Sampler):\n \... | [
[
"numpy.power"
]
] |
hackerekcah/ESRelation | [
"6aa1e4bcb04c90fca79a125cc128481155da54a1"
] | [
"data/esc_dataset.py"
] | [
"import torch\nimport os\nimport logging\nimport glob\nimport soundfile as sf\nimport resampy\nimport torchaudio\nfrom data.data_transformer import FakePitchShift, Compose\nfrom data import register_dataset\ntorchaudio.set_audio_backend(\"soundfile\") # switch backend\n\nlogger = logging.getLogger(__name__)\n\n\n@... | [
[
"torch.as_tensor",
"torch.mean"
]
] |
pouyajamali/semantic_vtr | [
"f80130faffbab38ceeb0351c8aad22872027660f"
] | [
"scripts/2d_vis.py"
] | [
"#!/usr/bin/env python\nimport rosbag\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport tf\nimport os\nimport sys\nfrom math import cos, sin\n\ngoods = [\n\t# '2017-09-11-19-59-24.bag',\n\n\t'2017-09-11-18-54-21.bag',\n\t'2017-09-11-19-16-41.bag',\n\n\t'2017-09-11-19-00-42.bag',\n\t'20... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gca"
]
] |
joonilahn/Deep-Classifier | [
"1f764bf3e5038d337bd862fb2a2cb735a3edfef8"
] | [
"calculate_mean_std.py"
] | [
"import os\nimport sys\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.dataset import Dataset\nfrom torchvision import transforms\n\nfrom datasets.dataset import CustomDataset\nfrom transforms.custom_transforms import InvertColor\n\ndef online_mean_and_sd(loader):\n \"\"\"Compute ... | [
[
"torch.empty",
"torch.utils.data.DataLoader",
"torch.sqrt"
]
] |
NEUdeep/SlowFast | [
"1742dc0d7304bb27d13ef89dfbf679a8ce4a4dac"
] | [
"slowfast/datasets/imagenet.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport json\nimport numpy as np\nimport os\nimport random\nimport re\nimport torch\nimport torch.utils.data\n\n# import cv2\nfrom iopath.common.file_io import g_pathmgr\nfrom PIL import Image\nfrom torchvision import transforms as transforms_tv\n\n# import slow... | [
[
"numpy.array",
"torch.Tensor"
]
] |
synapticarbors/muler | [
"4f4aa3d0e57b0aec4fec306ce4f6a6eaebb56152"
] | [
"src/muler/echelle.py"
] | [
"r\"\"\"\nEchelle Spectrum\n----------------\n\nAn abstract base class for a high resolution spectrum, for some echelle order :math:`m \\in ` out of :math:`M` total orders, each with vectors for wavelength, flux, and uncertainty, e.g. :math:`F_m(\\lambda)`. This class is a subclass of specutils' Spectrum1D and is ... | [
[
"numpy.zeros_like",
"numpy.isnan",
"numpy.nan_to_num",
"numpy.log",
"scipy.stats.median_abs_deviation",
"numpy.median",
"numpy.exp",
"numpy.mean",
"matplotlib.pyplot.subplots",
"numpy.abs",
"numpy.sqrt",
"scipy.optimize.minimize",
"numpy.nanmedian"
]
] |
cgnorthcutt/confidentlearning-data | [
"2f3155636663eb0813363dc06cd822aae6526c34"
] | [
"other_methods/coteaching_plus/loss.py"
] | [
"from __future__ import print_function\nimport torch \nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\nfrom numpy.testing import assert_array_almost_equal\n\n# Loss functions\ndef loss_coteaching(y_1, y_2, t, forget_rate, ind, noise_or_not):\n loss... | [
[
"numpy.logical_or",
"numpy.asarray",
"torch.max",
"numpy.sum",
"torch.from_numpy",
"torch.nn.functional.cross_entropy",
"torch.nn.functional.softmax",
"torch.sum"
]
] |
BenNordick/HiLoop | [
"07d20ce872b2d50c3dbd5d34f05d99f7e0c49a2e"
] | [
"countmotifs.py"
] | [
"import argparse\nfrom collections import Counter, defaultdict\nfrom identityholder import IdentityHolder\nimport liuwangcycles\nfrom minimumtopologies import ispositive, ismutualinhibition\nimport networkx as nx\nimport pandas as pd\n\n# PyPy virtual environment recommended for performance\n\ndef countmotifs(netwo... | [
[
"pandas.DataFrame.from_dict"
]
] |
JamesPino/pysb | [
"d02bfc917cf6226a51bd8ec64b5ad8565f4317a1"
] | [
"doc/examples/robertson_standalone.py"
] | [
"\"\"\"A simple three-species chemical kinetics system known as \"Robertson's\nexample\", as presented in:\n\nH. H. Robertson, The solution of a set of reaction rate equations, in Numerical\nAnalysis: An Introduction, J. Walsh, ed., Academic Press, 1966, pp. 178-182.\n\"\"\"\n\n# exported from PySB model 'robertson... | [
[
"numpy.empty"
]
] |
xiaopinggai-webrtc/subsync | [
"691c387c808bcf81a2afd4ca8b666df6346ff634"
] | [
"subsync/speech_transformers.py"
] | [
"import logging\nimport subprocess\nimport sys\n\nimport ffmpeg\nimport numpy as np\nfrom sklearn.base import TransformerMixin\nimport tqdm\nimport webrtcvad\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\n\ndef _make_webrtcvad_detector(sample_rate, frame_rate):\n vad = webrtc... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.frombuffer"
]
] |
giovannivenancio/otfnfv | [
"722d4ceec1d8fcfa590f4542740c7bedc9ce79d6"
] | [
"src/otfnfv/interface.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport PIL\nimport Tkinter\nimport collections\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom Tkinter import *\nfrom textwrap import fill\nfrom time import gmtime, strftime\nfrom PIL import ImageTk, Image\nfrom utils import PATH\nfrom... | [
[
"matplotlib.figure.Figure",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg",
"matplotlib.backends.backend_tkagg.NavigationToolbar2TkAgg"
]
] |
wdy06/kaggle-data-science-bowl-2019 | [
"645d690595fccc4a130cd435aef536c3af2e9045"
] | [
"src/ensemble.py"
] | [
"import argparse\nimport gc\nimport os\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\n\nimport features\nimport metrics\nimport preprocess\nimport utils\nfrom dataset import DSB2019Dataset\nfrom optimizedrounder import HistBaseRounder\nfrom weightoptimzer import WeightOptimzer\nfrom runner im... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"numpy.zeros"
]
] |
ltlancas/gala | [
"2621bb599d67e74a85446abf72d5930ef70ca181",
"2621bb599d67e74a85446abf72d5930ef70ca181"
] | [
"gala/integrate/pyintegrators/leapfrog.py",
"gala/integrate/timespec.py"
] | [
"# coding: utf-8\n\n\"\"\" Leapfrog integration. \"\"\"\n\nfrom __future__ import division, print_function\n\n\n# Third-party\nimport numpy as np\n\n# Project\nfrom ..core import Integrator\nfrom ..timespec import parse_time_specification\n\n__all__ = [\"LeapfrogIntegrator\"]\nclass LeapfrogIntegrator(Integrator):\... | [
[
"numpy.abs",
"numpy.vstack"
],
[
"numpy.array",
"numpy.ones",
"numpy.linspace",
"numpy.append"
]
] |
ashkanaev/kaggle-imaterialist | [
"375d53703e40c8b66b09a57b5bcf1929e7a33526"
] | [
"mmdetection/mmdet/models/detectors/ensemble_htc.py"
] | [
"from torch import nn\nfrom mmdet.core import (bbox2result, bbox_mapping)\nfrom mmdet.core import (bbox2roi, merge_aug_masks, merge_aug_bboxes, multiclass_nms, merge_aug_proposals)\nfrom mmdet.models.detectors import BaseDetector\n\n\nclass EnsembleHTC(BaseDetector):\n def __init__(self, models):\n super(... | [
[
"torch.nn.ModuleList"
]
] |
ahuang11/MetPy | [
"6529608d956039d4791a17a7bdb1a2c0bf97cd75"
] | [
"metpy/interpolate/tests/test_interpolate_tools.py"
] | [
"# Copyright (c) 2018 MetPy Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"Test the `tools` module.\"\"\"\n\nfrom __future__ import division\n\nimport numpy as np\nfrom numpy.testing import assert_almost_equal, assert_array_almost_equal\nimpor... | [
[
"numpy.testing.assert_almost_equal",
"pandas.DataFrame",
"numpy.array",
"numpy.testing.assert_array_almost_equal"
]
] |
SiliconLabs/mltk | [
"56b19518187e9d1c8a0d275de137fc9058984a1f"
] | [
"mltk/models/tinyml/anomaly_detection.py"
] | [
"\"\"\"anomaly_detection\n**********************\n\nMLPerf Tiny anomaly detection reference model\n\n- Source code: `anomaly_detection.py <https://github.com/siliconlabs/mltk/blob/master/mltk/models/tinyml/anomaly_detection.py>`_\n- Pre-trained model: `anomaly_detection.mltk.zip <https://github.com/siliconlabs/mltk... | [
[
"numpy.array"
]
] |
timc3406/uptasticsearch | [
"76f91c051d2de9fec25d3ff2a5bb250a9cd963ce"
] | [
"py-pkg/uptasticsearch/fetch_all.py"
] | [
"\"\"\"Functions for Pulling data from ES and unpacking into a table\n\"\"\"\n\nimport pandas as pd\nimport json\n\nfrom uptasticsearch.clients import uptasticsearch_factory\n\n\ndef es_search(es_host, es_index, query_body=\"{}\", size=10000, max_hits=None, scroll=\"5m\"):\n \"\"\"Execute a query to elasticsearc... | [
[
"pandas.io.json.json_normalize"
]
] |
shane-kercheval/python-helpers | [
"71a16a80603f403809e7ec766355551ac69bd120"
] | [
"helpsk/sklearn_eval.py"
] | [
"\"\"\"This module contains helper functions when working with sklearn (scikit-learn) objects;\nin particular, for evaluating models\"\"\"\n# pylint: disable=too-many-lines\nimport math\nimport warnings\nfrom re import match\nfrom typing import Tuple, Union, Optional, List, Dict\n\nimport numpy as np\nimport pandas... | [
[
"sklearn.metrics.confusion_matrix",
"numpy.mean",
"numpy.where",
"pandas.concat",
"sklearn.metrics.r2_score",
"pandas.DataFrame",
"numpy.logical_and",
"sklearn.dummy.DummyClassifier",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.sqrt",
"matplotlib.pyplot... |
sansseriff/ee148_FinalProject | [
"64938c7cb9bd3f9bcf295eb134dbaa209f76f88a"
] | [
"CalcMeanVariance_RGB_Dataset.py"
] | [
"import os\nimport numpy as np\nfrom Vector_Extractor import img2rgb\nfrom PIL import Image\nimport matplotlib.pyplot as plt\n\n#calc mean and variance of RGB dataset\n\n\ndef viewFlow(flow_array, dimx, dimy):\n colormap = img2rgb(flow_array, dimx, dimy)\n im = Image.fromarray(colormap)\n fig, ax = plt.sub... | [
[
"numpy.std",
"numpy.mean",
"matplotlib.pyplot.subplots"
]
] |
14rcole/MediaBin | [
"57cdf7405996b12cbc99fa6b6600792643fc0b59"
] | [
"app/audfprint/audfprint_analyze.py"
] | [
"\"\"\"\naudfprint_analyze.py\n\nClass to do the analysis of wave files into hash constellations.\n\n2014-09-20 Dan Ellis dpwe@ee.columbia.edu\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport numpy as np\n\nimport scipy.signal\n\n# For reading/writing hashes to file\nimport struct\n\n# For glob... | [
[
"numpy.max",
"numpy.zeros",
"numpy.minimum",
"numpy.hanning",
"numpy.copy",
"numpy.shape",
"numpy.nonzero",
"numpy.greater_equal",
"numpy.mean",
"numpy.arange",
"numpy.sqrt",
"numpy.maximum"
]
] |
jbellister-slac/pydm | [
"77f2ad84b072b62e695333dc399339bb32295cb7"
] | [
"pydm/tests/widgets/test_label.py"
] | [
"# Unit Tests for the PyDMLabel Widget\n\n\nimport pytest\nimport numpy as np\nimport logging\n\nfrom ...utilities import is_pydm_app\nfrom ...widgets.label import PyDMLabel\nfrom ...widgets.base import PyDMWidget\nfrom ...widgets.display_format import parse_value_for_display, DisplayFormat\n\nfrom qtpy.QtWidgets i... | [
[
"numpy.array"
]
] |
jlnerd/JLpy_Utilities | [
"486fb0ae379d079596d290ba9fc65c9be4d44785"
] | [
"pyDSlib/ML/NeuralNet/_callbacks.py"
] | [
"from sklearn.metrics import roc_auc_score\nfrom keras.callbacks import Callback\nclass roc_callback(Callback):\n def __init__(self,training_data,validation_data):\n self.x = training_data[0]\n self.y = training_data[1]\n self.x_val = validation_data[0]\n self.y_val = validation_data[... | [
[
"sklearn.metrics.roc_auc_score"
]
] |
egorsimchuk/binance_bot | [
"af1caac32f8d4804aea3af83250fd4530d9787df"
] | [
"src/data/dump_data.py"
] | [
"import pandas as pd\n\nfrom src.utils.utils import get_project_dir\nimport logging\nlogger = logging.getLogger(__name__)\n\nDATA_FOLDER = get_project_dir() / 'data'\nDUMP_FOLDER = DATA_FOLDER / 'dumps'\nDUMP_ORDERS_FPATH = DUMP_FOLDER / 'orders_dump.csv'\nDUMP_PRICES_FPATH = DUMP_FOLDER / 'prices_dump.csv'\n\n\nde... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
island255/ProGraML | [
"6c4ea50639773009e7c287feb62c6994fa4f3445",
"6c4ea50639773009e7c287feb62c6994fa4f3445"
] | [
"programl/task/dataflow/lstm_batch_builder.py",
"deeplearning/ml4pl/graphs/llvm2graph/node_encoder.py"
] | [
"# Copyright 2019-2020 the ProGraML authors.\n#\n# Contact Chris Cummins <chrisc.101@gmail.com>.\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/licen... | [
[
"numpy.array",
"numpy.arange",
"numpy.zeros"
],
[
"numpy.vstack"
]
] |
NVlabs/extreme-view-synth | [
"2820ffdda9f44e70cd2fdd0845ec9145293e4183"
] | [
"xtreme-view/DeepMVS/model.py"
] | [
"'''\nBSD 2-Clause License\n\nCopyright (c) 2018, Po-Han Huang\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n ... | [
[
"torch.cat",
"torch.nn.SELU",
"torch.nn.functional.upsample",
"torch.nn.init.xavier_normal",
"torch.nn.Conv2d",
"torch.nn.CrossEntropyLoss"
]
] |
FightWithLord/Recycle-GAN | [
"cc34de90607e28ab629873d8a440ba1266fa9b5e"
] | [
"options/base_options.py"
] | [
"import argparse\nimport os\nfrom util import util\nimport torch\n\n\nclass BaseOptions():\n def __init__(self):\n self.parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n self.initialized = False\n\n def initialize(self):\n self.parser.add_argument(... | [
[
"torch.cuda.set_device"
]
] |
jkooy/swin-mlp | [
"6bbd83ca617db8480b2fb9b335c476ffaf5afb1a"
] | [
"data/cached_image_folder.py"
] | [
"# --------------------------------------------------------\n# Swin Transformer\n# Copyright (c) 2021 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ze Liu\n# --------------------------------------------------------\n\nimport io\nimport os\nimport time\nimport torch.distributed ... | [
[
"torch.distributed.get_world_size",
"torch.distributed.get_rank"
]
] |
amarkpayne/cclib | [
"057939851617a5ae96888ecf5a5a288c0f5a30b6"
] | [
"cclib/parser/logfileparser.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2019, the cclib development team\n#\n# This file is part of cclib (http://cclib.github.io) and is distributed under\n# the terms of the BSD 3-Clause License.\n\"\"\"Generic output file parser and related tools\"\"\"\n\n\nimport bz2\nimport fileinput\nimport gzip\nimport ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
ariwasch/ObjectDistance-A | [
"137559a5a7774327bc89cb50268c366572f00cb9"
] | [
"Vision.py"
] | [
"# Copyright Ari Wasch 2020\nimport cv2 as cv2\nimport numpy as np\nimport math\n\n\nclass Vision:\n\n focalLength = 0.0 # Focal length of largest contour\n angle = 0.0 # Angle of largest contour relative to camera\n fittedHeight = 0.0 # Fitted height of the largest contour\n fittedWidth = 0.0 # Fit... | [
[
"numpy.array",
"numpy.int0"
]
] |
JeffersonQin/deep-learning | [
"0592b13ec17050a9a257d7903fcd2012df3fa9d1"
] | [
"d2l/utils/d2lhelper.py"
] | [
"import numpy as np\nimport random\nimport torch\nimport torchvision\nimport torch.nn as nn\nimport time\nfrom torch.utils import data\nfrom d2l import torch as d2l\nfrom matplotlib import pyplot as plt\nfrom IPython import display\n\n\n#################### Data Pipeline ####################\n\n# 进行分装,增加 Resize 功能\... | [
[
"torch.device",
"numpy.array",
"torch.no_grad",
"torch.nn.init.xavier_uniform_",
"matplotlib.pyplot.subplots",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss"
]
] |
hanv89/landmark_recornition | [
"02dec765d5233ca9cb0f62dadff6ca59f2c0f3e4"
] | [
"validate/validate_e.py"
] | [
"import tensorflow as tf\nfrom tensorflow import keras\n\nprint(tf.VERSION)\nprint(tf.keras.__version__)\n\nfrom tensorflow.keras.preprocessing import image\n# import utils.preprocessing.image as image\nfrom tensorflow.keras.applications.inception_v3 import preprocess_input\nfrom tensorflow.keras.applications impor... | [
[
"tensorflow.contrib.saved_model.load_keras_model",
"tensorflow.keras.preprocessing.image.load_img",
"tensorflow.keras.applications.inception_v3.preprocess_input",
"numpy.mean",
"tensorflow.keras.preprocessing.image.img_to_array",
"pandas.read_csv",
"numpy.expand_dims"
]
] |
presian-abarov/dit | [
"5bc110024abb9f9c63753e9aa7a632d2e9ae3d39"
] | [
"tests/divergences/test_emd.py"
] | [
"\"\"\"\nTests for dit.divergences.earth_mover_distance.\n\"\"\"\n\nimport warnings\n\nimport pytest\n\nimport numpy as np\n\nfrom dit import Distribution, ScalarDistribution\nfrom dit.divergences.earth_movers_distance import earth_movers_distance, earth_movers_distance_pmf\n\n\n@pytest.mark.parametrize(('p', 'q', ... | [
[
"numpy.asarray"
]
] |
TinkTheBoush/haiku-baseline | [
"d7c6d270ba3b861e49e4d4d19d057706bcb384ea"
] | [
"haiku_baselines/DDPG/ddpg.py"
] | [
"import jax\nimport jax.numpy as jnp\nimport haiku as hk\nimport numpy as np\nimport optax\n\nfrom haiku_baselines.DDPG.base_class import Deteministic_Policy_Gradient_Family\nfrom haiku_baselines.DDPG.network import Actor, Critic\nfrom haiku_baselines.DDPG.ou_noise import OUNoise\nfrom haiku_baselines.common.schedu... | [
[
"numpy.mean",
"numpy.zeros",
"numpy.random.uniform"
]
] |
romanwozniak/feast | [
"f9ab77961a56e1df7c4871009543b3b69ed1b255"
] | [
"sdk/python/feast/sdk/client.py"
] | [
"# Copyright 2018 The Feast 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ... | [
[
"pandas.DataFrame"
]
] |
ElectronicBabylonianLiterature/ebl-ai-api | [
"64f84ab4d9b12b5953a1a96829f5a734e47f522d"
] | [
"ebl_ai/tests/test_model.py"
] | [
"import numpy as np\nimport pytest\nfrom PIL import Image\n\nfrom ebl_ai.app import Model\nfrom ebl_ai.model import BoundingBoxesPrediction\n\nCONFIG_FILE = \"model/fcenet_no_dcvn.py\"\nCHECKPOINT = \"model/checkpoint.pth\"\n\n\nTEST_IMAGE_PATH = \"ebl_ai/tests/test_image.jpg\"\n\n\n@pytest.mark.skip(reason=\"Takes... | [
[
"numpy.asarray"
]
] |
mwhchen/quantecon | [
"1a401e3453cbccbcf609945fced1b478b945446e",
"1a401e3453cbccbcf609945fced1b478b945446e"
] | [
"stationary_densities/stochasticgrowth.py",
"optgrowth/optgrowth_v0.py"
] | [
"\"\"\"\nNeoclassical growth model with constant savings rate, where the dynamics are\ngiven by\n\n k_{t+1} = s A_{t+1} f(k_t) + (1 - delta) k_t\n\nMarginal densities are computed using the look-ahead estimator. Thus, the\nestimate of the density psi_t of k_t is\n\n (1/n) sum_{i=0}^n p(k_{t-1}^i, y)\n\nThis ... | [
[
"numpy.empty",
"scipy.stats.lognorm",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.linspace",
"scipy.stats.beta"
],
[
"numpy.max",
"scipy.interp",
"matplotlib.pyplot.cm.jet",
"numpy.empty",
"numpy.log",
"numpy.min",
"matplotlib.pyplot.subpl... |
schinavro/taps | [
"c03b4e23ed299824c1b062225b837a0b7cfff216"
] | [
"taps/ml/kernels/kernel.py"
] | [
"import numpy as np\nfrom numpy import identity as I\nfrom numpy import newaxis as nax\nfrom numpy import vstack, atleast_3d\n\n\nclass Kernel:\n \"\"\" Function like class that generate kernel matrix.\n\n Parameters\n ----------\n key2idx: dict\n linking between name of hyperparameters and index ... | [
[
"numpy.array",
"numpy.zeros",
"numpy.block",
"numpy.exp",
"numpy.identity",
"numpy.prod",
"numpy.einsum",
"numpy.swapaxes",
"numpy.arange",
"numpy.hstack",
"numpy.vstack"
]
] |
GGGOJO/sql_challenge | [
"66a1d967b439540c328980ae261151065868db79"
] | [
"BONUS_Question/Bonus_SQL_Challenge.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Extract Data from SQL Database (Postgresql) in Pandas\n# Bonus question to investigate if the employee data is fake through data visualizations.\n# \n\n# In[1]:\n\n\nget_ipython().system('pip3 install psycopg2-binary')\n\n\n# In[5]:\n\n\nimport pandas as pd\nfrom sqlal... | [
[
"pandas.merge",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_sql"
]
] |
antelk/hodgkin-huxley-model | [
"498c4b05da3f251bb01b8026a1a719184e99496c"
] | [
"src/output/deterministic_model/paper_figures/memristor_compat.py"
] | [
"\"\"\"Comparison between I-V curves obtained by using the smooth nonlinear\nmemristance approximation function introduced in the study by Bao, B.\nC.; Liu, Z. and Xu, J. P.: Steady periodic memristor oscillator with\ntransient chaotic behaviours, Electronic Letters, doi:\n10.1049/el.2010.3114, and by using the for... | [
[
"matplotlib.pyplot.rcParams.update",
"numpy.sin",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.power",
"numpy.abs",
"numpy.sqrt",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"numpy.cos",
"scipy.optimize.minimize"
]
] |
ihmeuw/vivarium_gates_iv_iron | [
"2d22ef63101a49b8c825884537c6fc79d559ba09"
] | [
"src/vivarium_gates_iv_iron/components/hemoglobin.py"
] | [
"import numpy as np\nimport pandas as pd\nimport scipy.stats\n\nfrom vivarium.framework.engine import Builder\nfrom vivarium.framework.population import SimulantData\n\nfrom vivarium_gates_iv_iron.constants.data_values import (\n HEMOGLOBIN_DISTRIBUTION_PARAMETERS,\n HEMOGLOBIN_THRESHOLD_DATA,\n ANEMIA_DIS... | [
[
"pandas.concat",
"numpy.array",
"numpy.sqrt",
"pandas.Series"
]
] |
Kpasha/stockDL | [
"43cbc77fa520c86dee638bebf4a4ab8940da1ba4"
] | [
"stockDL/market.py"
] | [
"'''\nThis module stores the stock market variables related to the stock ticker, \nThis module must be run after training the model by calling the train_model() function in the train module.\n'''\nimport numpy as np\nfrom . import train\nclass Market():\n def __init__(self, ticker):\n self.train = train.T... | [
[
"numpy.sign"
]
] |
lemolatoon/DeepLearningFromZero | [
"6d45410ff25f971fe856643967688023fd10f4bc"
] | [
"ch05/line.py"
] | [
"import numpy as np\r\nfrom network import network\r\nfrom draw import *\r\n\r\ndef main():\r\n x = np.array([0.1, 0.2, 0.3, 0.5])\r\n y = np.array([0.092, 0.185, 0.279, 0.462])\r\n z = np.polyfit(x, y, 1)\r\n a, b = z\r\n\r\n print(\"a:{}, b:{}\".format(a, b))\r\n x_reg = np.array([0, 0.6])\r\n ... | [
[
"numpy.array",
"numpy.polyfit"
]
] |
RenYuanXue/residual-sample-nn | [
"0f05a88c9e9d99b3c1c73dc4d8a2d638a689ebfb"
] | [
"tests/network_mcsample_plots.py"
] | [
"import sys\nsys.path.append(\"../residual-sample-nn\") # for finding the source files\nimport GenerateData as generate_data\nimport Network as Network\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport configparser\nimport mnist_loader\n\ndef RSNN_param_test(X_train, X_test, y_train,... | [
[
"numpy.array",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.KFold",
"matplotlib.pyplot.scatter",
"sklea... |
PingjunChen/ThyroidGeneralWSI | [
"ee3adaa4c3aa7c56d3cc5bd7b44d99894578beee"
] | [
"preprocess/show_annotation.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os, sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport openslide\nimport cv2\nfrom skimage import io\nfrom pydaily import filesystem\nfrom pydaily import format\nfrom pyimg import combine\n\n\n\ndef annotate_images(data_dir, cur_set, cur_cat, slide_level):\n slide... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.random.seed",
"numpy.mean",
"numpy.power"
]
] |
oaxiom/glbase3 | [
"4af190d06b89ef360dcba201d9e4e81f41ef8379",
"9d3fc1efaad58ffb97e5b8126c2a96802daf9bac"
] | [
"bayes/prior.py",
"tests/test_track.py"
] | [
"\"\"\"Classes and functions for representing prior distributions and constraints.\"\"\"\n\nimport numpy as N\n\nNEGINF = -N.inf\n\n#\n# Prior Models\n#\nclass Prior:\n \"\"\"\n Class for representing prior model.\n\n Priors have two aspects: \n * soft priors: weights for each possible edge.\n * ha... | [
[
"numpy.where",
"numpy.sum",
"numpy.ones",
"numpy.zeros"
],
[
"numpy.array"
]
] |
data-exp-lab/yt | [
"b8ae6c6f58eaa178e7d3ac378e4275c715f1ab8f",
"b8ae6c6f58eaa178e7d3ac378e4275c715f1ab8f"
] | [
"yt/data_objects/index_subobjects/octree_subset.py",
"yt/visualization/tests/test_particle_plot.py"
] | [
"from contextlib import contextmanager\nfrom itertools import product, repeat\n\nimport numpy as np\n\nimport yt.geometry.particle_deposit as particle_deposit\nimport yt.geometry.particle_smooth as particle_smooth\nfrom yt.data_objects.data_containers import YTSelectionContainer\nfrom yt.funcs import issue_deprecat... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.add",
"numpy.empty",
"numpy.errstate",
"numpy.zeros",
"numpy.ascontiguousarray",
"numpy.asfortranarray",
"numpy.multiply",
"numpy.finfo",
"numpy.atleast_3d",
"numpy.require",
"numpy.abs"
],
[
"n... |
AppleisTasty/MASK_public | [
"3de8cfab4ef05f2abade04a892f37bba4013c7a6"
] | [
"ner_plugins/NER_BiLSTM_Glove_i2b2.py"
] | [
"\"\"\"\nCopyright 2020 ICES, University of Manchester, Evenset Inc.\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... | [
[
"sklearn.metrics.classification_report",
"numpy.empty",
"numpy.asarray",
"sklearn.preprocessing.LabelBinarizer"
]
] |
L-F-A/Machine-Learning | [
"b9472544e06fc91606c0d1a609c23e22ba30cf18"
] | [
"General/Cov_Mat.py"
] | [
"import numpy as np\n\n#Return the covariance matrix and its svd decomposition\ndef CovMat(f_exact,f):\n\n\tD=f_exact-f\n\tMCOV=np.cov(D)\n\tU, S, Vt = np.linalg.svd(M)\n\tV = Vt.T\n\treturn MCOV,U,S,V\n\n\n#########################################################################################\n# Cova... | [
[
"numpy.diag",
"numpy.cov",
"numpy.linalg.svd",
"numpy.linalg.cholesky"
]
] |
MohammadrezaRezvani/performer-pytorch | [
"347dd58111f4f79b8991f7609552203609856b4b"
] | [
"performer_pytorch/linformer_pytorch.py"
] | [
"import torch \r\nfrom torch import nn\r\n\r\nfrom einops import rearrange, repeat\r\n\r\n##################################\r\n# Linformer\r\n##################################\r\ndef get_EF(input_size, dim, method=\"learnable\", head_dim=None, bias=True):\r\n \"\"\"\r\n Retuns the E or F matrix, initialized... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.einsum",
"torch.nn.init.normal_",
"torch.tensor",
"torch.nn.init.xavier_normal_",
"torch.matmul"
]
] |
nagasudhirpulla/python_wrldc_training | [
"c3a3216c0a11e1dac03d4637b4b59b28f1bb83c6"
] | [
"21_matplotlib_center_axes.py"
] | [
"'''\ncentering of matplotlib axes so that 0,0 point is in the middle of the figure\n'''\n# %%\nimport matplotlib.pyplot as plt\nx = []\ny = []\n\n# create a plotting area and get the figure, axes handle in return\nfig, ax = plt.subplots()\n\n# plot data on the axes handle\nax.plot(x, y)\n\n# Move left y-axis and b... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
ofnt/Kaggle-CommonLit-Readability-6th-Place-Solution | [
"61f5df662d8b5dfb3f80734e4444d52fe0f478cd"
] | [
"training/utils.py"
] | [
"import numpy as np\nimport os\nos.environ[\"TOKENIZERS_PARALLELISM\"] = \"false\" # disable warning when using smart batching\nimport pandas as pd\n\nfrom torch.utils.data import Dataset\nfrom sklearn.model_selection import StratifiedKFold\nfrom torch.utils.data import Dataset\nfrom pytorch_lightning.callbacks im... | [
[
"torch.tensor",
"pandas.cut",
"sklearn.model_selection.StratifiedKFold"
]
] |
mcx/ReAgent | [
"57b58a8b3a6b74bb87a197b73a6cd108ddad895e"
] | [
"reagent/test/net_builder/test_value_net_builder.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport unittest\n\nimport torch\nfrom reagent.core.parameters import NormalizationData, NormalizationParameters\nfrom reagent.core.types import FeatureData\nfrom reagent.net_builder import value\nfrom reagent.net_bui... | [
[
"torch.randn"
]
] |
Azesinte/machine-unlearning-for-recommendation | [
"2e389c7476f0c2c129d9337ef04d53ee4f6a35c2"
] | [
"score/KNN/fullretrain_baseline.py"
] | [
"import pandas as pd\nimport time\nimport matplotlib.pyplot as plt\nfrom Kbatch_KNNunlearning import KNNbase_Unlearning\n# from KNNbaseline import KNNbase_Unlearning\nfrom surprise import dump\nfrom KnnPred import knnpred\n\nif __name__ == \"__main__\":\n shards = 5\n shuffle = True\n shuffled_ordered_str ... | [
[
"matplotlib.pyplot.xlabel",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
chyanju/autopandas | [
"16080ad12f0e8e7b0a614671aea1ed57b3fed7fe"
] | [
"autopandas_v2/generators/ml/traindata/specs.py"
] | [
"import collections\nimport random\nfrom typing import Sequence, Callable, List, Union\n\nimport numpy as np\nimport pandas as pd\nimport itertools\nimport dateutil\nfrom numpy import nan\nimport re\nfrom autopandas_v2.generators.specs import df as s_df, dfgroupby as s_dfgroupby \nfrom autopandas_v2.generators.ml.t... | [
[
"pandas.isnull"
]
] |
onlyacat/Unsupervised-Graphs-Cluster | [
"27a39031439efe15e354b5ef87b7f386e73b547e"
] | [
"draw_clustering.py"
] | [
"import random\n\nimport numpy as np\nfrom torch_geometric.utils import to_networkx\nimport networkx as nx\nimport matplotlib.pyplot as plt\nfrom read_dataset import Dataset\n\ndataset = Dataset(name=\"AIDS\", device=\"cpu\", load_from_disk=False)\n\n# bbb = [x for x in fin[:,0]]\n# ccc = [x for x in fin[:,1]]\n\ny... | [
[
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.plot"
]
] |
JoeriHermans/hypothesis | [
"29a2b7b4649db345d43a8d3bf98aa5d817b43f1b"
] | [
"hypothesis/diagnostic/density.py"
] | [
"import hypothesis\nimport numpy as np\nimport torch\n\nfrom hypothesis.diagnostic import BaseDiagnostic\nfrom scipy.integrate import nquad\n\n\n\nclass DensityDiagnostic(BaseDiagnostic):\n\n def __init__(self, space, epsilon=0.1):\n super(DensityDiagnostic, self).__init__()\n self.epsilon = epsilo... | [
[
"scipy.integrate.nquad"
]
] |
LiamWoodRoberts/ELOWebApp | [
"be09a3dfda52ea5255fb9871ce392184ac8fba1f"
] | [
"app/predictor.py"
] | [
"# Module Imports\nfrom app import utils\nfrom app.elo_params import params\n\n# Package Imports\nimport lightgbm as lgb\nimport pandas as pd \nimport os\nimport re\nimport numpy as np \nimport warnings\nfrom scipy import stats\n\ndef get_sample(n_rows):\n model_params = params()\n sample = pd.read_csv(f'{mod... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"scipy.stats.percentileofscore",
"numpy.abs"
]
] |
rahul342/airflow | [
"2107dc97ca0b17131ad5cbda6c91301acf5a6079"
] | [
"airflow/contrib/hooks/bigquery_hook.py"
] | [
"import httplib2\nimport logging\nimport pandas\n\nfrom airflow.hooks.base_hook import BaseHook\nfrom apiclient.discovery import build\nfrom oauth2client.client import SignedJwtAssertionCredentials\nfrom pandas.io.gbq import GbqConnector, _parse_data as gbq_parse_data\nfrom pandas.tools.merge import concat\n\nloggi... | [
[
"pandas.io.gbq._parse_data",
"pandas.tools.merge.concat"
]
] |
apeck12/tomoxtal | [
"d2b3407708da2a35ecf061fb62ba397d837b980c"
] | [
"tests/test_locate_origin.py"
] | [
"import numpy as np\nfrom tomoxtal.utils import cctbx_tools\nfrom tomoxtal.utils import phases as phases_utils\nfrom tomoxtal.pipeline import LocateXtalOrigin\n\nclass TestLocateXtalOrigin:\n \n def setup_class(self):\n \"\"\"\n Prepare a few simulated datasets for a P212121 crystal.\n \"... | [
[
"numpy.array",
"numpy.isclose",
"numpy.allclose",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.meshgrid",
"numpy.vstack"
]
] |
abrazinskas/SelSum | [
"6ed0e282cf854db7095196732e62ef8662c0daa6"
] | [
"selsum/data/doc_reducer.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 numpy as np\nfrom fairseq.data import BaseWrapperDataset\nfrom shared_lib.utils.helpers.data import reduce_docs\nimport torch... | [
[
"numpy.minimum"
]
] |
ReDeiPirati/dockerfiles | [
"6d81ffca4d52eda6e72d9cd5fecee2ee6658b71e"
] | [
"dl/pytorch/tests/0.3.1/tensorboardx.py"
] | [
"# FROM: https://github.com/lanpa/tensorboard-pytorch\n\nimport torch\nimport torchvision\nimport tensorflow as tf\nimport torchvision.utils as vutils\nimport numpy as np\nimport torchvision.models as models\nfrom torchvision import datasets\nfrom tensorboardX import SummaryWriter\nimport psutil\nimport torch.nn as... | [
[
"torch.zeros",
"torch.rand",
"numpy.sin",
"numpy.random.rand",
"torch.cuda.get_device_name",
"torch.cuda.device_count",
"torch.cuda.is_available",
"numpy.arctan",
"numpy.random.randint",
"numpy.cos"
]
] |
fangohr/micromagnetics | [
"87ea834234f44c2728a4f9ec77f900313ba083d3"
] | [
"micromagnetictestcases/domainwall/analytic_solution.py"
] | [
"import numpy as np\n\n\ndef domainwall_analytic_solution(A, K, d, n_points):\n \"\"\"\n Computes Neel domain wall magnetisation x component\n in absence of an external magnetic field.\n \"\"\"\n x_array = np.linspace(0, d, n_points)\n mx_analytic = -np.tanh((x_array - d / 2.) / np.sqrt(A / K))\n\... | [
[
"numpy.linspace",
"numpy.sqrt"
]
] |
kammerje/pynrc | [
"91c503480df4d5fc6a6429b76dde97e9ed4f72b5",
"91c503480df4d5fc6a6429b76dde97e9ed4f72b5"
] | [
"pynrc/obs_nircam.py",
"pynrc/reduce/calib.py"
] | [
"from __future__ import division, print_function, unicode_literals\n\nfrom astropy.convolution import convolve, convolve_fft\nfrom astropy.convolution import Gaussian1DKernel, Gaussian2DKernel\nfrom scipy.ndimage.interpolation import rotate\nfrom scipy import fftpack\nfrom copy import deepcopy\n\n# Import libraries... | [
[
"scipy.ndimage.interpolation.rotate"
],
[
"numpy.fft.ifft2",
"numpy.fft.fft2",
"numpy.median",
"numpy.load",
"numpy.min",
"numpy.mean",
"numpy.where",
"numpy.sort",
"numpy.cumsum",
"numpy.concatenate",
"numpy.max",
"numpy.zeros_like",
"numpy.log",
"m... |
plutoyuxie/mmgeneration | [
"0a7f5d16c970de1766ebf049d7a0264fe506504b"
] | [
"tests/test_datasets/test_pipelines/test_compose.py"
] | [
"import numpy as np\nimport pytest\n\nfrom mmgen.datasets.pipelines import Compose, ImageToTensor\n\n\ndef check_keys_equal(result_keys, target_keys):\n \"\"\"Check if all elements in target_keys is in result_keys.\"\"\"\n return set(target_keys) == set(result_keys)\n\n\ndef test_compose():\n with pytest.r... | [
[
"numpy.random.randn"
]
] |
shangjie-li/yolact-test | [
"b64eac97e63ae696c5bd49cd5f5ce3cbcdd3f36a"
] | [
"data/config.py"
] | [
"from backbone import ResNetBackbone, VovNetBackbone\nfrom math import sqrt\nimport torch\n\n# for making bounding boxes pretty\nCOLORS = ((244, 67, 54),\n (233, 30, 99),\n (156, 39, 176),\n (103, 58, 183),\n ( 63, 81, 181),\n ( 33, 150, 243),\n ( 3, 169... | [
[
"torch.nn.functional.relu",
"torch.nn.functional.softmax"
]
] |
lostmsu/habitat-api | [
"5fd780796fc919680b2783851db7245a3a8db3b6"
] | [
"habitat_baselines/rl/ppo/ppo_trainer.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\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 os\nimport time\nfrom collections import deque\nfrom typing import Dict, List\n\nimport numpy as np\ni... | [
[
"torch.zeros",
"torch.device",
"torch.no_grad",
"torch.cuda.is_available",
"torch.tensor",
"torch.load"
]
] |
popcornell/audio | [
"7b6b2d000023e2aa3365b769866c5f375e0d5fda",
"7b6b2d000023e2aa3365b769866c5f375e0d5fda"
] | [
"test/torchaudio_unittest/prototype/emformer_cpu_test.py",
"test/torchaudio_unittest/models/wav2vec2/huggingface_intergration_test.py"
] | [
"import torch\nfrom torchaudio_unittest.common_utils import PytorchTestCase\nfrom torchaudio_unittest.prototype.emformer_test_impl import EmformerTestImpl\n\n\nclass EmformerFloat32CPUTest(EmformerTestImpl, PytorchTestCase):\n dtype = torch.float32\n device = torch.device(\"cpu\")\n\n\nclass EmformerFloat64CP... | [
[
"torch.device"
],
[
"torch.manual_seed",
"torch.randint",
"torch.randn",
"torch.arange"
]
] |
karoly-hars/indoor_depth_est_with_DenseNet | [
"c2746330d06fbe854f4c7c7a9e86cdc4de13b10e"
] | [
"image_utils.py"
] | [
"import math\nimport cv2\nimport numpy as np\nfrom torchvision import transforms\nimport matplotlib.pyplot as plt\n\n\nHEIGHT = 228\nWIDTH = 304\n\n\ndef scale_image(img, scale=None):\n \"\"\"Resize/scale an image. If a scale is not provided, scale it closer to HEIGHT x WIDTH.\"\"\"\n # if scale is None, scal... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"numpy.transpose",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplot"
]
] |
peterdfields/diploSHIC | [
"b204cc71a946be6093fab0336599ceecff04d651"
] | [
"diploshic/misc.py"
] | [
"import numpy as np\nfrom scipy.sparse import coo_matrix\n\n\"\"\"This is all a bunch of stuff copied from sk-learn 0.24.2 but shoving it in\nhere for compatibility purposes. Some slight modifications were made.\"\"\"\n\n\nclass ConfusionMatrixDisplay:\n \"\"\"Confusion Matrix visualization.\n It is recommend... | [
[
"scipy.sparse.coo_matrix",
"numpy.nan_to_num",
"numpy.asarray",
"numpy.errstate",
"numpy.zeros",
"numpy.ones",
"numpy.logical_and",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.argmax",
"numpy.all",
"numpy.empty_like"
]
] |
fiorenza2/ReadyPolicyOne | [
"975a5e31a8e8385f76f7877b1b0d691bcf530504"
] | [
"train.py"
] | [
"import argparse\nimport os\nimport random\n\nimport gym\nfrom gym.wrappers import TimeLimit\nimport numpy as np\nimport pandas as pd\nimport yaml\n\nfrom env_aug import AntEnvAug, HalfCheetahEnvAug, HopperEnvAug, fixedSwimmerEnv\nfrom model import EnsembleGymEnv\nfrom ppo import PPO, Memory\nfrom train_funcs impor... | [
[
"numpy.array",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.round",
"numpy.random.randint"
]
] |
sjvrijn/multi-level-co-surrogates | [
"04a071eb4360bed6f1a517531690beec7857e3e5",
"04a071eb4360bed6f1a517531690beec7857e3e5"
] | [
"scripts/processing/2020-07-06-extrapolation.py",
"notebooks/forrester2007/function_defs.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\n2020-07-06-extrapolation.py: based on small subsampled DoEs, extrapolate a best\nsuggested next DoE size and compare this with results from enumerated DoEs.\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport xarray as xr\nfrom pyprojroot im... | [
[
"matplotlib.pyplot.xlim",
"numpy.argmin",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.arctan2",
"matplotlib.pyplot.ylabel",
... |
kmiddleton/muscle_maya | [
"3896a4d066cb9e44f1d3a7510c9323b2c32ce636"
] | [
"rotation_matrix.py"
] | [
"from numpy import cross, eye, dot, array, pi\nfrom numpy.linalg import norm\nfrom math import atan2, sqrt\n\ndef ssc(v):\n '''\n Calculate the skew-symmetric cross-product matrix of v\n\n See: See: http://math.stackexchange.com/a/897677/6965\n '''\n\n return array([[0, -v[2], v[1]],\n ... | [
[
"numpy.array",
"numpy.dot",
"numpy.linalg.norm",
"numpy.eye",
"numpy.cross"
]
] |
alisure-fork/CONTA | [
"dde3e5083f45598d859dde889de3ae85c7a416e9"
] | [
"pseudo_mask/step/make_sem_seg_labels.py"
] | [
"import os\nimport torch\nimport numpy as np\nfrom PIL import Image\nimport voc12.dataloader\nimport torch.nn.functional as F\nfrom torch.backends import cudnn\nfrom alisuretool.Tools import Tools\nfrom misc import torchutils, indexing\nfrom torch import multiprocessing, cuda\nfrom torch.utils.data import DataLoade... | [
[
"numpy.pad",
"numpy.asarray",
"torch.max",
"torch.no_grad",
"torch.nn.functional.interpolate",
"torch.multiprocessing.spawn",
"torch.cuda.device",
"torch.cuda.device_count",
"torch.cuda.empty_cache",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.functional.... |
diradical/naiveDMRG | [
"bb9901bd483c006208ffe5e9531d163112bb9b76"
] | [
"dmrg.py"
] | [
"#! /usr/bin/env python\n# filename: dmrg.py\n\nimport numpy\nfrom mps_tensor import local_state\nfrom mpo import MPO\n\n# Attention to the identifiers \"pos\" and \"idx\":\n# pos: the position index of REAL sites\n# idx: the index of all the sites, including two dummies\n# pos == 0 is the first REAL site, whose id... | [
[
"numpy.isclose",
"numpy.zeros",
"numpy.linalg.eigh",
"numpy.ones",
"numpy.tensordot",
"numpy.diag"
]
] |
yzheng51/tencent-2020 | [
"7a5256403d103d23720295b7ea3c5f68d368829c"
] | [
"utils/stacking.py"
] | [
"import numpy as np\nfrom sklearn.metrics import roc_auc_score, accuracy_score, log_loss\nfrom utils.encoder import target_encode\n\n\ndef kfold_stack_binary(kfold, classifier, x_train, y_train, x_test):\n \"\"\"k fold stacking x_train and y_train for binary classification task\n given estimator `classifier` ... | [
[
"numpy.zeros",
"sklearn.metrics.accuracy_score",
"numpy.where",
"sklearn.metrics.log_loss",
"sklearn.metrics.roc_auc_score"
]
] |
Ren-Research/maestro | [
"b89e171d51ec910b165b9b01dd8373848a6207f7"
] | [
"tools/frontend/alpha/test_attentive_nas.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport pickle\nimport argparse\nimport builtins\nimport math\nimport os\nimport random\nimport shutil\nimport time\nimport warnings\nimport sys\nfrom datetime import date\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimpo... | [
[
"torch.device",
"torch.cuda.manual_seed",
"torch.no_grad",
"torch.manual_seed",
"torch.nn.CrossEntropyLoss"
]
] |
intelligent-human-perception-laboratory/Face-Warping-Emotion-Recognition | [
"751e27969d6368e93f9d348a414d96e0379115bd"
] | [
"contrastive/datasets.py"
] | [
"\"\"\"\nLoads data\n\"\"\"\n\nimport os\nimport PIL\nimport torch\nimport pandas\nimport numpy as np\n\nfrom PIL import Image\nfrom torch.utils.data import Dataset\nfrom torch.utils.data import DataLoader\nfrom torchvision import transforms\n\nclass NonTemporalDataset(Dataset):\n\tdef __init__(self, dataset_file_p... | [
[
"torch.cat",
"torch.stack",
"torch.unsqueeze",
"torch.utils.data.DataLoader",
"pandas.read_csv"
]
] |
Xingxiangrui/MTCNN_for_head_detection | [
"5f036271ab0e00a29721855282b8d2e8feef0238"
] | [
"src/mtcnn_pnet_test.py"
] | [
"\"\"\"The code to test training process for pnet\"\"\"\n\n# MIT License\n#\n# Copyright (c) 2017 Baoming Wang\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction,... | [
[
"tensorflow.Graph",
"tensorflow.device"
]
] |
devansh-pratap-singh/hackerrank-solutions | [
"227817d90846424cd3078e60b225eb201e906cf9"
] | [
"Python/Numpy/DotAndCross.py"
] | [
"import numpy\nn = int(input())\na = numpy.array([input().split() for _ in range(n)], int)\nb = numpy.array([input().split() for _ in range(n)], int)\nprint(numpy.dot(a, b))"
] | [
[
"numpy.dot"
]
] |
samgoldman97/kinase-cpi-reanalysis | [
"2a9dd1966632abefa94ecf4c5cf33020cca9d903"
] | [
"bin/perturb.py"
] | [
"from utils import *\n\nfrom anndata import AnnData\nfrom sklearn.metrics import roc_auc_score\nimport scanpy as sc\nfrom scipy.sparse import csc_matrix, csr_matrix\n\ndef auroc(y1, y2):\n labels = np.zeros(len(y1) + len(y2))\n labels[:len(y1)] = 1.\n values = np.concatenate([ y1, y2 ])\n return roc_auc... | [
[
"scipy.sparse.csc_matrix",
"sklearn.metrics.roc_auc_score"
]
] |
kaatish/cugraph | [
"36f86cd4f67a2f902a741eb6141d396aa6c19dbf"
] | [
"benchmarks/python_e2e/cugraph_funcs.py"
] | [
"# Copyright (c) 2021, NVIDIA CORPORATION.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law ... | [
[
"numpy.random.default_rng"
]
] |
ishine/audio-retrieval | [
"f6df6c737b0c7a42f7053a1794b77bd94cdaf5e7",
"f6df6c737b0c7a42f7053a1794b77bd94cdaf5e7"
] | [
"utils/visualizer.py",
"misc/gen_readme.py"
] | [
"\"\"\"A simple HTML visualizer.\n\nIt is based on the Cycle-GAN codebase:\nhttps://github.com/junyanz/pytorch-CycleGAN-and-pix2pix\n\"\"\"\nimport os\nimport numpy as np\nfrom pathlib import Path\nfrom . import util, html\n\n\nclass Visualizer:\n \"\"\"This class includes several functions that can display/save... | [
[
"numpy.array",
"numpy.random.seed",
"numpy.where",
"numpy.arange",
"numpy.argsort",
"numpy.diag"
],
[
"numpy.where",
"numpy.std",
"numpy.mean"
]
] |
adam2392/causalscm | [
"adca32848ddad7d07135651bf0af136649dc4725"
] | [
"causalscm/tests/test_scm.py"
] | [
"import pytest\n\nimport numpy as np\nfrom numpy.testing import assert_array_equal\nfrom scipy.stats import multiscale_graphcorr\n\nfrom causalscm.cgm import CausalGraph\nfrom causalscm.scm import StructuralCausalModel\n\nseed = 12345\nrng = np.random.RandomState(seed=seed)\n\n\ndef test_scm_errors():\n \"\"\"Te... | [
[
"numpy.testing.assert_array_equal",
"scipy.stats.multiscale_graphcorr",
"numpy.random.RandomState"
]
] |
imran-salim/scikit-multiflow | [
"05cf9dc095744b2990da326f0172fbab2c7e026f",
"05cf9dc095744b2990da326f0172fbab2c7e026f"
] | [
"src/skmultiflow/demos/_test_kdtree_compare.py",
"src/skmultiflow/trees/nodes/sst_active_learning_node_adaptive.py"
] | [
"import warnings\nimport numpy as np\nfrom scipy import spatial\nfrom skmultiflow.lazy import KDTree\nfrom sklearn import neighbors as ng\nfrom timeit import default_timer as timer\nfrom skmultiflow.data import FileStream\nfrom skmultiflow.transform import OneHotToCategorical\n\n\ndef demo():\n \"\"\" _test_kdtr... | [
[
"scipy.spatial.KDTree",
"numpy.asarray",
"sklearn.neighbors.KDTree"
],
[
"numpy.absolute",
"numpy.append"
]
] |
juanluisrosaramos/models | [
"646df38c0f7302efcc714c51091691f5b01e58bf"
] | [
"research/slim/train_image_classifier.py"
] | [
"\n\"\"\"Generic training script that trains a model using a given dataset.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\nfrom datasets import dataset_factory\nfrom deployment import model_deploy\nfrom nets impor... | [
[
"tensorflow.group",
"tensorflow.train.AdagradOptimizer",
"tensorflow.control_dependencies",
"tensorflow.identity",
"tensorflow.app.flags.DEFINE_bool",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.trainable_variables",
"tensorflow.train.latest_checkpoint",
"tensorflo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.