repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
shekarroy15/AIML-Projects | [
"48945108c728de1095e5b1cbfa34bf6abd74673a"
] | [
"07 Model Deployment/server.py"
] | [
"# Import libraries\nimport numpy as np\nfrom flask import Flask, request, jsonify\nimport pickle\nimport os\nos.chdir('/home/sunil/Desktop/Great Lakes')\n# Load the model\nmodel = pickle.load(open('finalized_model.sav','rb'))\napp = Flask(__name__)\n@app.route('/api',methods=['POST'])\ndef predict():\n # Get th... | [
[
"numpy.array"
]
] |
deephog/py-pde | [
"2b9cf5ecf90d33f484b6f2fb61437199ca66b25c",
"2b9cf5ecf90d33f484b6f2fb61437199ca66b25c"
] | [
"pde/pdes/allen_cahn.py",
"pde/visualization/movies.py"
] | [
"\"\"\"\nA Allen-Cahn equation\n\n.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de> \n\"\"\"\n\nfrom typing import Callable # @UnusedImport\n\nimport numpy as np\n\nfrom ..fields import ScalarField\nfrom ..grids.boundaries.axes import BoundariesData\nfrom ..tools.docstrings import fill_in_docstring\nfrom ..t... | [
[
"numpy.empty"
],
[
"matplotlib.animation.FFMpegWriter",
"matplotlib.animation.FFMpegWriter.isAvailable",
"matplotlib.pyplot.gcf"
]
] |
Tester-JasonWang/AI-learning | [
"b13324f14489e9aa60fb2118f9c066ed3f3ad03b"
] | [
"A2-神经网络基本原理简明教程/helper_class1/training_history.py"
] | [
"from matplotlib import pyplot as plt\r\n\r\n\r\nclass TrainingHistory(object):\r\n def __init__(self):\r\n self.iteration = []\r\n self.loss_history = []\r\n\r\n def add_loss_history(self, iteration, loss):\r\n self.iteration.append(iteration)\r\n self.loss_history.append(loss)\r\... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
golnazads/reference_service | [
"3cdd60d1113de099d3b355c1076badeec15f767d"
] | [
"referencesrv/parser/crf.py"
] | [
"\"\"\"\nThis module contains classes to train/test/classify\nconditional random field machine learning method\n\n\"\"\"\n\nimport os\nimport traceback\nimport numpy as np\nimport re\nimport nltk\nimport time\nfrom pystruct.models import ChainCRF\nfrom pystruct.learners import FrankWolfeSSVM\n\nfrom flask import cu... | [
[
"numpy.hstack",
"numpy.array"
]
] |
sshashaa/CART-with-scoring | [
"e151381d9be14b562551e3575e3f61b717e132e4"
] | [
"old code/code for each dataset/casp.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Apr 6 22:49:06 2019\n\n@author: sarashashaani\ncasp dataset \nmost recent last_working_withuf \nmax level = 3\nmin node size = 100\nsplit quantile = 20\ncrps quantil = N/A\n\"\"\"\n\nimport numpy as np\nfrom scipy import random as sr\nfrom ra... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.setp",
"numpy.asarray",
"numpy.log",
"numpy.mean",
"matplotlib.pyplot.figure",
"scipy.random.seed",
"numpy.atleast_1d",
"numpy.var",
"numpy.cumsum",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ticklabel_format"... |
szabosteve/eland | [
"64daa07a65cd45f23dc32ea8ab67ea1f1cc98c1d"
] | [
"tests/dataframe/test_metrics_pytest.py"
] | [
"# Licensed to Elasticsearch B.V. under one or more contributor\n# license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright\n# ownership. Elasticsearch B.V. licenses this file to you under\n# the Apache License, Version 2.0 (the \"License\"); you may\... | [
[
"pandas.to_datetime",
"pandas.isnull",
"pandas.testing.assert_frame_equal",
"numpy.isnan",
"pandas.Timestamp",
"pandas.testing.assert_series_equal",
"numpy.dtype"
]
] |
aherrera3/thesis | [
"962446258db65be33a7dac63766b07f3495d24e6"
] | [
"pdfs_evolution_graphs.py"
] | [
"\"\"\"\nScript for the evolution gif of the pdfs obtained with qcdnum.\n\nThe pdfs obtained by the DGLAP evolution equations, using qcdnum, are stored in files, containing each one a fixed q2 energy scale.\nThe output files with the pdfs and x values are stored in the directory named output, inside qcdnum.\nThose ... | [
[
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"pandas.read_csv"
]
] |
hs2361/aesara | [
"02378861f1a77135f2556018630092a09262ea76"
] | [
"tests/typed_list/test_type.py"
] | [
"import numpy as np\nimport pytest\n\nimport aesara\nfrom aesara.tensor.type import TensorType\nfrom aesara.typed_list.basic import TypedListVariable\nfrom aesara.typed_list.type import TypedListType\nfrom tests import unittest_tools as utt\nfrom tests.tensor.utils import rand_ranged\n\n\nclass TestTypedListType:\n... | [
[
"numpy.asarray"
]
] |
GyunHyukLee/GoldMine | [
"93d765934cd8c4e152f12dc1a9677bd77ea64f28"
] | [
"experiment/hyper-params-search/hps/algorithms/ga/GeneticAlgorithm.py"
] | [
"# -*- coding: utf-8 -*-\n# Author : Jin Kim\n# e-mail : jinkim@seculayer.com\n# Powered by Seculayer © 2020 Solution Development 2 Team, R&D Center. \n#\nimport random\n\nimport numpy as np\n\nfrom hps.algorithms.HPOptimizationAbstract import HPOptimizationAbstract\nfrom hps.algorithms.HPOptimizerUtil import HPOpt... | [
[
"numpy.random.randint"
]
] |
aspuru-guzik-group/gemini | [
"441d0f6c8842d15d4f917423ab440c5d78433199"
] | [
"examples/perovskites_opt/evaluator.py"
] | [
"#!/usr/bin/env python\n\nimport pickle\nimport numpy as np\n\n#==================================================================\n\n'''\n\tGoal: minimize the bandgap\n'''\n\n#==================================================================\n\norganics = [\n\t\t'acetamidinium', 'ammonium', 'azetidinium', 'butyla... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.where",
"numpy.argsort",
"numpy.amin"
]
] |
atwork2/pytorch_classification | [
"8cff2076ca0aae8c1e1e82aeaceb8162e4a7cb19"
] | [
"train_val.py"
] | [
"# -*- coding:utf-8 -*-\n# @time :2020/8/13\n# @IDE : pycharm\n# @author :lxztju\n# @github : https://github.com/lxztju\n# @Emial : lxztju@163.com\n\n\nimport torch\nimport argparse\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nfrom data import train_dataloader,train_datasets, val_... | [
[
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss",
"torch.load",
"torch.max"
]
] |
redspart/camelot | [
"e115a0ef61b1788b3e138604e4e042d561731dbb"
] | [
"tests/test_common.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\n\nimport pandas as pd\n\nimport camelot\nfrom camelot.core import Table, TableList\n\nfrom .data import *\n\ntestdir = os.path.dirname(os.path.abspath(__file__))\ntestdir = os.path.join(testdir, \"files\")\n\ndef test_load_entire():\n def append(box):\n try:\n ... | [
[
"pandas.DataFrame"
]
] |
qinyan-li/DocEE | [
"e8d2202a44907df5f12f9a67180d849a54421ab7"
] | [
"dee/utils.py"
] | [
"import os\nimport re\nimport json\nimport math\nimport logging\nimport pickle\nimport random\nimport importlib\nimport functools\nimport itertools\nfrom collections import defaultdict\nfrom typing import List, Dict, Optional\n\nimport numpy as np\nimport networkx as nx\nimport matplotlib as mpl\n\nmpl.use(\"Agg\")... | [
[
"matplotlib.use",
"numpy.array",
"numpy.bitwise_or",
"numpy.fill_diagonal",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.tril",
"torch.optim.lr_scheduler.LambdaLR",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axis"
]
] |
AStupidBear/keras-adamw | [
"f4df08e62799ae4d010f217544b4415df3bceb24"
] | [
"keras_adamw/utils.py"
] | [
"import tensorflow as tf\nimport keras.backend as K\nimport numpy as np\nimport random\nfrom termcolor import colored\n'''Helper methods for optimizers\n'''\n\n\ndef warn_str():\n return colored('WARNING: ', 'red')\n\n\ndef get_weight_decays(model, verbose=1):\n wd_dict = {}\n for layer in model.layers:\n ... | [
[
"numpy.random.seed",
"tensorflow.random.set_seed",
"tensorflow.compat.v1.reset_default_graph",
"tensorflow.set_random_seed"
]
] |
DavidVargasMora/notebooks-latest | [
"7dcb6bcd3e0b8677c5f9596180acb6c65dba7d1b"
] | [
"tests/testnotebooks.py"
] | [
"__version__ = '20200712'\n__author__ = 'Robert Nikutta <nikutta@noao.edu>'\n\n# imports\n\n# stdlib\nimport glob\nimport json\nimport os\nimport re\nimport time\nfrom getpass import getpass\nfrom pprint import PrettyPrinter\npp = PrettyPrinter()\npprint = pp.pprint\n\n# third party\nimport nbformat\nfrom nbconvert... | [
[
"pandas.DataFrame",
"pandas.set_option"
]
] |
Nienkedn/Nieuwsanalyse8 | [
"04a6575ec71f104fcb2c77d9316f6319bb66828d"
] | [
"WindmillProject/models/K-means.py"
] | [
"from sklearn.feature_extraction.text import TfidfVectorizer\nfrom stop_words import get_stop_words\nfrom sklearn.cluster import KMeans\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import adjusted_rand_score\nfrom collections import Counter\n\n# These are the csv files, we are going t... | [
[
"matplotlib.pyplot.xlabel",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"sklearn.feature_extraction.text.TfidfVectorizer",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter"
]
] |
GenoML/genoml | [
"bfe0164e99a27d5ec2b720b5a24e059294603e3f"
] | [
"genoml/parse_arguments.py"
] | [
"#! /usr/bin/env python -u\n# coding=utf-8\nimport csv\nimport os\nimport time\n\nimport numpy as np\nfrom docopt import docopt\n\nfrom genoml import __version__\n\nfrom genoml.steps import PhenoScale\n\n\nclass Options:\n _options = {}\n\n def __init__(self, commandline_args_file=None):\n self._option... | [
[
"numpy.array",
"numpy.unique"
]
] |
Abdulah-Fawaz/Benchmarking-Surface-DL | [
"9693379f26d57f9aabf28b973f40a9f6f627d26f",
"9693379f26d57f9aabf28b973f40a9f6f627d26f"
] | [
"Segmentation_UGSCNN/Spherical_UNet/python_scripts_for_filters_orders/matlab_equivalent_functions.py",
"models/presnet/model.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jan 20 12:23:37 2020\n\n@author: fa19\n\"\"\"\nimport numpy as np\nimport scipy.io as sio\ndef ismember(a_vec, b_vec):\n \"\"\" MATLAB equivalent ismember function \"\"\"\n\n bool_ind = np.isin(a_vec,b_vec)\n common = a[bool_ind]\n ... | [
[
"numpy.zeros_like",
"numpy.arccos",
"numpy.linalg.norm",
"numpy.zeros",
"scipy.io.loadmat",
"numpy.load",
"numpy.where",
"numpy.transpose",
"numpy.ravel",
"numpy.cross",
"numpy.unique",
"numpy.isin"
],
[
"torch.nn.Linear",
"torch.nn.LogSoftmax",
"tor... |
jaib1/yass | [
"9899c7d63c522a26b160ac7a223c794dfd3e23c6"
] | [
"src/yass/evaluate/analyzer.py"
] | [
"import numpy as np\nimport os\nimport yaml\n\nfrom yass.evaluate.stability import (MeanWaveCalculator,\n RecordingAugmentation,\n RecordingBatchIterator,\n SpikeSortingEvaluation)\nfrom yass.evaluate.visuali... | [
[
"numpy.array",
"numpy.load",
"numpy.dtype",
"numpy.save"
]
] |
sneakyPad/decoding-latent-space-rs | [
"bc7bfba5d6cf5a9d72f5c5393f394dee1025441a"
] | [
"models/dsprites_vae.py"
] | [
"# pip install pytorch-lightning\n# pip install neptune-client\n#%%\nfrom __future__ import print_function\nfrom utils.hessian_penalty.hessian_penalty_pytorch import hessian_penalty\nfrom pytorch_lightning.loggers import WandbLogger\nfrom pytorch_lightning.callbacks.progress import ProgressBar\nfrom sklearn.model_s... | [
[
"torch.nn.Linear",
"torch.randperm",
"torch.cuda.is_available",
"pandas.read_csv",
"torch.exp",
"torch.sum",
"numpy.empty",
"numpy.log",
"numpy.nonzero",
"torch.manual_seed",
"torch.randn_like",
"torch.utils.data.DataLoader",
"numpy.append",
"torch.zeros_lik... |
mkelley/pds3 | [
"a4c4a0b4f7ffe7f0762d987f7fb95a986abf1759"
] | [
"pds3/core.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n__all__ = [\n 'read_label',\n 'read_ascii_table',\n 'read_image',\n 'read_table'\n]\n\nimport os\nfrom warnings import warn\nfrom collections import OrderedDict\n\ntry:\n from ply import lex, yacc\nexcept ImportError:\n raise Impo... | [
[
"numpy.array",
"numpy.rollaxis",
"numpy.any",
"numpy.prod",
"numpy.fromfile",
"numpy.frombuffer",
"numpy.dtype"
]
] |
serg-music/great_expectations | [
"f164b922e6e69cfd2fb42cb779909ee2faa7e0a5"
] | [
"great_expectations/rule_based_profiler/parameter_builder/parameter_builder.py"
] | [
"import copy\nimport itertools\nfrom abc import ABC, abstractmethod\nfrom collections import OrderedDict\nfrom dataclasses import asdict, dataclass, make_dataclass\nfrom typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union, cast\n\nimport numpy as np\n\nimport great_expectations.exceptions as ge_exc... | [
[
"numpy.indices",
"numpy.isnan",
"numpy.nan_to_num",
"numpy.issubdtype"
]
] |
VassilisCN/vision | [
"981ccfdff1e173d37712dd13d960a2495287aee0"
] | [
"references/classification/train.py"
] | [
"import datetime\nimport os\nimport time\n\nimport torch\nimport torch.utils.data\nfrom torch import nn\nimport torchvision\nfrom torchvision.transforms.functional import InterpolationMode\n\nimport presets\nimport utils\n\ntry:\n from apex import amp\nexcept ImportError:\n amp = None\n\n\ndef train_one_epoch... | [
[
"torch.device",
"torch.optim.lr_scheduler.StepLR",
"torch.utils.data.RandomSampler",
"torch.nn.SyncBatchNorm.convert_sync_batchnorm",
"torch.no_grad",
"torch.utils.data.SequentialSampler",
"torch.nn.parallel.DistributedDataParallel",
"torch.utils.data.DataLoader",
"torch.load",... |
hhoppe/hhoppe-utils | [
"e9a0dae70a98fc48f805f537d1c1962fea5e5190"
] | [
"hhoppe_tools/__init__.py"
] | [
"#!/usr/bin/env python3\n\"\"\"Library of Python tools -- Hugues Hoppe.\n# pylint: disable=line-too-long\n\nUseful commands to test and polish this file:\n\nbash -c 'f=__init__.py; true && env python3 $f; env mypy --strict \"$f\"; autopep8 -a -a -a --max-line-length 80 --indent-size 2 --ignore E265 --diff \"$f\"; p... | [
[
"numpy.isposinf",
"numpy.issubdtype",
"numpy.broadcast_to",
"numpy.full",
"numpy.zeros_like",
"numpy.linalg.norm",
"numpy.empty",
"numpy.unravel_index",
"numpy.prod",
"numpy.isfinite",
"numpy.expand_dims",
"numpy.empty_like",
"numpy.square",
"numpy.array",
... |
Clymsw/xHVI-2020 | [
"548162f517d4b052c1f62224dabba566a1290a2e"
] | [
"standard-test-functions/plotFunctions.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import rcParams\n\nplt.style.use('ggplot')\nrcParams['font.sans-serif'] = \"Segoe UI\"\nrcParams['font.family'] = \"sans-serif\"\n\nplot_size = 10.0\n\ndef plot_map_with_points(d2X, d2Y, d2Col, d1Contours, sColMap, d1MapRange,\n ... | [
[
"numpy.max",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.min",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clabel",
"matplotlib.pyp... |
mrocklin/pandas | [
"4fb963b6a3261940de5891323a8d217087a2a9a1"
] | [
"pandas/tests/io/test_html.py"
] | [
"from __future__ import print_function\n\nimport glob\nimport os\nimport re\nimport threading\n\nfrom functools import partial\n\nimport pytest\n\nimport numpy as np\nfrom numpy.random import rand\n\nfrom pandas import (DataFrame, MultiIndex, read_csv, Timestamp, Index,\n date_range, Series)\nfro... | [
[
"pandas.compat.StringIO",
"numpy.random.rand",
"pandas.util.testing.assert_raises_regex",
"numpy.dtype",
"pandas.util._test_decorators.safe_import",
"pandas.DataFrame",
"pandas.util.testing.assert_index_equal",
"pandas.compat.is_platform_windows",
"pandas.util.testing.get_data_... |
kathy-lee/astyx-pcdet | [
"355bfd88c37e1b717482f651778c1d4cb2f647d2"
] | [
"pcdet/models/dense_heads/point_seg_head.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\n\nfrom ...utils import box_utils\nfrom .point_head_template import PointHeadTemplate\nfrom ...ops.roiaware_pool3d import roiaware_pool3d_utils\n\nclass SoftmaxFocalClassificationLoss(nn.Module):\n \"\"\"\n Softmax focal cross entropy loss.\n \"\"\"\... | [
[
"torch.nn.Softmax",
"torch.max",
"torch.clamp",
"torch.nn.functional.cross_entropy",
"torch.exp"
]
] |
culdo/SiamMask | [
"8eb80eb95c255124e7732c31f22795c7d65dd66b"
] | [
"tools/test.py"
] | [
"# --------------------------------------------------------\n# SiamMask\n# Licensed under The MIT License\n# Written by Qiang Wang (wangqiang2015 at ia.ac.cn)\n# --------------------------------------------------------\nfrom __future__ import division\nimport argparse\nimport logging\nimport numpy as np\nimport cv2... | [
[
"numpy.array_equal",
"numpy.tile",
"numpy.exp",
"numpy.mean",
"torch.cuda.is_available",
"numpy.int0",
"numpy.max",
"numpy.concatenate",
"torch.is_tensor",
"numpy.unravel_index",
"numpy.arange",
"numpy.transpose",
"numpy.sqrt",
"numpy.argmax",
"numpy.ran... |
braxtonmckee/nativepython | [
"5c64e91eb959fcd1c2c42655b40c7cceb3436f1d"
] | [
"nativepython/tests/list_of_compilation_test.py"
] | [
"# Copyright 2018 Braxton Mckee\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 ... | [
[
"numpy.arange"
]
] |
Subraiz/OpenMDAO | [
"ba247746e76fc3a46b768d0f09955ef58ee71ae4",
"ba247746e76fc3a46b768d0f09955ef58ee71ae4",
"ba247746e76fc3a46b768d0f09955ef58ee71ae4"
] | [
"openmdao/solvers/tests/test_solver_iprint.py",
"openmdao/utils/variable_table.py",
"openmdao/test_suite/test_examples/beam_optimization/components/multi_states_comp.py"
] | [
"\"\"\" Unit test for the solver printing behavior. \"\"\"\n\nimport os\nimport sys\nimport unittest\n\nimport numpy as np\n\nimport openmdao.api as om\nfrom openmdao.test_suite.components.double_sellar import SubSellar\nfrom openmdao.test_suite.components.sellar import SellarDerivatives\n\nfrom openmdao.utils.gene... | [
[
"numpy.array"
],
[
"numpy.linalg.norm"
],
[
"scipy.sparse.linalg.splu",
"scipy.sparse.coo_matrix",
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.tile",
"numpy.arange"
]
] |
d-e-h-i-o/german-qg | [
"b5f57294839597708844250fac06b13f48ae1e74"
] | [
"run_qg.py"
] | [
"#!/usr/bin/env python\n# coding=utf-8\n# Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
[
"numpy.where",
"numpy.count_nonzero",
"numpy.mean"
]
] |
Aborah30/chainladder-python | [
"c7d3f4f0a5333b6bd34922cc406f252ab9c47e10"
] | [
"chainladder/development/base.py"
] | [
"\"\"\"\nLoss Development\n================\n\"\"\"\nimport numpy as np\nimport pandas as pd\nimport copy\nimport warnings\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom chainladder import WeightedRegression\nfrom chainladder.core import IO\n\n\nclass DevelopmentBase(BaseEstimator, TransformerMixin... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.isnan",
"numpy.nan_to_num",
"numpy.ones",
"pandas.PeriodIndex",
"numpy.nanmin",
"numpy.where",
"numpy.swapaxes",
"numpy.sqrt",
"numpy.repeat",
"numpy.nanmax",
"numpy.flip"
]
] |
lartpang/DistributedSODProj | [
"d743db8d964eb07f1af746e658b5758298c78eef"
] | [
"utils/misc.py"
] | [
"import functools\nimport os\nimport random\nimport warnings\nfrom collections import OrderedDict\nfrom datetime import datetime\n\nimport numpy as np\nimport torch\nimport torch.backends.cudnn as torchcudnn\nfrom openpyxl import load_workbook, Workbook\nfrom thop import profile\nfrom torch.autograd.variable import... | [
[
"torch.rand",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.manual_seed",
"torch.randn"
]
] |
chiarasharp/py3DViewer | [
"c1bcd32f15e648cb7262ae25ae834d47ed9fd00d"
] | [
"Py3DViewer/structures/Abstractmesh.py"
] | [
"import numpy as np\nfrom ..visualization import Viewer\nfrom ..utils import Subject, Observer\nimport copy\n\nclass Clipping(object):\n\n class __Flip(object):\n def __init__(self):\n self.x = False\n self.y = False\n self.z = False\n\n def __init__(self):\n sel... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.logical_xor",
"numpy.linalg.norm",
"numpy.ones",
"numpy.identity",
"numpy.resize",
"numpy.radians",
"numpy.abs",
"numpy.append",
"numpy.diag"
]
] |
Saurabh2702/Machine-Learning-Grey-Atom | [
"7c129a90b4ed5ba2f02fd7164640028af1ddb99f"
] | [
"Working-On-Census-/code.py"
] | [
"# --------------\n# Importing header files\r\nimport numpy as np\r\n\r\n# Path of the file has been stored in variable called 'path'\r\n\r\n#New record\r\nnew_record=[[50, 9, 4, 1, 0, 0, 40, 0]]\r\n\r\n#Code starts here\r\ndata=np.genfromtxt(path,delimiter=\",\",skip_header=1)\r\nnew_record=np.array(new_reco... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.genfromtxt",
"numpy.mean",
"numpy.std"
]
] |
frankfanslc/qteasy | [
"76d23c4f5ca5ff7e76dfcb00263f1c7c302ffcb9"
] | [
"qteasy/visual.py"
] | [
"# coding=utf-8\n# -*- coding: utf-8 -*-\n# visual.py\n\n# =====================================4\n# This file contains components for the qt\n# to establish visual outputs of price data\n# loop result and strategy optimization\n# results as well\n# ======================================\n\nimport mplfinance as mpf... | [
[
"matplotlib.dates.DateFormatter",
"pandas.notna",
"numpy.where",
"pandas.Timedelta",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"matplotlib.ticker.PercentFormatter",
"numpy.arange",
"pandas.plotting.register_matplotlib_converters",
"pandas.to_datetime",
"numpy.ar... |
ananthsub/mmf | [
"c672d08880a0601857def5fdf9954eb96f04888d"
] | [
"mmf/datasets/multi_dataset_loader.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\nMultiDatasetLoader class is used by DatasetLoader class to load multiple datasets\nand more granular\n\"\"\"\nimport logging\nimport warnings\n\nimport numpy as np\nfrom mmf.utils.build import build_dataloader_and_sampler, build_dataset\nfrom mmf.utils.di... | [
[
"numpy.random.choice"
]
] |
veleritas/mychem.info | [
"bb22357d4cbbc3c4865da224bf998f2cbc59f8f2"
] | [
"src/hub/dataload/sources/umls/umls_main.py"
] | [
"from collections import defaultdict\n\nimport pandas as pd\n\nfrom parse_mesh import parse_file\nfrom parse_drugbank import map_dbids\n\ndef read_umls(fname):\n \"\"\"Read through MRCONSO.RRF and extract relevant info.\n\n Currently extracted information:\n 1. DrugBank ID\n 2. MeSH ID\n ... | [
[
"pandas.DataFrame"
]
] |
RandLive/Avito-Demand-Prediction-Challenge | [
"eb2955c6cb799907071d8bbf7b31b73b163c604f"
] | [
"yuki/avito/src/create_period_features.py"
] | [
"\n# coding: utf-8\n\n# In[1]:\n\n\nimport pandas as pd\nimport numpy as np\nimport gc\nfrom utils import *\n\n# In[3]:\n\n\ntrain_active = pd.read_csv(\"../input/train_active.csv\")\ntest_active = pd.read_csv(\"../input/test_active.csv\")\ntrain_periods = pd.read_csv(\"../input/periods_train.csv\", parse_dates=['d... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.merge",
"pandas.concat"
]
] |
jmcvey3/dolfyn | [
"5a30196b19356e7b161ec85c9b662a728c9b2cef"
] | [
"dolfyn/io/nortek2_defs.py"
] | [
"import numpy as np\nfrom copy import copy\nfrom struct import Struct\nfrom . import nortek2_lib as lib\n\ndt32 = 'float32'\ndt64 = 'float64'\n\ngrav = 9.81\n# The starting value for the checksum:\ncs0 = int('0xb58c', 0)\n\n\ndef _nans(*args, **kwargs):\n out = np.empty(*args, **kwargs)\n if out.dtype.kind ==... | [
[
"numpy.prod",
"numpy.empty",
"numpy.dtype",
"numpy.asarray"
]
] |
HarlanThomas/wave2vec | [
"958dace9862fb6a5a25048742a9b664d00509ff1"
] | [
"fairseq_cli/generate.py"
] | [
"#!/usr/bin/env python3 -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nTranslate pre-processed data with a trained model.\n\"\"\"\n\nimport ast\nimport logging\nimport ma... | [
[
"numpy.random.seed",
"torch.cuda.is_available"
]
] |
demixr/openunmix-torchscript | [
"e0ccb812b6a6e16151e54cb2101372f61eb12c60"
] | [
"openunmix_torchscript.py"
] | [
"import os\nimport torch\nimport torch.nn as nn\nimport torch.quantization\nfrom torch.utils.mobile_optimizer import optimize_for_mobile\n\nfrom openunmix import utils\nfrom openunmix import model\nfrom openunmix.model import OpenUnmix\n\ntarget_urls_umxhq = {\n \"bass\": \"https://zenodo.org/api/files/1c8f83c5-... | [
[
"torch.jit.script",
"torch.quantization.quantize_dynamic",
"torch.utils.mobile_optimizer.optimize_for_mobile",
"torch.hub.load_state_dict_from_url"
]
] |
zama-ai/concrete-numpy | [
"ca60d646f26bc26c4c398aeb2bb89c572b3e6d63"
] | [
"concrete/common/extensions/convolution.py"
] | [
"\"\"\"This file contains tracers for convolution operations.\"\"\"\n\nfrom typing import List, Optional, Tuple, Union, cast\n\nimport numpy as np\n\nfrom ...numpy.tracing import NPConstant, NPTracer\nfrom ..representation.intermediate import Conv2D\nfrom ..tracing.base_tracer import BaseTracer\n\nSUPPORTED_AUTO_PA... | [
[
"numpy.zeros"
]
] |
martinschorb/pybdv | [
"4c28b13ebc306f8dba77e7ec964cee485c9c4b6b",
"4c28b13ebc306f8dba77e7ec964cee485c9c4b6b"
] | [
"test/test_metadata.py",
"pybdv/converter.py"
] | [
"import os\nimport unittest\nfrom abc import ABC\nfrom shutil import rmtree\n\nimport numpy as np\nfrom pybdv import make_bdv\nfrom pybdv.util import n5_file\n\n\nclass MetadataTestMixin(ABC):\n tmp_folder = './tmp'\n xml_path = './tmp/test.xml'\n xml_path2 = './tmp/test2.xml'\n\n shape = (64,) * 3\n ... | [
[
"numpy.random.rand"
],
[
"numpy.array"
]
] |
edbeeching/3D_Control_RL_Scenario_Benchmarks | [
"71eacc61b4c2d69e8c08910dcf2283975cd2ef83"
] | [
"logger.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Feb 13 10:04:41 2018\n\n@author: anonymous\n\"\"\"\n\nimport os\nimport datetime\nimport numpy as np\nimport visdom\n\ndef running_average(data, window=7):\n \"\"\"\n Create running average of data\n\n \"\"\"\n alpha = 2 /(wind... | [
[
"numpy.array",
"numpy.arange"
]
] |
apardyl/ProtoPNet | [
"b2bbd7284bfc84a37385c0e975408c68cdf64205"
] | [
"datasets/colon_dataset.py"
] | [
"\"\"\"Pytorch Dataset object that loads 27x27 patches that contain single cells.\"\"\"\n\nimport os\nimport random\n\nimport numpy as np\nimport scipy.io\nimport torch\nimport torch.utils.data as data_utils\nimport torchvision.transforms as transforms\nfrom skimage import io, color\nfrom sklearn.model_selection im... | [
[
"numpy.concatenate",
"numpy.random.normal",
"torch.stack",
"numpy.asarray",
"numpy.random.RandomState",
"numpy.round",
"sklearn.model_selection.KFold",
"torch.LongTensor",
"numpy.arange",
"numpy.dstack"
]
] |
junj2ejj/sam-textvqa | [
"6bf646d741fb2536e3a8f331c78b594f6199df15",
"6bf646d741fb2536e3a8f331c78b594f6199df15"
] | [
"sam/task_utils.py",
"sam/textvqa_encoders.py"
] | [
"import logging\nfrom bisect import bisect\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom pytorch_transformers.tokenization_bert import BertTokenizer\nfrom torch.optim import Adam\nfrom torch.optim.lr_scheduler import LambdaLR\nfrom torch.utils.data import ConcatDataset, DataLoader, R... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.utils.data.ConcatDataset",
"torch.utils.data.RandomSampler",
"torch.max",
"torch.optim.Adam",
"torch.utils.data.DataLoader",
"torch.optim.lr_scheduler.LambdaLR",
"torch.Tensor",
"torch.sum"
],
[
"torch.nn.Li... |
0h-n0/donkeycar_pytorch | [
"ed19404ad274ff0228cfa290a8b9d318f8781aad"
] | [
"donkeycar/parts/datastore.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 4 12:32:53 2017\n\n@author: wroscoe\n\"\"\"\nimport os\nimport sys\nimport time\nimport json\nimport datetime\nimport random\nimport tarfile\n\nimport numpy as np\nimport pandas as pd\nfrom PIL import Image\n\nfrom donkeycar import util\n... | [
[
"numpy.array",
"numpy.dot",
"numpy.uint8",
"numpy.reshape",
"torch.FloatTensor",
"pandas.concat",
"numpy.dtype"
]
] |
ted80810/snakemake-tutorial-scratch | [
"124ebd729e6332333f7c07b80e71a4bcc85b7626"
] | [
"2_process/calc_doy_means.py"
] | [
"import pandas as pd\nimport os\n\ndef read_pred_csv(csv_path):\n df = pd.read_csv(csv_path,\n parse_dates = ['date'],\n infer_datetime_format = True)\n return df\n\ndef calc_doy_means(df, site_id, out_file=None):\n doy_means = df.groupby([df.date.dt.month, df.date.d... | [
[
"pandas.read_csv"
]
] |
bluebibi/trade | [
"32145c2a139f4172159ace8dfad11591ad8839ea"
] | [
"codes/predict/make_models.py"
] | [
"# https://github.com/pytorch/ignite/blob/master/examples/notebooks/FashionMNIST.ipynb\n# https://www.kaggle.com/stuarthallows/using-xgboost-with-scikit-learn\nimport time\nimport sys, os\n\nfrom sklearn.metrics import f1_score\n\nidx = os.getcwd().index(\"trade\")\nPROJECT_HOME = os.getcwd()[:idx] + \"trade\"\nsys... | [
[
"numpy.concatenate",
"sklearn.model_selection.StratifiedKFold",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.average",
"matplotlib.pyplot.clf",
"numpy.linspace",
"s... |
ignc-research/FailureDetection | [
"8d28c8ef21858cecb7e2a2d29c3b95cc06ac89e3"
] | [
"others/codes/tp_batch_predict.py"
] | [
"# this script modified from built-in predict.py script\n# # original codes refer to fasterRCNN/predict.py\nimport argparse\nimport itertools\nimport os\nimport os.path\nimport shutil\nimport socket\nimport subprocess # for calling shell script\nimport sys\nimport tempfile\nimport time\n\nimport cv2\nimport numpy ... | [
[
"numpy.concatenate"
]
] |
YuanYunshuang/OpenCOOD | [
"98e07eb45f7fdcd32518b2cf8f9052f73ca80bec"
] | [
"opencood/data_utils/pre_processor/bev_preprocessor.py"
] | [
"# -*- coding: utf-8 -*-\n# Author: Hao Xiang <haxiang@g.ucla.edu>\n# License: TDG-Attribution-NonCommercial-NoDistrib\n\n\n\"\"\"\nConvert lidar to bev\n\"\"\"\n\nimport numpy as np\nimport torch\nfrom opencood.data_utils.pre_processor.base_preprocessor import \\\n BasePreprocessor\n\n\nclass BevPreprocessor(Ba... | [
[
"numpy.divide",
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.transpose"
]
] |
endsley/sklearn_example | [
"cc16219c6ca1314106f8eb991479329b4fac532c"
] | [
"get_k_nearest_samples.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nfrom sklearn.neighbors import NearestNeighbors\nfrom sklearn.metrics.pairwise import euclidean_distances\n# Return the id of k nearest sample points\n\n\nsamples = [[0, 0, 2], [1, 0, 1], [0, 0, 1], [1,1,1]]\n\nneigh = NearestNeighbors(2, 0.4)\nneigh.fit(samples)\n[dista... | [
[
"numpy.array",
"sklearn.neighbors.NearestNeighbors"
]
] |
dartkub/optimal-ph | [
"837dda4167641840262d079fd6e5d197eb92f693"
] | [
"src/predict.py"
] | [
"import argparse\nimport pandas as pd\nfrom model import KillerKMer\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--input_csv', default='input.csv')\nargs = parser.parse_args()\n\n# Config\noutput_file_path = 'predictions.csv'\n\n# Load input.csv\nwith open(args.input_csv) as input_csv:\n df = pd.r... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
takaaki82/chainer | [
"ce2d5511d4d6b2089fbe19a0d764ee27817873aa"
] | [
"chainer/functions/connection/convolution_nd.py"
] | [
"import numpy\nfrom six import moves\n\nimport chainer\nfrom chainer import backend\nfrom chainer.backends import cuda\nfrom chainer import configuration\nfrom chainer import function_node\nfrom chainer.functions.connection import convolution_2d\nfrom chainer.utils import conv\nfrom chainer.utils import conv_nd\nfr... | [
[
"numpy.ascontiguousarray"
]
] |
jopo666/vision | [
"48ebc0bbdb12089eca557d52a8db7b0674b23486"
] | [
"references/classification/train.py"
] | [
"import datetime\nimport os\nimport time\nimport warnings\n\nimport presets\nimport torch\nimport torch.utils.data\nimport torchvision\nimport transforms\nimport utils\nfrom torch import nn\nfrom torch.utils.data.dataloader import default_collate\nfrom torchvision.transforms.functional import InterpolationMode\n\n\... | [
[
"torch.optim.lr_scheduler.SequentialLR",
"torch.optim.AdamW",
"torch.utils.data.RandomSampler",
"torch.optim.lr_scheduler.StepLR",
"torch.cuda.amp.autocast",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.optim.lr_scheduler.ExponentialLR",
"torch.load",
"torch.nn.CrossEnt... |
taylorguo/OpenCV_Yolo_Production | [
"c28ad8a270ff7e93cdc59154e71e912c66de1d5a"
] | [
"container/yolo.py"
] | [
"\n\n# import necessary packages\nimport os, time, cv2, csv, json, base64\nimport numpy as np\nfrom imutils import paths\n\n# directory name of current file\ncurrent_path = os.path.dirname(os.path.realpath(__file__))\n\n# path to YOLO weights & model configuration\nweights_path = os.path.sep.join([current_path, \"m... | [
[
"numpy.random.seed",
"numpy.array",
"numpy.argmax"
]
] |
barisgecer/fsgan | [
"962398f7283eedf628d53b544625b3254e605e6f"
] | [
"inference/swap.py"
] | [
"\"\"\" Face swapping inference pipeline.\n\nThis script implements face swapping for both images and videos using an appearance map for the source subject.\nThe main pipeline components are: face reenactment and segmentation, inpainting, and blending.\n\nInformation about both source and target files will be extra... | [
[
"torch.cat",
"torch.utils.data.RandomSampler",
"torch.load",
"torch.nn.DataParallel",
"numpy.concatenate",
"matplotlib.pyplot.tight_layout",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.gca",
"numpy.array",
"numpy.round",
"torch.save",
"matplotlib.pyplot.figure... |
tholiao/sockeye | [
"f33b600dc77ae9f295c05015e2af9045f3a74088"
] | [
"sockeye/evaluate.py"
] | [
"# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You may not\n# use this file except in compliance with the License. A copy of the License\n# is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"l... | [
[
"numpy.std",
"numpy.mean"
]
] |
aidangomez/bittensor | [
"6ed4bbbb95866a27e819b3c6172702b17da5acf0"
] | [
"examples/ffnn_grunt.py"
] | [
"\"\"\"FFNN Grunt node\n\nThis fil demonstrates how to train a FeedForward Neural network on the network\nwithout a training ste.\n\nExample:\n $ python examples/ffnn_grunt.py\n\n\"\"\"\nimport argparse\nimport math\nimport os\nimport pathlib\nimport time\nimport torch\nimport torch.nn.functional as F\n\nfro... | [
[
"torch.isnan",
"torch.cuda.is_available",
"torch.zeros_like",
"torch.utils.tensorboard.SummaryWriter",
"torch.sum"
]
] |
tobegit3hub/deep_cnn | [
"7731cb02b2378d5f69684acb40c985f7b2432f58"
] | [
"java_predict_client/src/main/proto/tensorflow/python/training/moving_averages_test.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.control_dependencies",
"tensorflow.trainable_variables",
"tensorflow.python.ops.gen_state_ops._variable",
"tensorflow.Variable",
"tensorflow.constant",
"tensorflow.variable_scope",
"tensorflow.device",
"tensorflow.placeholder",
"tensorflow.python.training.moving_ave... |
navedrizvi/bdh-project | [
"c5107d5769aa2e53449fb1261184039d655b2f36"
] | [
"naved-workspace/preprocessing-wip-1.py"
] | [
"'''\nDerived from preprocessing-py.py to run in Spark for parallelism\n'''\nimport os\nfrom typing import Dict, List, NamedTuple, Set, Tuple, Union\nimport re\nimport json\nimport datetime as dt\nfrom collections import Counter\n\nimport pandas as pd\n# from sklearn.model_selection import train_test_split\n# from ... | [
[
"pandas.SparseDtype",
"pandas.DataFrame.sparse.from_spmatrix"
]
] |
pedrocamargo/spopt | [
"21fca2166001b774f8dfb75b0ce33c522f9ead67"
] | [
"spopt/region/azp.py"
] | [
"# Openshaw, S. and Rao, L. (1995). Algorithms for reengineering 1991 census geography. Environment and Planning A, 27(3):425-446.\n\nfrom ..BaseClass import BaseSpOptHeuristicSolver\nimport abc\nfrom collections import deque\nimport math\nimport random\n\nimport numpy as np\nimport networkx as nx\n\nfrom spopt.reg... | [
[
"numpy.where",
"numpy.array",
"numpy.ones",
"numpy.unique"
]
] |
calvinkuo/image-utils | [
"a284ea19be815f07ec7094cd57f505fb7c091a7a"
] | [
"modes.py"
] | [
"\"\"\"Determine a common mode that can support multiple images.\"\"\"\n\nimport warnings\n\nfrom PIL import Image\nimport numpy as np\n\n\nSUPPORTED_MODES: dict[str, set[str]] = {\n '1': {'1'},\n 'L': {'1', 'L'},\n 'LA': {'1', 'L', 'LA'},\n 'P': set(),\n 'RGB': {'1', 'L', 'P', 'RGB'},\n 'PA': set... | [
[
"numpy.any",
"numpy.broadcast_to",
"numpy.asarray"
]
] |
Gkdnz/SfePy | [
"a3a39d4e087705e9e0e8884cbf63513a2ded2108",
"a3a39d4e087705e9e0e8884cbf63513a2ded2108",
"a3a39d4e087705e9e0e8884cbf63513a2ded2108"
] | [
"sfepy/base/mem_usage.py",
"tests/test_linalg.py",
"tests/test_mesh_expand.py"
] | [
"\"\"\"\nMemory usage functions.\n\"\"\"\nimport sys\nimport collections\n\nimport numpy as nm\nimport scipy.sparse as sp\n\nfrom sfepy.base.base import basestr, Struct, Output\n\ndef get_mem_usage(obj, usage=None, name=None, traversal_order=None, level=0):\n \"\"\"\n Get lower bound of memory usage of an obj... | [
[
"numpy.argsort"
],
[
"numpy.allclose",
"numpy.dot",
"numpy.arange"
],
[
"numpy.linalg.norm"
]
] |
yuxinyuan/accelerate | [
"450d51ce0191020408bd3481bde85fe1dabaf289"
] | [
"src/accelerate/data_loader.py"
] | [
"# Copyright 2021 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"torch.utils.data.graph_settings.apply_shuffle_settings",
"torch.Generator",
"torch.empty"
]
] |
bserranoanton/Machine-learning | [
"093f77a9317c68649c5b0aad32b9e53170700a11",
"093f77a9317c68649c5b0aad32b9e53170700a11"
] | [
"LeastSquaredAB/generarAB.py",
"kmeans/kmeans.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Feb 18 18:08:59 2019\r\n\r\n@author: MRS\r\n\"\"\"\r\n\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nN = 20\r\nN0, N1 = 10, 10\r\n\r\n\r\nmu0 = np.array([10, 0])\r\nX0 = np.random.randn(2, N0) + mu0[:, np.newaxis]\r\n\r\nmu1 = np.array([-10,... | [
[
"numpy.array",
"numpy.random.randn"
],
[
"numpy.random.rand",
"numpy.array_equal",
"numpy.argmin",
"numpy.sum",
"numpy.hstack",
"numpy.random.randn",
"numpy.random.shuffle",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"matplotlib.pyplot.scatter",
"ma... |
XMUNLP/Tagger | [
"02e1fd323ac747bfe5f7b8824c6b416fd90f33a1"
] | [
"tagger/optimizers/optimizers.py"
] | [
"# coding=utf-8\n# Copyright 2017-2019 The THUMT Authors\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport math\nimport torch\nimport torch.distributed as dist\nimport tagger.utils as utils\nimport tagger.utils.summary as summary\n\nfrom tagg... | [
[
"torch.zeros",
"torch.distributed.get_world_size",
"torch.nn.utils.vector_to_parameters",
"torch.nn.utils.parameters_to_vector",
"torch.isfinite",
"torch.distributed.all_reduce",
"torch.zeros_like"
]
] |
Patdue/atmt | [
"cc53e222186a00821f0f54a1e28a984904309960"
] | [
"seq2seq/beam.py"
] | [
"import torch\n\nfrom itertools import count\nfrom queue import PriorityQueue\n\n\nclass BeamSearch(object):\n \"\"\" Defines a beam search object for a single input sentence. \"\"\"\n def __init__(self, beam_size, max_len, pad):\n\n self.beam_size = beam_size\n self.max_len = max_len\n s... | [
[
"torch.tensor"
]
] |
rjgpinel/rlbc | [
"55a7499e4ad10182d9a84ce3c2494231db6fd3b5"
] | [
"sim2real/convert_dataset.py"
] | [
"import click\nimport os\nimport numpy as np\nimport pickle as pkl\nfrom tqdm import tqdm\nfrom PIL import Image\n\nfrom bc.dataset import DatasetWriter, Scalars\nfrom bc.dataset import utils\n\nCROP = (34, None, 22, -100)\nIMG_SIZE = (240, 240)\nNEAR, FAR = 0.5, 2.0\n\ndef get_frames_scalars(obs, counter):\n fr... | [
[
"numpy.isnan",
"numpy.asarray"
]
] |
edwinv87/singlecelldata | [
"37c1b0f82e3cde3abb861c235cea9c786a08b9bd"
] | [
"singlecelldata/read_data.py"
] | [
"import pandas as pd\nimport numpy as np\n\n# import gzip\nimport os.path\n# import scipy.sparse\nfrom scipy.sparse import csr_matrix\n\n\n\ndef ReadCSV(path, dset_name):\n\n data_path = path + dset_name + '/' + dset_name + \"_data.csv\"\n celldata_path = path + dset_name + '/' + dset_name + \"_celldata.csv\"... | [
[
"numpy.array",
"pandas.read_csv",
"scipy.sparse.csr_matrix"
]
] |
cwyd0822/cifar10-tensorflow-read-write | [
"cb2291bae459f877274c746cacd8272eac875a12"
] | [
"convert_cifar10_image.py"
] | [
"\"\"\"\n本脚本对cifar10数据进行解析,转换成图片,生成训练图片和测试图片。\n\"\"\"\n\nimport urllib.request\nimport os\nimport sys\nimport tarfile\nimport glob\nimport pickle\nimport numpy as np\nimport cv2\n\n\n# 通过这个函数完成对数据集的下载和解压\n# tarball_url 表示cifar10数据集的下载链接\n# dataset_dir 表示存储的路径\n\n# 执行下面的代码可以完成数据集的下载和解压\n# DATA_URL = 'http://www.cs.t... | [
[
"numpy.transpose",
"numpy.reshape"
]
] |
yanxiao6/SelfChecker- | [
"564b3e4995bbab7779adeffec49339596345eea2"
] | [
"layer_selection_condition_neg.py"
] | [
"import json\nimport numpy as np\nimport itertools\nimport sys\n\npath_name = \"cifar10/conv\"\npred_labels = np.load(\"./tmp/\" + path_name + \"/pred_labels_valid.npy\")\n\nnum_classes = 10\nnum_layers = 9\ntotal_layers = [x for x in range(num_layers)]\n\n\ndef calculate_accuracy(layers, pred_label_idx):\n kde_... | [
[
"numpy.zeros",
"numpy.sum",
"numpy.load",
"numpy.mean",
"numpy.where",
"numpy.argmax"
]
] |
gnomonsis/deep-object-reid | [
"1d7be0991a99d884584ef41dea502790a725f9e0"
] | [
"scripts/main.py"
] | [
"import sys\nimport time\nimport os.path as osp\nimport argparse\nimport torch\nimport torch.nn as nn\n\nimport torchreid\nfrom torchreid.engine import build_engine\nfrom torchreid.utils import (\n Logger, check_isfile, set_random_seed, collect_env_info,\n resume_from_checkpoint, load_pretrained_weights, comp... | [
[
"torch.cuda.is_available",
"torch.load",
"torch.nn.DataParallel"
]
] |
CarlGriffinsteed/UVM-ME144-Heat-Transfer | [
"9c477449d6ba5d6a9ee7c57f1c0ed4aab0ce4cca"
] | [
"Snow-Cooling/Libraries/HT_conduction_extended_surfaces.py"
] | [
"\"\"\"Object: ExtSurfaces\"\"\"\nfrom sympy.interactive import printing\nprinting.init_printing(use_latex='mathjax')\n\n\nfrom IPython.display import display,Image, Latex\nimport numpy as np\nimport math\nimport scipy.constants as sc\n\nimport sympy as sym\n#from sympy import *\n\nclass ExtSurfaces(object):\n \... | [
[
"numpy.cosh",
"numpy.exp",
"numpy.tanh",
"numpy.sinh",
"numpy.sqrt"
]
] |
SansCipher/PrisonersDilemmaTournament | [
"af8e7f93807b342093827dddf781a29b0674a960"
] | [
"code/prisonersDilemma.py"
] | [
"import multiprocessing\r\nimport os\r\nimport itertools\r\nimport importlib\r\nimport time\r\n\r\nimport cache as cachelib\r\n\r\nimport numpy as np\r\nimport random\r\nfrom multiprocessing import Pool, cpu_count\r\nfrom io import StringIO\r\nimport statistics\r\nimport argparse\r\nimport sys\r\nimport json\r\n\r\... | [
[
"numpy.argsort",
"numpy.zeros"
]
] |
florianmai/SentEval | [
"ed2cc8d6eb41c8b7c2bd71c3dd9afb340f923e66"
] | [
"senteval/tools/ranking_validation.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\n\"\"\"\nValidation and classification\n(train) : inner-kfold classifier\n(train, test) : kfold cl... | [
[
"numpy.max",
"sklearn.model_selection.StratifiedKFold",
"numpy.mean",
"sklearn.linear_model.LogisticRegression",
"numpy.argmax"
]
] |
SEStarkman/OddsPredictor | [
"31bb3c360204cff5f31de3a419e3b505adf5569f"
] | [
"first_basket.py"
] | [
"from numpy import NaN\nimport requests\nfrom bs4 import BeautifulSoup as bs\nimport pandas as pd\nimport datetime\nimport re\n\n\ndef get_game_ids_by_date_range(sdate, edate):\n game_id_urls = []\n gameid_date = []\n date_list = []\n delta = convert_date(edate) - convert_date(sdate)\n\n for i in ran... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
ultinous-zssanta/automl | [
"b4cd80b396836aada750aef47c2287bfe1ac4105"
] | [
"efficientdet/utils_test.py"
] | [
"# Copyright 2020 Google Research. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by... | [
[
"tensorflow.compat.v1.cast",
"tensorflow.compat.v1.sigmoid",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.compat.v1.train.Saver",
"tensorflow.compat.v1.keras.layers.Conv2D",
"tensorflow.compat.v1.global_variables",
"tensorflow.compat.v1.Variable",
"tensorflow.co... |
NicolasMakaroff/Facial-keypoint-detection-via-webcam | [
"0335eaeadcdd9021cda2e324cf1a6c49e5c88942"
] | [
"data_gestion.py"
] | [
"import glob\nimport os\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nimport numpy as np\nimport matplotlib.image as mpimg\nimport pandas as pd\nimport cv2\n\n\nclass ImageDataset(Dataset):\n \"\"\"This class creates a dataset compatible with the dataloader provided by PyTorch.\"\"\"\n\n de... | [
[
"numpy.copy",
"matplotlib.image.imread",
"torch.from_numpy",
"numpy.random.randint",
"pandas.read_csv"
]
] |
usb-radiology/NiftyNet | [
"1815041fde3ccdd822c34eb83344cc36f4b308ee",
"1815041fde3ccdd822c34eb83344cc36f4b308ee"
] | [
"tests/image_window_test.py",
"tests/affine_augmentation_test.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function\n\nimport tensorflow as tf\n\nfrom niftynet.engine.image_window import ImageWindow\nfrom niftynet.utilities.util_common import ParserNamespace\n\n\ndef get_static_window_param():\n return dict(\n source_names={\n '... | [
[
"tensorflow.test.main"
],
[
"numpy.abs",
"numpy.prod",
"tensorflow.test.main",
"tensorflow.reshape"
]
] |
maxpark/albumentations | [
"880c1aaed10ab74cfe851496a476c1c34cadcd0f"
] | [
"albumentations/augmentations/geometric/transforms.py"
] | [
"import random\nfrom typing import Dict, Optional, Sequence, Tuple, Union\n\nimport cv2\nimport numpy as np\nimport skimage.transform\n\nfrom ... import random_utils\nfrom ...core.transforms_interface import DualTransform, to_tuple\nfrom . import functional as F\n\n__all__ = [\"ShiftScaleRotate\", \"ElasticTransfor... | [
[
"numpy.deg2rad",
"numpy.array",
"numpy.ceil",
"numpy.dstack",
"numpy.random.RandomState",
"numpy.copy",
"numpy.any",
"numpy.abs",
"numpy.clip",
"numpy.sqrt",
"numpy.around",
"numpy.linspace",
"numpy.meshgrid"
]
] |
aritraroy24/Learning_NumPy_SciPy | [
"cd33fbcb7dee11547b7c6e30692866373fb0ea5b"
] | [
"Matplotlib/Part 6/Part6.py"
] | [
"import pandas as pd\nfrom matplotlib import pyplot as plt\n\nplt.style.use('fivethirtyeight')\n\ndata = pd.read_csv('data.csv')\nids = data['Responder_id']\nages = data['Age']\n\nbins = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]\nplt.hist(ages, bins=bins, edgecolor=\"black\", log=True)\n\nmedian_age = 29\ncolor = '... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.axvline",
"pandas.read_csv"... |
roopchansinghv/afni-real-time-interface-in-python | [
"c3ea0c140e2195a7d1881a42fa63aa5f6e535a34"
] | [
"expt-afni-class-demo-06.py"
] | [
"#!/usr/bin/env python\n\n# This is a reimplementation of the default real-time feedback experiment\n# distributed with AFNI, implemented in realtime_receiver.py, using WX and\n# Matplotlib for generating the GUI and plotting the results.\n#\n# This replaces the default GUI toolkit with PsychoPy, and will draw the\... | [
[
"numpy.array"
]
] |
souissim/gridpath | [
"4eeca2be24b485edc56026e38cfda83f4a6b27ea"
] | [
"gridpath/project/capacity/capacity_groups.py"
] | [
"# Copyright 2016-2020 Blue Marble Analytics LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"pandas.read_csv"
]
] |
xiaoyizy/TagSpace-pytorch | [
"6f9aa69fe181e690eb769cb386ff388722a1ad3f"
] | [
"model.py"
] | [
"import random\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nclass TagSpace(nn.Module):\n\tdef __init__(self, batch_size=32, embedding_dim=64, \n\t\t\t\t vocab_size=10**5, max_seq_length=20, \n\t\t\t\t margin=0.1, max_iter=1000, \n\t\t\t\t window_size=5, hidden_size=1000):... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Conv1d",
"torch.ones",
"torch.unsqueeze",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.nn.MaxPool1d",
"torch.nn.Embedding",
"torch.dot"
]
] |
VanillaChelle/Faster-RCNN_TF | [
"f45ffce9d4e041b84ffe4fbea10c9f52c35a6918"
] | [
"lib/utils/boxes_grid.py"
] | [
"# --------------------------------------------------------\r\n# Subcategory CNN\r\n# Copyright (c) 2015 CVGL Stanford\r\n# Licensed under The MIT License [see LICENSE for details]\r\n# Written by Yu Xiang\r\n# --------------------------------------------------------\r\n\r\nimport numpy as np\r\nimport math\r\nfrom... | [
[
"numpy.repeat",
"numpy.reshape",
"numpy.zeros",
"numpy.tile",
"numpy.arange",
"numpy.dstack",
"numpy.hstack",
"numpy.meshgrid",
"numpy.floor"
]
] |
MartinBuessemeyer/Efficient-Image-Super-Resolution | [
"3a9fb314fecc51d1028bbf1e6b571922b19175d3"
] | [
"src/utility.py"
] | [
"import datetime\nimport os\nimport time\nfrom bisect import bisect_right\nfrom multiprocessing import Process, Queue\n\nimport imageio\nimport math\nimport pandas as pd\nimport torch\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lrs\n\n\nclass timer():\n def __init__(self):\n self.acc ... | [
[
"pandas.DataFrame",
"torch.cat",
"torch.Tensor"
]
] |
ArvinZJC/UofG_PGT_IDSS | [
"1a1263dc1407387c2c23c2ad514d307312158026"
] | [
"Self-Study/jhwutils/history.py"
] | [
"import numpy as np\nclass History:\n def __init__(self):\n self.all_theta = []\n self.all_loss = []\n self.best_thetas = []\n self.best_losses = []\n self.all_best = []\n self.best = np.inf\n self.best_theta = None\n self.loss_trace = []\n self.iter... | [
[
"numpy.array"
]
] |
michaelbrownid/VariantWorks | [
"e9952f6272eab3b6d4d1317df027ed5f26855ef8"
] | [
"samples/simple_consensus_caller/pileup_hdf5_generator.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n#\n# Copyright 2020 NVIDIA CORPORATION.\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... | [
[
"numpy.array",
"numpy.stack",
"numpy.string_"
]
] |
Mozartuss/DEAP_EmotionRecognition_V2 | [
"39bd50f327d465114ee0f798ac7bcee13b457b17"
] | [
"FeatureExtraction/CS_helper.py"
] | [
"# [2009]-\"Cuckoo search via Levy flights\"\r\n\r\nimport numpy as np\r\nfrom numpy.random import rand\r\nimport math\r\n\r\nfrom sklearn.svm import SVC\r\n\r\n\r\ndef error_rate(x, opts):\r\n # parameters\r\n fold = opts['fold']\r\n xt = fold['xt']\r\n yt = fold['yt']\r\n xv = fold['xv']\r\n yv ... | [
[
"numpy.sin",
"numpy.random.rand",
"numpy.zeros",
"numpy.sum",
"numpy.random.permutation",
"numpy.ones",
"numpy.random.randn",
"sklearn.svm.SVC",
"numpy.size"
]
] |
CobraPython/bot_covidbolivia | [
"8bc7c4d5f105dfd37aa1953100c3bcfa0f92ff91"
] | [
"generador/ratevacnac.py"
] | [
"import os,sys\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n_n=115.131 # factor de correción para llevar a 10^4 hab\n\n#datos vacunacion\ndf1=pd.read_csv('vacunas/datos/primera.csv',sep=',').sort_values(by='fecha').set_index('fecha').fillna(0)\ndf2=pd.read_csv('vacunas/datos/segunda.... | [
[
"numpy.max",
"matplotlib.font_manager.FontProperties",
"numpy.array",
"matplotlib.pyplot.savefig",
"matplotlib.image.imread",
"matplotlib.offsetbox.OffsetImage",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yticks",
... |
DoranLyong/deep-learning-from-scratch-3 | [
"4f49b6bed475ba97ff21c4397285f08ec3aa1c56"
] | [
"steps/step26.py"
] | [
"'''\nNeed the dot binary from the graphviz package (www.graphviz.org).\n'''\nif '__file__' in globals():\n import os, sys\n sys.path.append(os.path.join(os.path.dirname(__file__), '..'))\nimport numpy as np\nfrom dezero import Variable\nfrom dezero.utils import plot_dot_graph\n\n\ndef goldstein(x, y):\n z... | [
[
"numpy.array"
]
] |
BOBO-LU/covid-19-visualization | [
"ca8db552c06b2c7e365d86c7bc085c29a7d09371"
] | [
"data_visualize_examples/ex_markevery_prop_cycle.py"
] | [
"\"\"\"\n=========================================\nprop_cycle property markevery in rcParams\n=========================================\n\nThis example demonstrates a working solution to issue #8576, providing full\nsupport of the markevery property for axes.prop_cycle assignments through\nrcParams. Makes use of t... | [
[
"numpy.sin",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
michelgado/artxc_quicklook | [
"49e23550c16414ef063a92e238b7005a042c62b8"
] | [
"arttools/atthist.py"
] | [
"from .time import make_ingti_times, deadtime_correction, GTI, tGTI\nfrom .orientation import quat_to_pol_and_roll, pol_to_vec, \\\n vec_to_pol, get_wcs_roll_for_qval, align_with_z_quat, minimize_norm_to_survey\nfrom .caldb import ARTQUATS\nfrom ._det_spatial import DL, offset_to_vec, vec_to_offset_pairs, vec_to... | [
[
"scipy.ndimage.convolve",
"numpy.arccos",
"numpy.minimum",
"numpy.tile",
"numpy.mean",
"numpy.cos",
"numpy.concatenate",
"numpy.sin",
"numpy.empty",
"scipy.ndimage.rotate",
"numpy.arange",
"numpy.array",
"numpy.zeros",
"numpy.roll",
"numpy.all",
"sci... |
jjjump-tutu/pakdd180 | [
"60d6142910a70a0e2868d2566899379c1a307bd6"
] | [
"train.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Mar 14 23:52:16 2019\r\n\r\n@author: Winham\r\n\r\n网络训练\r\n\"\"\"\r\n\r\nimport os\r\nimport numpy as np\r\nfrom Config import Config\r\nimport net\r\nfrom keras.utils import to_categorical\r\nfrom keras.callbacks import ModelCheckpoint, LearningRateScheduler\r\n... | [
[
"tensorflow.keras.callbacks.TensorBoard"
]
] |
dmadisetti/e3nn | [
"224ac5a4a4911626a7a04cf408d3f1872e5ff239"
] | [
"e3nn/o3/_tensor_product/_tensor_product.py"
] | [
"import warnings\nfrom math import sqrt\nfrom typing import Iterator, List, Optional, Union, Any\n\nimport e3nn\nimport torch\nimport torch.fx\nfrom e3nn import o3\nfrom e3nn.util import prod\nfrom e3nn.util.codegen import CodeGenMixin\nfrom e3nn.util.jit import compile_mode\nfrom torch import fx\nfrom ._codegen im... | [
[
"torch.zeros",
"matplotlib.path.Path",
"torch.cat",
"numpy.sin",
"numpy.asarray",
"matplotlib.cm.get_cmap",
"matplotlib.patches.PathPatch",
"numpy.sum",
"torch.no_grad",
"torch.ones",
"torch.fx.Graph",
"torch.jit.is_scripting",
"torch.nn.Module",
"numpy.cos"... |
AlessandraBotto/ruler | [
"57112a414165a92ae56d145ee9f6a301c32e0765",
"57112a414165a92ae56d145ee9f6a301c32e0765"
] | [
"server/verifier/keraslogreg.py",
"server/tests/test_api.py"
] | [
"\"\"\"END MODEL\nTo better evaluate the quality of our generated training data, \nwe evaluate an end model trained on this data. \n\nHere, the end model is implemented as a logistic regression bag of words model. \nHowever, you can replace this with any model of your choosing, as long as it has\nfunctions \"fit\" ... | [
[
"tensorflow.random.set_seed",
"numpy.random.seed",
"tensorflow.keras.Sequential",
"sklearn.feature_extraction.text.CountVectorizer",
"tensorflow.keras.regularizers.l2",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.callbacks.EarlyStopping"
],
[
"pandas.DataFrame"
]
] |
empymod/emg3d | [
"a4ea65eb97cb05860cf1e3f508ee55cb2de18443",
"e3aba4274424ae61094234946425240883aa2b91"
] | [
"emg3d/maps.py",
"tests/test_maps.py"
] | [
"\"\"\"\nMapping routines to map to and from linear conductivities (what is used\ninternally) to other representations such as resistivities or logarithms\nthereof.\n\nInterpolation routines mapping values between different grids.\n\"\"\"\n# Copyright 2018-2022 The emsig community.\n#\n# This file is part of emg3d.... | [
[
"numpy.concatenate",
"numpy.empty",
"scipy.interpolate.interpnd._ndim_coords_from_arrays",
"numpy.zeros",
"numpy.log",
"numpy.broadcast_arrays",
"scipy.ndimage.map_coordinates",
"numpy.exp",
"numpy.log10",
"scipy.interpolate.RegularGridInterpolator"
],
[
"numpy.test... |
risicle/clickhouse-driver | [
"d36569f52d3e62ad2e275b1d63ad79b75a06402d"
] | [
"tests/numpy/columns/test_string.py"
] | [
"try:\n import numpy as np\nexcept ImportError:\n np = None\n\nfrom tests.numpy.testcase import NumpyBaseTestCase\n\n\nclass StringTestCase(NumpyBaseTestCase):\n def test_string(self):\n with self.create_table('a String'):\n data = [np.array(['a', 'b', 'c'])]\n self.client.exec... | [
[
"numpy.array"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.