repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
mahmed13/NFL | [
"3b8331f9e3f18f1e3b6fc1c341f5c209046dc145"
] | [
"format_inj_data.py"
] | [
"import pandas as pd\nimport numpy as np\nimport datetime\n\n# Read in injury data set\ninjuries = pd.read_csv(\"injuries.csv\")\ninjuries.drop('Unnamed: 0', axis=1, inplace = True)\ninjuries.rename(columns={'Played':'played_inj'}, inplace=True)\n\n# Drop healthy rows\ninj_no_healthy = injuries.loc[~ (injuries.Inju... | [
[
"pandas.isnull",
"pandas.to_datetime",
"numpy.array",
"pandas.read_csv",
"pandas.get_dummies"
]
] |
elahesadatnaghib/FB-Scheduler-v2 | [
"6cd01df0ff1e67057a5425a4473f3220f73bbd62"
] | [
"UpdateDB.py"
] | [
"__author__ = 'Elahe'\n\n\nimport sqlite3 as lite\nimport numpy as np\nimport ephem\nimport pandas as pd\n\ndef update(Schedule):\n\n con = lite.connect('FBDE.db')\n cur = con.cursor()\n\n #TODO avoid overwrite\n t_start = Schedule[0]['ephemDate']\n t_end = Schedule[-1]['ephemDate']\n\n N_visits... | [
[
"numpy.average",
"numpy.count_nonzero",
"numpy.unique"
]
] |
bmhila/hw5 | [
"2306eb8f949942177fcaa1d81f1df2e0a87ec037"
] | [
"test_qs.py"
] | [
"import pathlib\nimport traceback\nimport pytest\nimport pandas as pd\n\nfrom hw5 import *\n\n\ndef test_valid_input():\n fname = pathlib.Path(__file__)\n q = QuestionnaireAnalysis(fname)\n assert fname == q.data_fname\n\n\ndef test_str_input():\n q = QuestionnaireAnalysis(__file__)\n assert pathlib.... | [
[
"pandas.read_csv"
]
] |
vahini01/electoral_rolls | [
"82e42a6ee68844b1c8ac7899e8e7bf7a24e48d44"
] | [
"uttarakhand_archives/uttarakhand_archives.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport time\n\nimport requests\nimport pandas as pd\nfrom tqdm import tqdm\nfrom bs4 import BeautifulSoup\n\n\nMAX_RETRY = 5\nPDF_PATH = 'uttarakhand_{:d}'\n\nlinks = {2007: 'http://election.uk.gov.in/pdf_roll/01012007/Uttranchal_pdf_page.htm',\n ... | [
[
"pandas.DataFrame"
]
] |
ibraheem-moosa/networkx | [
"fe8ac9f2d9c66e0337e11688078fdaccc90052cd"
] | [
"networkx/algorithms/shortest_paths/dense.py"
] | [
"\"\"\"Floyd-Warshall algorithm for shortest paths.\n\"\"\"\nimport networkx as nx\n\n__all__ = [\n \"floyd_warshall\",\n \"floyd_warshall_predecessor_and_distance\",\n \"reconstruct_path\",\n \"floyd_warshall_numpy\",\n]\n\n\ndef floyd_warshall_numpy(G, nodelist=None, weight=\"weight\"):\n \"\"\"Fin... | [
[
"numpy.identity",
"numpy.minimum"
]
] |
AlecThomson/RM-Tools | [
"c9107f12f46583f07ee6950f92a9ef0111dbd938",
"c9107f12f46583f07ee6950f92a9ef0111dbd938"
] | [
"RMutils/util_plotTk.py",
"RMtools_3D/do_RMsynth_3D.py"
] | [
"#!/usr/bin/env python\n#=============================================================================#\n# #\n# NAME: util_plotTk.py #\n# ... | [
[
"numpy.ones_like",
"numpy.exp",
"matplotlib.backends.backend_tkagg.NavigationToolbar2Tk.__init__",
"numpy.where",
"numpy.sign",
"numpy.sort",
"numpy.cumsum",
"numpy.imag",
"numpy.concatenate",
"numpy.zeros_like",
"matplotlib.ticker.MaxNLocator",
"numpy.log",
"nu... |
gtauzin/gudhi-devel | [
"d7f8038ac312c96b9331786f54802b0191fdee45"
] | [
"src/python/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py"
] | [
"#!/usr/bin/env python\n\nimport argparse\nimport matplotlib.pyplot as plot\nimport gudhi\n\n\"\"\" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.\n See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.\n Author(s): Vincent... | [
[
"matplotlib.pyplot.show"
]
] |
mtholyoke/devas-import | [
"7e100b71475d4971c6825b5449f7e270ff242659"
] | [
"process_raman_files.py"
] | [
"from __future__ import print_function\nimport numpy as np\nfrom collections import defaultdict\nfrom openpyxl import load_workbook\nfrom os.path import basename\nfrom time import time\n\nfrom importer import _TrajImporter\n\n\nclass RamanImporter(_TrajImporter):\n driver = None\n file_ext = '.txt'\n pkey_... | [
[
"numpy.array",
"numpy.genfromtxt"
]
] |
jundeli/Scaled-YOLOv4-tensorflow2 | [
"dd2ce523258f9a5b851bd6f391a6c07a4999662e"
] | [
"model/spp.py"
] | [
"\nimport tensorflow as tf\nfrom model.common import conv2d_bn_mish\n\ndef spp(x):\n pool_sizes = [5, 9, 13]\n pooling_results = [tf.keras.layers.MaxPooling2D((pool_size,pool_size), strides=(1, 1),padding='same')(x) for pool_size in pool_sizes]\n spp_result = tf.keras.layers.Concatenate()(pooling_results+[... | [
[
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Concatenate"
]
] |
dlnp2/pandas | [
"324bb84c8e4c84b4103e9b2bdda2d99e8ef549db",
"324bb84c8e4c84b4103e9b2bdda2d99e8ef549db",
"324bb84c8e4c84b4103e9b2bdda2d99e8ef549db"
] | [
"pandas/core/arrays/base.py",
"pandas/io/excel/_xlrd.py",
"pandas/tests/sparse/test_format.py"
] | [
"\"\"\"An interface for extending pandas with custom arrays.\n\n.. warning::\n\n This is an experimental API and subject to breaking changes\n without warning.\n\"\"\"\nimport operator\nfrom typing import Any, Callable, Optional, Sequence, Tuple, Union\n\nimport numpy as np\n\nfrom pandas.compat import PY3, set... | [
[
"pandas.util._decorators.Substitution",
"pandas.core.dtypes.missing.isna",
"numpy.array",
"pandas.errors.AbstractMethodError",
"numpy.asarray",
"pandas.compat.numpy.function.validate_argsort_with_ascending",
"pandas.util._validators.validate_fillna_kwargs",
"pandas.core.ops._get_op... |
taldcroft/jska-eng_archive | [
"9ff205416f3b6d95e01a5c4d3f13c472b0dee976"
] | [
"Ska/engarchive/fetch.py"
] | [
"#!/usr/bin/env python\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"\nFetch values from the Ska engineering telemetry archive.\n\"\"\"\nfrom __future__ import print_function, division, absolute_import\n\nimport sys\nimport os\nimport time\nimport contextlib\nimport logging\nimport operato... | [
[
"numpy.concatenate",
"numpy.any",
"matplotlib.pyplot.margins",
"numpy.arange",
"numpy.sort",
"numpy.all",
"numpy.searchsorted",
"numpy.flatnonzero"
]
] |
gitter-badger/model-validation-toolkit | [
"5859b19cb216f9dc87fc600adc7d74700787cbfa"
] | [
"mvtk/thresholding.py"
] | [
"import public\nimport bisect\nimport numpy\nimport matplotlib.pylab as plt\n\nfrom functools import reduce\n\n\n@public.add\ndef plot_err(scores, utility_mean, utility_err, color=None, label=None, alpha=0.5):\n plt.plot(scores, utility_mean, color=color)\n plt.fill_between(scores, *utility_err, alpha=alpha, ... | [
[
"numpy.asarray",
"numpy.random.RandomState",
"matplotlib.pylab.fill_between",
"numpy.argsort",
"matplotlib.pylab.plot"
]
] |
Ilyushin/pytorch | [
"efb2c093fc9e7f26195af7136403645a1710d985"
] | [
"torch/_prims/utils.py"
] | [
"from __future__ import annotations\n\nfrom typing import Any, Union, Sequence, Optional, Callable, Dict, Tuple, List\nfrom enum import Enum\nfrom functools import reduce, cmp_to_key\nimport operator\n\nimport torch\n\n# nvFuser imports are conditional on CUDA being available\nif torch.cuda.is_available():\n fro... | [
[
"torch.Tensor._make_wrapper_subclass",
"torch.cuda.is_available",
"torch.device",
"torch.get_default_dtype"
]
] |
rodrigobressan/PADify | [
"362db2b3a33793ac53f938e89f90a6ecdf778e89",
"362db2b3a33793ac53f938e89f90a6ecdf778e89"
] | [
"spoopy/tools/classifier/classifier.py",
"spoopy/tools/saliency_extractor/saliency_mbd.py"
] | [
"from __future__ import division\n\nimport glob\nimport json\nimport sys\n\nimport os\nimport os.path\n\nsys.path.append('/Users/rodrigobresan/Documents/dev/github/anti_spoofing/spoopy')\nimport numpy as np\nfrom keras.applications import VGG16, VGG19\nfrom sklearn.ensemble import BaggingClassifier\nfrom sklearn.me... | [
[
"sklearn.preprocessing.LabelEncoder",
"numpy.reshape",
"numpy.zeros",
"numpy.random.seed",
"numpy.sum",
"numpy.load",
"numpy.save",
"sklearn.metrics.accuracy_score",
"sklearn.svm.SVC",
"numpy.expand_dims"
],
[
"numpy.max",
"numpy.array",
"numpy.cov",
"nu... |
919bot/Tessa | [
"9b48ff9020e8fb6992fc78271f2720fd19e01093"
] | [
"selfdrive/car/volkswagen/carstate.py"
] | [
"import numpy as np\nfrom selfdrive.config import Conversions as CV\nfrom selfdrive.car.interfaces import CarStateBase\nfrom opendbc.can.parser import CANParser\nfrom opendbc.can.can_define import CANDefine\nfrom selfdrive.car.volkswagen.values import DBC, BUTTON_STATES, CarControllerParams\n\ndef get_mqb_pt_can_pa... | [
[
"numpy.mean"
]
] |
YoungLew/NoiseContrastiveLearning | [
"2abff09651e17af4370319ca63a4c090097f914f"
] | [
"Grid_MRF/generate_grid_mrf_model.py"
] | [
"#! /usr/bin/env python\n#\n# File Name : generate_grid_mrf_model.py\n# Created By : largelymfs\n# Creation Date : [2016-01-20 14:42]\n# Last Modified : [2016-01-20 14:50]\n# Description : the pyscripts to generate mrf grid model \n#\n\n... | [
[
"numpy.random.normal"
]
] |
abhilashasancheti/CMSC-723-project | [
"3a905af48094157278293229f138d541c65d1bc8"
] | [
"code/beaver-2task/train.py"
] | [
"# -*- coding: utf-8 -*-\nimport logging\nimport datetime\n\nimport torch\nimport torch.cuda\n\nfrom beaver.data import build_dataset\nfrom beaver.infer import beam_search\nfrom beaver.loss import WarmAdam, LabelSmoothingLoss\nfrom beaver.model import NMTModel\nfrom beaver.utils import Saver\nfrom beaver.utils impo... | [
[
"torch.set_grad_enabled"
]
] |
jprendergast-hs/search_with_machine_learning_course | [
"fb2b521d5cc58c74a1e0a847b8c16995ba1d3663"
] | [
"week2/utilities/data_prepper.py"
] | [
"# This file processes our queries, runs them through OpenSearch against the BBuy Products index to fetch their \"rank\" and so they can be used properly in a click model\n\nimport ltr_utils as lu\nimport numpy as np\nimport pandas as pd\nimport query_utils as qu\nfrom opensearchpy import RequestError\nfrom collect... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.merge",
"pandas.concat"
]
] |
ElMehdiHaress/Beyond-CVaR | [
"645ae390e0e8287348450541611aef01d60bddc0"
] | [
"Robust mean estimation.py"
] | [
"import numpy as np\nfrom math import *\nfrom numpy import median\n\n\n# empirical mean :\ndef empirical(X):\n return np.mean(X)\n\n\n# Catoni estimator :\ndef catoni(X):\n n = len(X)\n delta = 0.002\n var = np.var(X)\n if var == 0:\n var = 10 ** (-5)\n\n s = sqrt(var * n / log(2 / delta)) ... | [
[
"numpy.log",
"numpy.median",
"numpy.mean",
"numpy.where",
"numpy.var"
]
] |
whitecat-22/btc_graph | [
"94ccc0f5eba42f7a7e52ac327ab978fbd26eda8d"
] | [
"btc_graph.py"
] | [
"# -*- coding: utf-8 -*-\nimport poloniex\nimport time\nimport datetime\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef main():\n date, data = getDataPoloniex()\n fig = plt.figure()\n ax = fig.add_subplot(111)\n ax.plot(date, data)\n ax.set_title(\"BTC Price\")\n ax.set_xlabel(\"Day\... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
JensGM/pyTurbSim | [
"69db0d7670afe5b2b386087aa0229a7511ef070d"
] | [
"pyts/plot/_basefuncs.py"
] | [
"import numpy as np\nimport matplotlib as mpl\ntransforms = mpl.transforms\nfrom string import lowercase\n\n\ndef pair(val):\n \"\"\"\n Return the input as a list of two values if it is a scalar.\n \"\"\"\n if np.isscalar(val):\n return [val] * 2\n if len(val) == 1:\n return [val[0], va... | [
[
"numpy.concatenate",
"matplotlib.pylab.draw_if_interactive",
"numpy.array",
"numpy.isnan",
"numpy.sum",
"numpy.ones",
"numpy.diff",
"numpy.nanmean",
"numpy.isscalar",
"numpy.arange",
"matplotlib.pylab.gca",
"numpy.meshgrid"
]
] |
mandel/lale | [
"ffa4a197305ebe516fccac022536794db4e780b9"
] | [
"lale/lib/rasl/select_k_best.py"
] | [
"# Copyright 2021 IBM 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-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.finfo",
"numpy.isnan"
]
] |
01-vyom/ignite | [
"6954817abaa03b9be0f3a18b262058e1e8dd8fbe"
] | [
"ignite/engine/deterministic.py"
] | [
"import random\nimport warnings\nfrom collections import OrderedDict\nfrom functools import wraps\nfrom typing import Any, Callable, Generator, Iterator, List, Optional\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.sampler import BatchSampler\n\nfrom ignite.engine.engine import Eng... | [
[
"torch.get_rng_state",
"torch.cuda.is_available",
"torch.set_rng_state",
"numpy.random.get_state",
"numpy.random.set_state"
]
] |
nijatmursali/vision-and-perception | [
"8787ec5350dd0f2b8baa763f0cbc892fa582e2e1"
] | [
"HOMEWORK/HW2/ex_3/ex_3.py"
] | [
"import cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n# loading image\nimg0 = cv2.imread('images/flower.jpg',)\n\n# converting to gray scale\ngray = cv2.cvtColor(img0, cv2.COLOR_BGR2GRAY)\n\n# remove noise\nimg = cv2.GaussianBlur(gray,(3,3),0)\n\n# convolute with proper kernels\nlaplacian = cv2.L... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.imshow"
]
] |
giannipele/pytorch_geometric | [
"187d49dcce53a630e36c85c53138345f5bfdc876"
] | [
"examples/laf_gin_cora.py"
] | [
"import os\nimport torch\nimport torch.nn.functional as F\nfrom torch_geometric.datasets import Planetoid\nimport torch_geometric.transforms as T\nimport math\nimport numpy as np\nfrom torch import autograd\nfrom torch.nn import Sequential, Linear, ReLU, BatchNorm1d as BN\nfrom torch_geometric.nn import GINLafConv,... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.ModuleList",
"numpy.random.RandomState",
"torch.nn.functional.dropout",
"numpy.mean",
"torch.nn.functional.log_softmax",
"torch.manual_seed",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"torch.cuda.is_available",
"numpy.var",... |
tf-marissaw/addons | [
"32b82e0faa3e7813ceda880c02b9cd64d274488a"
] | [
"tensorflow_addons/seq2seq/tests/decoder_test.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.testing.assert_allclose",
"tensorflow.sequence_mask",
"tensorflow.keras.layers.RNN",
"tensorflow.expand_dims",
"numpy.testing.assert_array_equal",
"numpy.random.randn",
"tensorflow.constant",
"tensorflow.keras.layers.LSTMCell"
]
] |
LD-Lab/16S-Taxa-Phlyo | [
"336abb7bd36e90493e93db3dbe5afa63e5532b70"
] | [
"scripts/DatabaseInit.py"
] | [
"import os\nimport argparse\nimport pandas as pd\nfrom Bio import SeqIO\n\nparser = argparse.ArgumentParser(description='Run Diamond')\n\nparser.add_argument('-i', '--input', dest='DatabaseFasta', type=str, required=False, default=\"./Database/SILVA_138.1_SSURef_NR99_tax_silva.fasta\", \n help=\"... | [
[
"pandas.DataFrame"
]
] |
tombh/sktime | [
"53df0b9ed9d1fd800539165c414cc5611bcc56b3",
"1dfce6b41c2acdb576acfc04b09d11bf115c92d1"
] | [
"sktime/contrib/dictionary_based/bop.py",
"sktime/series_as_features/tests/test_all_panel_estimators.py"
] | [
"# -*- coding: utf-8 -*-\nfrom sklearn.model_selection import GridSearchCV\nfrom sktime.base import BaseEstimator\n\nfrom sktime.classification.distance_based._time_series_neighbors import (\n KNeighborsTimeSeriesClassifier,\n)\nfrom sktime.datasets import load_italy_power_demand\nfrom sklearn.pipeline import Pi... | [
[
"sklearn.model_selection.GridSearchCV",
"sklearn.pipeline.Pipeline"
],
[
"numpy.issubdtype",
"numpy.unique"
]
] |
normster/tpu | [
"5ccd9783b70f759bdeeb4f8d3e944121a8d97668"
] | [
"models/official/detection/modeling/losses.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.exp",
"tensorflow.ones_like",
"tensorflow.reshape",
"tensorflow.zeros_like",
"tensorflow.to_float",
"tensorflow.tile",
"tensorflow.greater",
"tensorflow.one_hot",
"tensorflow.cast",
"tensorflow.shape",
"tensorflow.add_n",
"tensorflow.losses.sigmoid_cross... |
jrt54/total_variation | [
"6611bcddc0e8fe5a49414b004e5b9da9dec4fd6a"
] | [
"examples/seismic/model.py"
] | [
"import numpy as np\nimport os\n\nfrom devito import Grid, Function, Constant\nfrom devito.logger import error\n\n\n__all__ = ['Model', 'demo_model']\n\n\ndef demo_model(preset, **kwargs):\n \"\"\"\n Utility function to create preset :class:`Model` objects for\n demonstration and testing purposes. The part... | [
[
"numpy.max",
"numpy.array",
"numpy.pad",
"numpy.empty",
"numpy.sin",
"numpy.log",
"numpy.ones",
"numpy.min",
"numpy.sqrt",
"numpy.fromfile"
]
] |
dhavalsharma97/Computer-Vision | [
"75b39c9e5adb2a1a54854ed487fe750ad316a8fc"
] | [
"Assignment 2/QuestionB_1.py"
] | [
"#Author : Dhaval Harish Sharma\n#Red ID : 824654344\n#Assignment 2, Question B_1\n#Finding the histogram of an image\n\n#Importing the required libraries\nimport skimage.io as io\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n#Converting the image to a numpy array\nin_img = io.imread('Apple.jpeg')\nheight... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.bar"
]
] |
srikarym/FiLM-for-Meta-Learning | [
"1da58c09b685435f1dd17baa26b6f1f993de4689"
] | [
"Reinforcement learning/third layer/fastlearner/ppo2ttifrutti_policies.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\n\nfrom baselines.a2c.utils import fc, conv_to_fc\nfrom baselines.common.distributions import make_pdtype\n\nfrom ppo2ttifrutti_agent import nenvs\n\nclass filmInit(object):\n def __init__(self, n):\n self.n = n\n ... | [
[
"tensorflow.trainable_variables",
"tensorflow.multiply",
"tensorflow.constant_initializer",
"tensorflow.contrib.layers.variance_scaling_initializer",
"tensorflow.contrib.slim.separable_conv2d",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.get_variable",
"n... |
uma-pi1/dist-kge | [
"ccc93e7981c09a0499f2267f37886660896d8f72"
] | [
"kge/distributed/funcs.py"
] | [
"import time\nimport logging\nimport warnings\n\nimport psutil\nfrom signal import signal, SIGINT\nfrom py3nvml.py3nvml import *\nfrom typing import Dict, Optional\nfrom kge import Config, Dataset\nfrom kge.distributed.parameter_server import init_torch_server, init_lapse_scheduler\nfrom kge.distributed.worker_proc... | [
[
"torch.multiprocessing.Process",
"torch.multiprocessing.set_sharing_strategy"
]
] |
aHarukaAkaba/tensorrt-inference-server | [
"d8f43461af3d45a282fc943c7de41be6500e78ae"
] | [
"src/clients/python/simple_shm_client.py"
] | [
"#!/usr/bin/env python\n# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# ... | [
[
"numpy.ones",
"numpy.arange"
]
] |
thenghiapham/PreSumm | [
"7bc537b656dc43898474c99b906e02f65b98c975"
] | [
"src/models/data_loader.py"
] | [
"import bisect\nimport gc\nimport glob\nimport random\n\nimport torch\n\nfrom others.logging import logger\n\n\n\nclass Batch(object):\n def _pad(self, data, pad_id, width=-1):\n if (width == -1):\n width = max(len(d) for d in data)\n rtn_data = [d + [pad_id] * (width - len(d)) for d in ... | [
[
"torch.load"
]
] |
GabrielGanne/trex-core | [
"400f03c86c844a0096dff3f6b13e58a808aaefff"
] | [
"scripts/external_libs/jsonpickle-2.0.0/tests/numpy_test.py"
] | [
"from __future__ import absolute_import, division, unicode_literals\nimport datetime\nimport warnings\n\nimport pytest\n\ntry:\n import numpy as np\n import numpy.testing as npt\n from numpy.compat import asbytes\n from numpy.testing import assert_equal\nexcept ImportError:\n pytest.skip('numpy is no... | [
[
"numpy.lib.stride_tricks.as_strided",
"numpy.random.rand",
"numpy.unicode_",
"numpy.rec.array",
"numpy.int_",
"numpy.frombuffer",
"numpy.random.random",
"numpy.dtype",
"numpy.object_",
"numpy.eye",
"numpy.arange",
"numpy.int32",
"numpy.array",
"numpy.str_",
... |
jonhilgart22/lifelines | [
"31779e40860d3f4a9878c92f5a2b5e4df5e32a47"
] | [
"lifelines/fitters/kaplan_meier_fitter.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nimport numpy as np\nimport pandas as pd\n\nfrom lifelines.fitters import UnivariateFitter\nfrom lifelines.utils import _preprocess_inputs, _additive_estimate, StatError, inv_normal_cdf,\\\n median_survival_times\nfrom lifelines.plotting import plot... | [
[
"numpy.log",
"pandas.DataFrame",
"numpy.exp",
"numpy.seterr",
"numpy.sqrt"
]
] |
WildMeOrg/wbia-vtool | [
"a9c7e2649c625b26eb074766c1d9018f432a33c6"
] | [
"vtool/symbolic.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nSympy helpers\n\"\"\"\nfrom __future__ import absolute_import, division, print_function\nimport numpy as np\nimport six\nimport utool as ut\nimport ubelt as ub\n\n\ndef custom_sympy_attrs(mat):\n import sympy\n\n def matmul(other, hold=True):\n if hold:\n ne... | [
[
"numpy.array"
]
] |
xlturing/FoolNLTK | [
"76166d5f7cac1f70e697bcac4b0b1a1fdd128da9"
] | [
"fool/predictor.py"
] | [
"#!/usr/bin/env python\n# -*-coding:utf-8-*-\n\n\n\nimport tensorflow as tf\nimport numpy as np\nfrom tensorflow.contrib.crf import viterbi_decode\n\nSEG_DICT = {\"B\": 0, \"M\": 1, \"E\": 2, \"S\": 3}\n\ndef decode(logits, trans, sequence_lengths, tag_num):\n viterbi_sequences = []\n small = -1000.0\n sta... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.asarray",
"tensorflow.contrib.crf.viterbi_decode",
"tensorflow.GraphDef",
"tensorflow.Session",
"tensorflow.import_graph_def",
"numpy.ones",
"tensorflow.Graph",
"tensorflow.gfile.GFile"
]
] |
teabao/PTT-Notebook-Trading-Crawler | [
"217b8d3b1ed1e0509580d1c3c5f07907a36323aa"
] | [
"bao/color.py"
] | [
"import numpy as np\n\nbrand_color = {\n 'ASUS': '#696969',\n 'Acer': '#4d9c49',\n 'Lenovo': '#ff1805',\n 'Apple': '#000000',\n 'Surface': '#003dbd',\n 'MSI': '#ff7589',\n 'HP': '#9ed3ff',\n 'Dell': '#1a97ff',\n 'TOSHIBA': '#d1002a',\n 'Gigabyte': '#060094',\n 'CJS': '#7a000f',\n ... | [
[
"numpy.array"
]
] |
erjiang/detecto | [
"673bee8c0522e8cd18edce1602c2fd061bb27e14"
] | [
"detecto/tests/helpers.py"
] | [
"import os\nimport torch\n\nfrom detecto.core import Model, Dataset\nfrom detecto.utils import xml_to_csv, read_image\n\n\ndef get_dataset(**kwargs):\n path = os.path.dirname(__file__)\n input_folder = os.path.join(path, 'static')\n labels_path = os.path.join(path, 'static/labels.csv')\n\n xml_to_csv(in... | [
[
"torch.empty"
]
] |
AzemaBaptiste/bazema_linker | [
"59a10ca0b09421e222954968be94dde6344c9d0b"
] | [
"bazema_linker/test/unit/test_file_io.py"
] | [
"import unittest\nfrom pathlib import Path\nfrom unittest.mock import patch, MagicMock\n\nimport pandas as pd\n\nfrom bazema_linker.utils.file_io import FileReader, FileWriter\n\n\nclass TestFileReader(unittest.TestCase):\n \"\"\"\n Unit tests of file utils\n \"\"\"\n\n def test_reader_constructor(self)... | [
[
"pandas.DataFrame"
]
] |
Zac-HD/ndindex | [
"0d9d131a5310915f3a51ebe95491e43afcd1dcad"
] | [
"ndindex/tests/test_slice.py"
] | [
"from pytest import raises\n\nfrom numpy import arange\n\nfrom hypothesis import given, assume\nfrom hypothesis.strategies import integers, one_of\n\nfrom ..slice import Slice\nfrom ..tuple import Tuple\nfrom ..integer import Integer\nfrom .helpers import check_same, slices, prod, shapes, iterslice\n\ndef test_slic... | [
[
"numpy.arange"
]
] |
cjayb/mne-python | [
"48823ad1dd1138b8a07e0770ef64368ae24de64e"
] | [
"mne/channels/channels.py"
] | [
"# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>\n# Denis Engemann <denis.engemann@gmail.com>\n# Andrew Dykstra <andrew.r.dykstra@gmail.com>\n# Teon Brooks <teon.brooks@gmail.com>\n# Daniel McCloy <dan.mccloy@gmai... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.asarray",
"numpy.sum",
"scipy.io.loadmat",
"numpy.take",
"numpy.swapaxes",
"numpy.memmap",
"numpy.prod",
"numpy.abs",
"numpy.repeat",
"scipy.sparse.lil_matrix",
"scipy.sparse.csr_matrix",
"scipy.spatial.Delaunay",
... |
alexis-rodriguez/vectorbt | [
"f67c5025629e04ca87a62fb1bf1c63ad191a4e00"
] | [
"tests/test_records.py"
] | [
"import vectorbt as vbt\nimport numpy as np\nimport pandas as pd\nfrom numba import njit\nfrom datetime import datetime\nimport pytest\n\nfrom vectorbt.generic.enums import range_dt, drawdown_dt\nfrom vectorbt.portfolio.enums import order_dt, trade_dt, log_dt\n\nfrom tests.utils import record_arrays_close\n\nday_dt... | [
[
"numpy.argmin",
"numpy.min",
"numpy.mean",
"pandas.Timestamp",
"numpy.cumsum",
"numpy.dtype",
"numpy.concatenate",
"numpy.full",
"pandas.DataFrame.from_records",
"numpy.max",
"pandas.Timedelta",
"numpy.argmax",
"numpy.arange",
"pandas.unique",
"pandas.te... |
maqroll/ClickHouse | [
"85cf3e798a075ea42c14b868dc1fa911b2ae06fe"
] | [
"docker/test/performance-comparison/perf.py"
] | [
"#!/usr/bin/python3\n\nimport argparse\nimport clickhouse_driver\nimport itertools\nimport functools\nimport math\nimport os\nimport pprint\nimport random\nimport re\nimport statistics\nimport string\nimport sys\nimport time\nimport traceback\nimport xml.etree.ElementTree as et\nfrom scipy import stats\n\ndef tsv_e... | [
[
"scipy.stats.ttest_ind"
]
] |
kromozome2003/MapR-YoloNCS | [
"345c292318ab9a8c96c8b4b28d19a859c93709e6"
] | [
"py_examples/object_detection_app.py"
] | [
"import os,time,cv2,argparse,multiprocessing\nimport numpy as np\nimport requests,json,time,csv\nfrom requests.utils import quote\nfrom mvnc import mvncapi as mvnc\nfrom skimage.transform import resize\nfrom utils.app_utils import FPS, WebcamVideoStream\nfrom multiprocessing import Queue, Pool\n\nclasses = [\"aerop... | [
[
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.nonzero",
"numpy.multiply",
"numpy.transpose",
"numpy.argmax",
"numpy.argsort",
"numpy.arange"
]
] |
AnneLizaBruggeman/OpenLEGO | [
"64967f631da098053f78677131c79a432d4d3729"
] | [
"openlego/utils/xml_utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nCopyright 2018 D. de Vries\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\nUnl... | [
[
"numpy.atleast_1d"
]
] |
Tongjilibo/bert4torch | [
"71d5ffb3698730b16e5a252b06644a136787711e",
"71d5ffb3698730b16e5a252b06644a136787711e"
] | [
"examples/sentence_embedding/task_sentence_embedding_sbert_xnli__concat_CrossEntropyLoss.py",
"examples/seq2seq/task_seq2seq_autotitle_t5.py"
] | [
"#! -*- coding:utf-8 -*-\n# 语义相似度任务:数据集xnli, 从train中切分了valid\n# loss: concat后走3分类,CrossEntropyLoss\n\nfrom bert4torch.tokenizers import Tokenizer\nfrom bert4torch.models import build_transformer_model, BaseModel\nfrom bert4torch.snippets import sequence_padding, Callback, ListDataset\nimport torch.nn as nn\nimport ... | [
[
"torch.cat",
"torch.max",
"torch.abs",
"torch.cuda.is_available",
"torch.tensor",
"torch.nn.CrossEntropyLoss",
"torch.sum"
],
[
"torch.cuda.is_available",
"torch.tensor"
]
] |
kif/multianalyzer | [
"053b323898025df0eb3fad556cdb60553f503a2e"
] | [
"multianalyzer/opencl.py"
] | [
"import os\nimport logging\nlogger = logging.getLogger(__name__)\nfrom collections import OrderedDict\nimport numpy\nimport pyopencl\nfrom pyopencl import array as cla\n\n\nclass OclMultiAnalyzer:\n NUM_CRYSTAL = numpy.int32(13)\n\n def __init__(self, L, L2, pixel, center, tha, thd, psi, rollx, rolly, device=... | [
[
"numpy.uint8",
"numpy.uint32",
"numpy.empty",
"numpy.zeros",
"numpy.ascontiguousarray",
"numpy.float64",
"numpy.arange",
"numpy.deg2rad",
"numpy.int32",
"numpy.dtype"
]
] |
scyq/CapstoneNetwork | [
"e4c888f2a6b1951794687657f86cd84cb006c2a3"
] | [
"config.py"
] | [
"# -*- coding: utf-8 -*-\r\n\r\nimport torch\r\n\r\n\r\nclass Config:\r\n '''\r\n Chatbot模型参数\r\n '''\r\n corpus_data_path = 'corpus.pth' #已处理的对话数据\r\n use_QA_first = True #是否载入知识库\r\n max_input_length = 100 #输入的最大句子长度\r\n max_generate_length = 300 #生成的最大句子长度\r\n prefix = 'checkpoints/ch... | [
[
"torch.device",
"torch.cuda.is_available"
]
] |
fdschmidt93/datasets | [
"d3c7b9481d427ce41256edaf6773c47570f06f3b"
] | [
"src/datasets/table.py"
] | [
"import copy\nimport os\nimport tempfile\nfrom functools import wraps\nfrom itertools import groupby\nfrom typing import List, Optional, Tuple, TypeVar, Union\n\nimport numpy as np\nimport pyarrow as pa\nimport pyarrow.compute as pc\n\nfrom . import config\nfrom .utils.logging import get_logger\n\n\nlogger = get_lo... | [
[
"numpy.searchsorted"
]
] |
adornetejr/manim | [
"19e3c97589181ffd43ef14d9169af4e40e054664"
] | [
"manimlib/mobject/value_tracker.py"
] | [
"import numpy as np\n\nfrom manimlib.mobject.mobject import Mobject\n\n\nclass ValueTracker(Mobject):\n \"\"\"\n Note meant to be displayed. Instead the position encodes some\n number, often one which another animation or continual_animation\n uses for its update function, and by treating it as a mobje... | [
[
"numpy.log",
"numpy.zeros"
]
] |
crazydigger/AttnGAN | [
"c4dcbc410772cd592e131d88d16e3069e913fb33"
] | [
"code/main.py"
] | [
"from __future__ import print_function\n\nfrom miscc.config import cfg, cfg_from_file\nfrom datasets import TextDataset\nfrom trainer import condGANTrainer as trainer\n\nimport os\nimport sys\nimport time\nimport random\nimport pprint\nimport datetime\nimport dateutil.tz\nimport argparse\nimport numpy as np\n\nimpo... | [
[
"numpy.max",
"torch.cuda.manual_seed_all",
"numpy.asarray",
"numpy.random.seed",
"torch.manual_seed",
"numpy.argsort"
]
] |
AndreasMadsen/nlp-roar-interpretability | [
"ad30f756cd744dfb05d1b57de744c5ff60d9f20c"
] | [
"nlproar/explain/importance_measures/input_times_gradient.py"
] | [
"\nimport torch\n\nfrom ...dataset import SequenceBatch\nfrom ._abstract import ImportanceMeasureModule\n\nclass InputTimesGradientImportanceMeasure(ImportanceMeasureModule):\n def forward(self, batch: SequenceBatch) -> torch.Tensor:\n # Prepear a compact embedding matrix for doing sum(x * dy/dz @ W.T) ef... | [
[
"torch.abs",
"torch.autograd.grad",
"torch.no_grad"
]
] |
Abirami-mygithub/InjectTFParallel | [
"0f3d545ef8e4ea8cdffd0d23cb0ea6e30cdc302e"
] | [
"datasets/mnist_dataset.py"
] | [
"\"\"\"\nFilename: mnist_dataset.py \nFile Description: mnist dataset is acquired from tensorflow datasets and split into training and test dataset. \n There are getter functions to retrieve training and test dataset.\nCreated by: Abirami Ravi - University of Stuttgart (abiram... | [
[
"tensorflow.keras.utils.to_categorical"
]
] |
jsoft88/cptr-vision-transformer | [
"c1728792e3a1b14805ad2489efcd869677c380d7"
] | [
"cptr_model/embeddings/position/position_sin_cos_embedding.py"
] | [
"from typing import Any, List\nimport numpy as np\nimport torch.nn\nimport torch\nfrom cptr_model.config.config import Config\nfrom cptr_model.config.specifics.cptr.architecture_config_file_manager import ArchitectureConfigFileManager\nfrom cptr_model.embeddings.position.base_position_embedding import BasePositionE... | [
[
"torch.cos",
"torch.device",
"torch.sin",
"torch.FloatTensor",
"numpy.power"
]
] |
Starry-2000/PYNQ-Z2- | [
"523d522a7c2dc1e86ccb32f6c9f0e20f9195cdd4"
] | [
"jupyter_notebooks/GTSRB/cnn.py"
] | [
"import time\nfrom pynq import Overlay\nimport numpy as np\nfrom pynq import Xlnk\nimport struct\nfrom scipy.misc import imread\nimport cv2\n\nxlnk = Xlnk()\nol = Overlay(\"cnn.bit\")\nconv = ol.Conv_0\npool = ol.Pool_0\n\n# Conv1\nIN_WIDTH1 = 28\nIN_HEIGHT1 = 28\nIN_CH1 = 1\n\nKERNEL_WIDTH1 = 3\nKERNEL_HEIGHT1 = 3... | [
[
"numpy.array"
]
] |
tcgvn/dash-draggable | [
"feb9702ee8f248c5405007d2262a988e8da7ef24"
] | [
"usage.py"
] | [
"import dash\nfrom dash.dependencies import Input, Output\nfrom dash import dcc\nfrom dash import html\n\nimport plotly.express as px\nimport pandas as pd\n\nimport dash_draggable\n\n\nexternal_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']\n\napp = dash.Dash(__name__, external_stylesheets=external_st... | [
[
"pandas.read_csv"
]
] |
eff-kay/temp-texar-repo | [
"b4ac155a554db4c82a0b09ea36e85d64b8802644",
"5c6ee6645c1d78f8294e2a07d111dbb02cd9547e"
] | [
"texar/modules/embedders/embedder_utils_test.py",
"texar/losses/losses_utils.py"
] | [
"#\n\"\"\"\nUnit tests for embedder utils.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n# pylint: disable=no-member\n\nimport tensorflow as tf\n\nfrom texar.modules.embedders import embedder_util... | [
[
"tensorflow.random_uniform_initializer",
"tensorflow.keras.regularizers.L1L2",
"tensorflow.test.main"
],
[
"tensorflow.python.ops.rnn._transpose_batch_time",
"numpy.arange",
"tensorflow.squeeze",
"tensorflow.reduce_sum",
"tensorflow.to_float",
"tensorflow.reduce_mean"
]
] |
kruus/umap | [
"b1223505ca56ae104feb35e4196227277d1e8058"
] | [
"umap/umap_.py"
] | [
"# Author: Leland McInnes <leland.mcinnes@gmail.com>\n#\n# License: BSD 3 clause\nfrom __future__ import print_function\n\nimport locale\nfrom warnings import warn\nimport time\n\nfrom scipy.optimize import curve_fit\nfrom sklearn.base import BaseEstimator\nfrom sklearn.utils import check_random_state, check_array\... | [
[
"numpy.exp",
"numpy.mean",
"numpy.min",
"sklearn.preprocessing.normalize",
"scipy.sparse.triu",
"sklearn.utils.check_array",
"scipy.sparse.tril",
"numpy.max",
"numpy.full",
"numpy.log",
"sklearn.externals.joblib.hash",
"sklearn.metrics.pairwise_distances",
"nump... |
Qwinpin/chainer | [
"8d776fcc1e848cb9d3800a6aab356eb91ae9d088"
] | [
"tests/chainermn_tests/links_tests/test_n_step_rnn.py"
] | [
"import unittest\n\nimport chainer\nimport chainer.cuda\nimport chainer.functions as F\nimport chainer.links as L\nimport chainer.testing\nimport chainermn\nimport numpy as np\nimport pytest\n\n\nclass Model(chainer.Chain):\n def __init__(self, n_vocab, n_hid, communicator, rank_next, rank_prev):\n n_laye... | [
[
"numpy.random.randint",
"numpy.random.rand"
]
] |
c235gsy/Sustech_Mathematical-Modeling | [
"e2187b3d181185af4927255c50b4c08ba2a5fb3e"
] | [
"DiDi_taxe/K_means.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets.samples_generator import make_blobs\nfrom sklearn.cluster import KMeans\nfrom sklearn.cluster import MiniBatchKMeans\nfrom sklearn import metrics\nimport pandas as pd\n\nplt.rcParams['figure.figsize'] = (45.0, 45.0)\n\n\norder = pd.read_csv... | [
[
"sklearn.cluster.MiniBatchKMeans",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.scatter",
"sklearn.metrics.calinski_harabaz_score",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.subplot"
]
] |
jacksonpradolima/coleman4hcs | [
"b7b1fc5f42a200e57b2e3fe984053f16b6f89238"
] | [
"coleman4hcs/utils/monitor.py"
] | [
"import csv\nimport os\nimport pandas as pd\nfrom coleman4hcs.evaluation import EvaluationMetric\n\n\nclass MonitorCollector(object):\n \"\"\"\n The monitor class is used to collect data during a experiment\n \"\"\"\n\n def __init__(self):\n\n \"\"\"\n experiment: Experiment number\n ... | [
[
"pandas.DataFrame"
]
] |
wangjunxiao/DLG | [
"befd9c31d214098fdccf97794428a5550bbf8b1a"
] | [
"poc/core/reconstruction/metrics.py"
] | [
"\"\"\"This is code based on https://sudomake.ai/inception-score-explained/.\"\"\"\nimport torch\nimport torchvision\n\nfrom collections import defaultdict\n\nclass InceptionScore(torch.nn.Module):\n \"\"\"Class that manages and returns the inception score of images.\"\"\"\n\n def __init__(self, batch_size=32... | [
[
"torch.device",
"torch.cat",
"torch.stack",
"torch.isfinite",
"torch.log10",
"torch.nn.Upsample",
"torch.abs",
"torch.zeros_like"
]
] |
PrathamSoni/gvp-pytorch | [
"90d0e4a999398aeff6c6dd2849f7fd06131327a9",
"90d0e4a999398aeff6c6dd2849f7fd06131327a9"
] | [
"run_atom3d.py",
"gvp/models.py"
] | [
"import argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('task', metavar='TASK', choices=[\n 'PSR', 'RSR', 'PPI', 'RES', 'MSP', 'SMP', 'LBA', 'LEP'\n], help=\"{PSR, RSR, PPI, RES, MSP, SMP, LBA, LEP}\")\nparser.add_argument('--num-workers', metavar='N', type=int, default=4,\n ... | [
[
"torch.nn.MSELoss",
"torch.no_grad",
"torch.cuda.empty_cache",
"torch.cuda.is_available",
"torch.nn.BCELoss",
"torch.load",
"torch.nn.CrossEntropyLoss"
],
[
"torch.zeros",
"torch.nn.Linear",
"torch.cat",
"torch.nn.Dropout",
"torch.distributions.Categorical",
... |
SilasK/statsplot | [
"fb30256777f73a06670ce3be9e4abf44b0e84514"
] | [
"statsplot/dimred.py"
] | [
"from logging import getLogger\n\nlogger = getLogger(\"__name__\")\n\nfrom sklearn.decomposition import PCA\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pylab as plt\nimport warnings\nfrom .plot import annotate_points, _def_label_alignment\nimport seaborn as sns\n\n\nfrom matplotlib.patches import El... | [
[
"numpy.array",
"numpy.cov",
"numpy.mean",
"matplotlib.patches.Ellipse",
"matplotlib.pylab.subplot",
"numpy.arange",
"numpy.sqrt",
"pandas.Series",
"matplotlib.pylab.gca",
"scipy.stats.chi2.ppf",
"matplotlib.transforms.Affine2D",
"numpy.unique"
]
] |
jeanphilippemercier/uquake | [
"2a066ac7db3058ed22058e121b2256656cda39fb"
] | [
"uquake/grid/nlloc.py"
] | [
"# -*- coding: utf-8 -*-\n# ------------------------------------------------------------------\n# Filename: <filename>\n# Purpose: <purpose>\n# Author: <author>\n# Email: <email>\n#\n# Copyright (C) <copyright>\n# --------------------------------------------------------------------\n\"\"\"\n\n\n:copyright:\n ... | [
[
"numpy.ones_like",
"numpy.argmin",
"numpy.min",
"numpy.mean",
"numpy.sort",
"numpy.gradient",
"numpy.max",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.sqrt",
"numpy.argmax",
"matplotlib.pyplot.axes",
"numpy.array",
"scipy.interpolate.interp1d",
... |
melnig/aoc | [
"cafb9bce9d74f38e801f0d6b1e4d51f4c036109e"
] | [
"solutions/day21.py"
] | [
"'''\nAuthor: Griffin Melnick, melnick.griffin@gmail.com\nFile: day21.py\nPurpose: Advent of Code 2017, day 21\n Pulls in command line input of 'a' or 'b' to represent which set of\n functions to call based on part.\n'''\n\nfrom collections import defaultdict\nimport numpy as np\n... | [
[
"numpy.rot90",
"numpy.empty",
"numpy.fliplr"
]
] |
GershonMF/ludwig | [
"5d9f9e120fac64a454efd7c0e63ce50bfffe489b"
] | [
"tests/integration_tests/test_experiment.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) 2019 Uber Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"pandas.read_csv"
]
] |
znerp/galaxy-image-analysis | [
"28afdb74360930617c483173afd924b2a8cbd0f4"
] | [
"tools/2d_feature_extraction/2d_feature_extraction.py"
] | [
"import argparse\nimport numpy as np\nimport pandas as pd\nimport tifffile\nimport skimage.io\nimport skimage.measure\nimport skimage.feature\nimport skimage.segmentation\nimport skimage.morphology\n\n#TODO make importable by python script\n\nparser = argparse.ArgumentParser(description='Extract Features 2D')\n\n#T... | [
[
"pandas.DataFrame"
]
] |
joeyzhong90595/Robotic_Poker_Dealer | [
"f30ece962ac4d3a726dffd193e123bfff01da740"
] | [
"src/areas_determination.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\n\nimport pcl\nfrom sensor_msgs.msg import PointCloud\n\n\n# Extra points from point cloud according to indices\ndef extra_pc(pc, indices):\n coord = []\n for index in indices:\n coord.append... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.lexsort",
"numpy.zeros",
"numpy.linalg.inv",
"matplotlib.image.imread",
"numpy.append",
"numpy.average",
"numpy.cross"
]
] |
mpkato/interleaving | [
"7907f7dd61bfcad57ad602b5c93e601677025da7"
] | [
"interleaving/optimized.py"
] | [
"from .ranking import CreditRanking\nfrom .interleaving_method import InterleavingMethod\nimport numpy as np\nfrom scipy.optimize import linprog\n\n\nclass Optimized(InterleavingMethod):\n '''\n Optimized Interleaving\n\n Args:\n lists: lists of document IDs\n max_length: the maximum length o... | [
[
"numpy.sum",
"numpy.array",
"numpy.vstack"
]
] |
miltondp/phenomexcan | [
"38390ac21987f1e72835c42919c53abd1a35cb7e"
] | [
"scripts/200_webapp/process_smultixcan.py"
] | [
"import os\nimport sys\nimport re\nimport argparse\n\nimport pandas as pd\n\nfrom utils import simplify_string_for_hdf5\n\nparser = argparse.ArgumentParser(description='S-MultiXcan results processor.')\nparser.add_argument('--smultixcan-file', required=True, type=str)\nparser.add_argument('--smultixcan-file-pattern... | [
[
"pandas.read_csv"
]
] |
Ascend-Research/BlockProfile | [
"94a0f065e3632c204af77b736b944d30562468f9",
"94a0f065e3632c204af77b736b944d30562468f9"
] | [
"search/rm_search/model_helpers.py",
"search/rm_search/ofa/test_supernets.py"
] | [
"import os\nimport torch\nfrom tqdm import tqdm\nfrom os.path import sep as P_SEP\nfrom search.rm_search.constants import *\nfrom search.rm_search.utils.model_utils import model_load, model_save\n\n\n\ndef write_line_to_file(s, f_path=\"progress.txt\", new_file=False, verbose=False):\n code = \"w\" if new_file e... | [
[
"torch.utils.data.DataLoader"
],
[
"torch.cuda.device_count"
]
] |
swapnil-ahlawat/Speech_Spike_Signatures | [
"e72af71b01d6536c3ee228addbc089d68d969135"
] | [
"src/preprocess.py"
] | [
"import librosa\r\nfrom librosa import display\r\nimport os\r\nimport scipy\r\nimport numpy as np\r\n\r\n\r\nclass Dataset:\r\n def __init__(self, data_dir, upper_bound, lower_bound):\r\n self.data_dir = data_dir\r\n self.upper_bound = upper_bound\r\n self.lower_bound = lower_bound\r\n ... | [
[
"numpy.max",
"numpy.array",
"numpy.lib.stride_tricks.as_strided",
"numpy.log",
"numpy.hanning",
"numpy.sum",
"numpy.min",
"numpy.save",
"numpy.shape",
"numpy.fft.fft",
"numpy.arange",
"numpy.absolute",
"numpy.all"
]
] |
preaudc/spark | [
"cfdcef70ddd25484f1cb1791e529210d602c2283"
] | [
"python/pyspark/mllib/tests.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"numpy.array",
"numpy.dot",
"numpy.array_equal",
"numpy.random.RandomState",
"numpy.sum",
"numpy.ones",
"numpy.arange",
"numpy.abs",
"numpy.all",
"scipy.sparse.lil_matrix"
]
] |
isabella232/shuwa | [
"3fc2fab461932a9f4e5c1af6fcdefef0c64ac7c2"
] | [
"webcam_demo_knn.py"
] | [
"# Copyright 2021 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.array",
"numpy.stack",
"numpy.loadtxt"
]
] |
hugovk/pandas | [
"10e5ad7109f1bb3c47b48b6f0df185e108c5493d"
] | [
"pandas/core/indexes/interval.py"
] | [
"\"\"\" define the IntervalIndex \"\"\"\nfrom functools import wraps\nfrom operator import le, lt\nimport textwrap\nfrom typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union, cast\n\nimport numpy as np\n\nfrom pandas._config import get_option\n\nfrom pandas._libs import lib\nfrom pandas._libs.interval imp... | [
[
"numpy.nextafter",
"pandas.core.arrays.interval.IntervalArray.from_tuples",
"pandas._libs.interval.IntervalMixin.__new__",
"pandas.core.dtypes.cast.maybe_downcast_to_dtype",
"pandas.core.common.all_not_none",
"pandas.core.dtypes.cast.find_common_type",
"numpy.where",
"pandas.core.c... |
vmoens/flowtorch | [
"499273172dc64b68dd41d06ace935bd6ee970fe4"
] | [
"flowtorch/bijectors/leaky_relu.py"
] | [
"# Copyright (c) Meta Platforms, Inc\n\nimport math\nfrom typing import Optional, Sequence, Tuple\n\nimport torch\nimport torch.nn.functional as F\nfrom flowtorch.bijectors.fixed import Fixed\n\n\nclass LeakyReLU(Fixed):\n # TODO: Setting the slope of Leaky ReLU as __init__ argument\n\n def _forward(\n ... | [
[
"torch.zeros_like",
"torch.ones_like",
"torch.nn.functional.leaky_relu"
]
] |
Luoyadan/MM2020_ABG | [
"d74cf915deea7bb425518f5bd40e64a9a7341981"
] | [
"utils/utils.py"
] | [
"import itertools\r\nimport numpy as np\r\nimport matplotlib as mpl\r\nmpl.use('Agg')\r\nimport matplotlib.pyplot as plt\r\nimport torch\r\n\r\ndef randSelectBatch(input, num):\r\n id_all = torch.randperm(input.size(0)).cuda()\r\n id = id_all[:num]\r\n return id, input[id]\r\n\r\ndef plot_confusion_matrix(... | [
[
"matplotlib.use",
"matplotlib.pyplot.colorbar",
"numpy.putmask",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xticks",
"matplotl... |
paulroujansky/pymanopt | [
"7ec0f83b2cc1bf325bfbbc98d69188cf6b7ef0f1",
"7d8c46f4513c3746234ba804604694b11db62d0a"
] | [
"examples/dominant_eigenvector.py",
"pymanopt/tools/multi.py"
] | [
"import numpy as np\nimport theano.tensor as T\nfrom numpy import linalg as la, random as rnd\n\nimport pymanopt\nfrom pymanopt.manifolds import Sphere\nfrom pymanopt.solvers import ConjugateGradient\n\n\ndef dominant_eigenvector(A):\n \"\"\"\n Returns the dominant eigenvector of the symmetric matrix A.\n\n ... | [
[
"numpy.linalg.norm",
"numpy.sum",
"numpy.random.randn",
"numpy.sign",
"numpy.linalg.eig",
"numpy.argmax"
],
[
"numpy.dot",
"numpy.log",
"numpy.linalg.eigh",
"numpy.exp",
"numpy.shape",
"numpy.eye",
"numpy.einsum",
"numpy.transpose"
]
] |
MusicExMachina/DeepPoet | [
"df1de1306f2904f2b6dc2d7d6dab45896e9142c7"
] | [
"AdamH-research/DiffMapTutorial/four_well.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom pydiffmap import diffusion_map as dm\n\nX=np.load('Data/4wells_traj.npy')\nprint(X.shape)\n\n\ndef DW1(x):\n return 2.0 * (np.linalg.norm(x) ** 2 - 1.0) ** 2\n\n\ndef DW2(x):\n return 4.0 * (np.linalg.norm(x)... | [
[
"matplotlib.pyplot.colorbar",
"numpy.linalg.norm",
"matplotlib.pyplot.xlim",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"numpy.load",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.s... |
Kully/plotly.py | [
"5c3c985c474f54ad039ff285086d7a83e9864592"
] | [
"packages/python/plotly/plotly/tests/test_optional/test_utils/test_utils.py"
] | [
"\"\"\"\nModule to test plotly.utils with optional dependencies.\n\n\"\"\"\nfrom __future__ import absolute_import\n\nimport datetime\nimport math\nimport decimal\nfrom datetime import datetime as dt\nfrom unittest import TestCase\nimport pytest\n\nimport numpy as np\nimport pandas as pd\nimport pytz\nfrom pandas.u... | [
[
"pandas.to_datetime",
"numpy.isnan",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"pandas.date_range",
"matplotlib.pyplot.subplots",
"numpy.arange",
"pandas.Series",
"numpy.datetime64"
]
] |
joshbenjamin3/Static_BFP_CNN | [
"d64579f5c644a350e9d16e405b2d5a434548cc45"
] | [
"bfp_model.py"
] | [
"#################################\n# RAW-to-RGB Model architecture #\n#################################\n\nimport tensorflow as tf\nimport numpy as np\n#import utils for bfp\nfrom bfp.lib.Utils_tf import bfp_quantize\n\nMANTISSA_WIDTH = 8\nEXPONENT_WIDTH = 10\n\n#Increment this to make every layer have a different... | [
[
"tensorflow.trainable_variables",
"tensorflow.zeros",
"tensorflow.nn.conv2d",
"tensorflow.concat",
"tensorflow.ones",
"tensorflow.compat.v1.variable_scope",
"tensorflow.nn.moments",
"tensorflow.constant",
"tensorflow.stack",
"tensorflow.random.truncated_normal",
"tensor... |
UVAdMIST/Reputation_System | [
"515d635f5ba642ab9f28dcf25598f9017bbea8c3"
] | [
"code/beta_repu.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n# from bokeh import palettes\n\ndef robust_avg(df_input):\n\n df_input = df_input.reset_index(drop=True)\n\n # robust average\n avg = []\n avg_weight = []\n temp = []\n\n #initial robust weight\n newp = [1.0 / len(df_inp... | [
[
"numpy.isinf",
"numpy.isnan",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tick_params",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show"
]
] |
jpvantassel/seisflows | [
"5155ec177b5df0218e1fb5204f1fcd6969c66f20"
] | [
"seisflows/plugins/line_search/base.py"
] | [
"#\n# This is Seisflows\n#\n# See LICENCE file\n#\n#\n###############################################################################\n\n# Import system modules\nfrom os.path import abspath\n\n# Import numpy\nimport numpy as np\n\n# Local imports\nfrom seisflows.tools.array import count_zeros\n\n\nclass Base(object... | [
[
"numpy.array"
]
] |
ProbIOU/PROBIOU-ALPHAROTATE | [
"777fb392f51a9b3ca2eb7e7b3b8b5ab98d8fc017"
] | [
"libs/configs/HRSC2016/probiou_l1/cfgs_res50_hrsc2016_probiou_v6.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function, absolute_import\n\nimport numpy as np\n\nfrom libs.configs._base_.models.retinanet_r50_fpn import *\nfrom libs.configs._base_.datasets.dota_detection import *\nfrom libs.configs._base_.schedules.schedule_1x import *\nfrom dataloader.pretrain... | [
[
"numpy.array"
]
] |
spfanning/research-projects-RIT | [
"34afc69ccb502825c81285733dac8ff993f79503"
] | [
"MonteCarloMarginalizeCode/Code/test/test_skysamp.py"
] | [
"#!/usr/bin/env python\nimport sys\nimport os\nimport functools\nimport itertools\nfrom collections import defaultdict\n\nimport healpy\n\nimport matplotlib\nmatplotlib.use(\"Agg\")\nfrom matplotlib import pyplot\n\nimport numpy\n\nfrom lalinference.bayestar import fits as bfits\nfrom lalinference.bayestar import p... | [
[
"matplotlib.use",
"numpy.histogram2d",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"numpy.ones",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.fi... |
janhenrikbern/multi-image-deepNet-SVBRDF-acquisition | [
"af354d2d529edfbf6d4233125be8268a85a12001"
] | [
"losses.py"
] | [
"import tensorflow as tf\nimport renderer\nimport helpers\n\n\ndef DX(x):\n return x[:,:,1:,:] - x[:,:,:-1,:] # so this just subtracts the image from a single-pixel shifted version of itself (while cropping out two pixels because we don't know what's outside the image)\n\ndef DY(x):\n return x[:,1:,:,:] - ... | [
[
"tensorflow.abs",
"tensorflow.trainable_variables",
"tensorflow.assign",
"tensorflow.concat",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
"tensorflow.group",
"tensorflow.log",
"tensorflow.variable_scope",
"tensorflow.name_scope",
"tensorflow.train.Exp... |
lyonguyen8697/neural-network-library | [
"03aff6167410cab1247ce80bae81474375db2379"
] | [
"network/networks.py"
] | [
"import json\nimport numpy as np\nfrom network import costs\nimport time\n\n\nclass NeuralNetwork:\n\n def __init__(self, input_layer, hidden_layers, output_layer, cost=costs.CrossEntropy):\n self.input_layer = input_layer\n self.hidden_layers = hidden_layers\n self.output_layer = output_lay... | [
[
"numpy.random.randn",
"numpy.argmax",
"numpy.sqrt"
]
] |
nijkah/Seodore | [
"648430a56b9fcec488fc299f5dd90c6ff6b3b708",
"648430a56b9fcec488fc299f5dd90c6ff6b3b708"
] | [
"tools/test.py",
"DOTA_devkit/ResultMerge_multi_process.py"
] | [
"import argparse\nimport os.path as osp\nimport shutil\nimport tempfile\n\nimport mmcv\nimport torch\nimport torch.distributed as dist\nfrom mmcv.runner import load_checkpoint, get_dist_info\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\n\nfrom mmdet.apis import init_dist\nfrom mmdet.core imp... | [
[
"torch.no_grad",
"torch.distributed.barrier",
"torch.full",
"torch.distributed.broadcast"
],
[
"numpy.max",
"numpy.array",
"numpy.minimum",
"numpy.min",
"numpy.where",
"numpy.maximum"
]
] |
ramcdona/PropScale | [
"a0199c01e5d50432675a93e0346cbc5ec514f85c"
] | [
"propeller_map_scaling.py"
] | [
"import numpy as np\r\nimport pandas as pd\r\nfrom scipy.optimize import root\r\nimport matplotlib.pyplot as plt\r\nimport math\r\nfrom scipy.integrate import trapz\r\nfrom scipy import interpolate\r\nimport pprint\r\n\r\n\r\n# Helper functions definition\r\n# -------------------------------------------------------... | [
[
"numpy.zeros_like",
"scipy.integrate.trapz",
"scipy.optimize.root",
"numpy.linspace",
"pandas.read_csv"
]
] |
Tan-H-C/DR-GAN-Distribution-Regularization-for-Text-to-Image-Generation | [
"eb1fad09bdc23842abeb8f278aaf2efbba6cdc33"
] | [
"model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.parallel\nfrom torch.autograd import Variable\nfrom torchvision import models\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn.functional as F\nimport copy \n\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\nfrom miscc.con... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LSTM",
"torch.nn.GRU",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.init.kaiming_normal_",
"torch.utils.model_zoo.load_url",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.exp",
"torch.sum",
"torch.sigmoid",
... |
Annonymous-code-release/HardCore-NAS | [
"ec5bcedb929373bf0b2539dcb918e7ce2bdadacd"
] | [
"timm/optim/rmsprop_tf.py"
] | [
"import torch\nfrom torch.optim import Optimizer\n\n\nclass RMSpropTF(Optimizer):\n \"\"\"Implements RMSprop algorithm (TensorFlow style epsilon)\n\n NOTE: This is a direct cut-and-paste of PyTorch RMSprop with eps applied before sqrt\n to closer match Tensorflow for matching hyper-params.\n\n Proposed ... | [
[
"torch.zeros_like",
"torch.ones_like"
]
] |
hsm207/tensorflow | [
"8ab4678ba216c3ec8fa32f417cb667b056689939",
"8ab4678ba216c3ec8fa32f417cb667b056689939",
"8ab4678ba216c3ec8fa32f417cb667b056689939",
"8ab4678ba216c3ec8fa32f417cb667b056689939"
] | [
"tensorflow/python/kernel_tests/init_ops_test.py",
"tensorflow/python/kernel_tests/sparse_ops_test.py",
"tensorflow/python/kernel_tests/shape_ops_test.py",
"tensorflow/python/client/timeline_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.python.ops.variables.Variable",
"numpy.dot",
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.python.ops.variable_scope.get_variable",
"numpy.mean",
"tensorflow.python.ops.partitioned_variables.variable_axis_size_partitioner",
"tensorflow.python.ops.random... |
BehlurOlderys/PEliminator | [
"a2bf1d926b9aeb09bb065d1414e2f4d2cbd22bcf"
] | [
"gui/functions/times_generator.py"
] | [
"import numpy as np\nfrom functions.global_settings import settings, us_in_1_second\nfrom tkinter import filedialog\nfrom datetime import date\n\n\nideal_speed_as_const = 1296000.0 / 86164.0\n\n\ndef get_data_from_correction_file(filepath):\n print(f\"Loaded correction data from {filepath}\")\n\n with open(fi... | [
[
"numpy.divide",
"numpy.add",
"numpy.ones_like",
"numpy.multiply"
]
] |
fishjojo/pycosmosac | [
"9984a0ca2c9093142de60112f4c9a7fe33865946"
] | [
"pycosmosac/sigma/sigma.py"
] | [
"import warnings\nimport simplejson as json\nimport numpy as np\nfrom scipy.spatial import distance\nfrom pycosmosac.utils import constants\n\n'''\nReferences:\n1. https://dx.doi.org/10.1021/acs.jctc.9b01016\n'''\n\n\nSIGMA_TEMPLATE = \"\"\"# meta: {meta:s}\n# Rows are given as: sigma [e/A^2] followed by a space, t... | [
[
"numpy.array",
"numpy.isin",
"numpy.zeros",
"numpy.sum",
"numpy.exp",
"numpy.arange",
"numpy.amax",
"numpy.amin",
"scipy.spatial.distance.cdist",
"numpy.floor"
]
] |
g2archie/UNET-MRI-RECONSTRUCTION | [
"126a9cd6a3992a3f07d9adc90af2447842d9c0a2"
] | [
"utils.py"
] | [
"from os.path import basename\nfrom os.path import join\n\nimport smtplib\nimport yaml\nimport h5py\nimport numpy\nimport socket\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom email.mime.text import MIMEText\nfrom email.mime.multipart import MIMEMultipart\nfrom email.mime.applic... | [
[
"numpy.array",
"numpy.random.shuffle"
]
] |
sedhha/URC2019 | [
"0838b9489c4cc7be2c9459c5fc8e75d46745590e"
] | [
"Focal_length_calculation/hsv_contouring.py"
] | [
"#HSV_INRANGEFINDER\r\nimport cv2\r\nimport numpy as np\r\ndef nothing(x):\r\n pass\r\ncv2.namedWindow('Image filtering')\r\ncv2.createTrackbar('I1','Image filtering',0,255,nothing)\r\ncv2.createTrackbar('I2','Image filtering',0,255,nothing)\r\ncv2.createTrackbar('I3','Image filtering',0,255,nothing)\r\ncv2.crea... | [
[
"numpy.array"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.