repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
sushmit0109/ASSC | [
"8beda6f3d055a35fff9ae2ff417b38a38e2a7fa5"
] | [
"codes/alt2train.py"
] | [
"from __future__ import print_function, absolute_import, division\nimport tensorflow as tf\n# from keras.backend.tensorflow_backend import set_session\n# config = tf.ConfigProto()\n# config.gpu_options.per_process_gpu_memory_fraction = 0.9\n# set_session(tf.Session(config=config))\nimport numpy as np\nfrom collecti... | [
[
"numpy.ones",
"pandas.read_csv",
"numpy.random.seed",
"numpy.expand_dims",
"tensorflow.set_random_seed",
"numpy.unique"
]
] |
awoo424/algotrading | [
"0ae284e40fd3f6bd9a88a73047b13473a0abe580"
] | [
"code/integrated-strategy/baseline.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib as mpl\nimport pandas as pd\nimport sys\n\nsys.path.append(\"..\")\nsys.path.append(\"../technical-analysis_python/\")\nmpl.use('tkagg') # issues with Big Sur\n\n# technical analysis\nfrom strategy.macd_crossover import macdCrossover\nfrom bac... | [
[
"pandas.read_csv",
"matplotlib.pyplot.show",
"matplotlib.pyplot.close",
"matplotlib.use",
"pandas.Timestamp"
]
] |
pnickl/mimo | [
"81c4bbd2594e2136445009eae752ab8a1602a1cf"
] | [
"examples/ilr/robot/wam/evaluate_wam_ilr.py"
] | [
"import os\n\nos.environ[\"OMP_NUM_THREADS\"] = \"1\"\n\nimport argparse\n\nimport numpy as np\nimport numpy.random as npr\n\nimport mimo\nfrom mimo.distributions import NormalWishart\nfrom mimo.distributions import GaussianWithNormalWishart\n\nfrom mimo.distributions import MatrixNormalWishart\nfrom mimo.distribut... | [
[
"numpy.vstack",
"numpy.load",
"numpy.ones",
"numpy.eye",
"sklearn.metrics.mean_squared_error",
"numpy.zeros",
"sklearn.decomposition.PCA",
"pandas.DataFrame",
"numpy.random.seed",
"numpy.array",
"numpy.std",
"sklearn.metrics.r2_score",
"numpy.random.randint",
... |
ryangillard/artificial_intelligence | [
"f7c21af221f366b075d351deeeb00a1b266ac3e3"
] | [
"machine_learning/gan/pgan/tf_pgan/pgan_module/trainer/discriminator.py"
] | [
"import tensorflow as tf\n\nfrom . import regularization\nfrom .print_object import print_obj\n\n\nclass Discriminator(object):\n \"\"\"Discriminator that takes image input and outputs logits.\n\n Fields:\n name: str, name of `Discriminator`.\n kernel_regularizer: `l1_l2_regularizer` object, reg... | [
[
"tensorflow.zeros",
"tensorflow.mod",
"tensorflow.minimum",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.subtract",
"tensorflow.multiply",
"tensorflow.reduce_mean",
"tensorflow.variable_scope",
"tensorflow.less",
"tensorflow.gradients",
"tensorflow.square",... |
rodosha98/FRPGitHomework | [
"0905c79ccc28d33f9385c09c03e8e18d8c720787"
] | [
"robopy/tests/test_common.py"
] | [
"# Created by: Aditya Dua\n# 25 July, 2017\n\"\"\"\nThis module contains all common helpful methods used in testing toolbox functionality\n\"\"\"\nimport numpy as np\nimport numpy.testing as npt\n\n\ndef matrix_mismatch_string_builder(rec_mat, exp_mat):\n expected_mat_str = np.array2string(np.asarray(exp_mat))\n... | [
[
"numpy.testing.assert_almost_equal",
"numpy.asarray"
]
] |
yc4ny/eft | [
"3e94efd9982d4ee25ffcfed9254590631264d94c"
] | [
"demo/visEFTFit.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport os\nfrom os.path import join\nfrom os import listdir\nfrom cv2 import FONT_HERSHEY_COMPLEX\n# import json\nimport numpy as np\n\nimport cv2\nimport pickle\nimport torch\n# from smplx import SMPL\nfrom eft.models import SMPL_19\n\nfrom eft.utils.imutils i... | [
[
"numpy.zeros",
"torch.from_numpy",
"numpy.array",
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.resize"
]
] |
Sanjana12111994/dataprep | [
"e94aae5ee73a650f86825432a8c8be04d46012d7"
] | [
"dataprep/eda/missing/compute.py"
] | [
"\"\"\"\n This module implements the plot_missing(df) function's\n calculating intermediate part\n\"\"\"\nfrom typing import Optional, Tuple, Union, List\n\nimport dask\nimport dask.array as da\nimport dask.dataframe as dd\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import rv_histogram\n\nfrom ... | [
[
"numpy.tile",
"pandas.DataFrame",
"numpy.argsort",
"numpy.repeat",
"numpy.maximum",
"numpy.concatenate",
"scipy.stats.rv_histogram",
"numpy.linspace",
"numpy.minimum"
]
] |
skeshaw/LoReNMT | [
"32ffd83f38258dfffd324f811695a44ad33954f5"
] | [
"fairseq/fairseq/criterions/nat_loss.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\r\n#\r\n# This source code is licensed under the MIT license found in the\r\n# LICENSE file in the root directory of this source tree.\r\n\r\nimport math\r\n\r\nimport torch.nn.functional as F\r\nfrom fairseq import utils\r\nimport torch\r\nfrom torch import Tenso... | [
[
"torch.nn.functional.log_softmax",
"torch.tensor"
]
] |
torlenor/word_embeddings | [
"74e9b4eb3ad4c89fa0c9319b07ff6c3e10f632d8"
] | [
"main.py"
] | [
"import glob\nfrom itertools import cycle\nfrom os import path\n\nimport numpy as np\nimport pandas as pd\nimport plotly.express as px\nimport plotly.graph_objs as go\nimport streamlit as st\nfrom gensim.models import KeyedVectors, Word2Vec\nfrom sklearn.cluster import KMeans\nfrom sklearn.decomposition import PCA\... | [
[
"pandas.DataFrame",
"numpy.reshape",
"sklearn.neighbors.KDTree",
"sklearn.cluster.KMeans",
"sklearn.manifold.TSNE",
"numpy.array",
"sklearn.decomposition.PCA"
]
] |
creativeautomaton/OpenPrompt | [
"bd9ea544ab144d94af32d245101ba35c9d5a5a65"
] | [
"tutorial/3.1_LMBFF.py"
] | [
"# %% [markdown]\n# ## Text Classification with LM-BFF.\n# In this tutorial, we do sentiment analysis with automatic template and verbalizer generation. We use SST-2 as an example.\n\n# %% [markdown]\n# ### 1. load dataset\n\n# %%\n# import argparse\n# parser = argparse.ArgumentParser(\"\")\n# parser.add_argument(\... | [
[
"torch.no_grad",
"torch.nn.CrossEntropyLoss",
"torch.argmax"
]
] |
guitarmind/HPA-competition-solutions | [
"547d53aaca148fdb5f4585526ad7364dfa47967d"
] | [
"wienerschnitzelgemeinschaft/src/shai/fastai/other_ensemble_scripts/enstw41.py"
] | [
"# individual nan corrected\n# Final nan matches highest probable label (optional)\n\nimport pandas as pd\nimport numpy as np\nfrom tqdm import tqdm\nimport matplotlib.pyplot as plt\n\nSAMPLE = '../input/sample_submission.csv'\n\nlabel_names = {\n 0: \"Nucleoplasm\",\n 1: \"Nuclear membrane\",\n ... | [
[
"pandas.read_csv",
"numpy.column_stack",
"numpy.asarray",
"numpy.delete",
"numpy.array",
"numpy.where",
"numpy.unique"
]
] |
MustafaAbbas110/FinalProject | [
"30d371f06a8a1875285cfd4a8940ca3610ec1274"
] | [
"Lib/site-packages/sklearn/metrics/tests/test_pairwise.py"
] | [
"from types import GeneratorType\n\nimport numpy as np\nfrom numpy import linalg\n\nfrom scipy.sparse import dok_matrix, csr_matrix, issparse\nfrom scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski\nfrom scipy.spatial.distance import cdist, pdist, squareform\n\nimport pytest\n\nfrom sklearn imp... | [
[
"sklearn.metrics.pairwise.PAIRED_DISTANCES.items",
"scipy.spatial.distance.pdist",
"numpy.ones",
"scipy.spatial.distance.cdist",
"numpy.sum",
"scipy.sparse.dok_matrix",
"sklearn.metrics.pairwise.check_paired_arrays",
"sklearn.metrics.pairwise.cosine_distances",
"sklearn.metrics... |
mrjojo11/malpaca-pub | [
"26fd3a7045288bed66d624e0f5593067ff05952d"
] | [
"storage/old_malpaca/mal-detection.py"
] | [
"#!/usr/bin/python3\n\nimport sys, dpkt, datetime, glob, os, operator, subprocess, csv\nimport socket\nimport matplotlib\nfrom collections import deque\nimport copy\nfrom itertools import permutations\nfrom dtw import dtw\nfrom fastdtw import fastdtw\nfrom math import log\nfrom sklearn.preprocessing import OneHotEn... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.annotate",
"sklearn.manifold.TSNE",
"numpy.array",
"scipy.spatial.distance.cosine",
"matplotlib.pyplot.scatter"
]
] |
vinclab/loan-customer-scoring | [
"896bccd6ac25eb4c5bcb45e5429272a1e9257430"
] | [
"model/Modules/cleaning59.py"
] | [
"#BANQUE DE FONCTIONS DE NETTOYAGE DE DATAFRAME - Vincent Salas\n\n# import des librairies dont nous aurons besoin\nimport pandas as pd\nimport numpy as np\n\n#-------------------------------------------------------------------------------------------------------------------------\n#NaN DATAFRAME\n#----------------... | [
[
"pandas.DataFrame"
]
] |
flymin/robustbench | [
"c51d44e5c9f9425d0a2146dbfd5c54d86ea11609"
] | [
"robustbench/model_zoo/cifar100.py"
] | [
"from collections import OrderedDict\n\nimport torch\n\nfrom robustbench.model_zoo.architectures.dm_wide_resnet import CIFAR100_MEAN, CIFAR100_STD, \\\n DMWideResNet, Swish\nfrom robustbench.model_zoo.architectures.resnet import PreActBlock, PreActResNet\nfrom robustbench.model_zoo.architectures.resnext import C... | [
[
"torch.tensor"
]
] |
fadykuzman/Rodeo-App | [
"408f4ada22c8e8f52ad37bd5e47d44d9302ebefe"
] | [
"src/readpot/read_pot.py"
] | [
"from time import time\nimport os\nimport pandas as pd\nfrom datetime import datetime\nimport csv\nfrom potentiostat import Potentiostat\n\n\ndef read_pots():\n devlist = os.listdir('/dev')\n\n coms = [c for c in devlist if c.startswith('ttyACM')]\n\n pots = {}\n for c in coms:\n p = Potentiostat... | [
[
"pandas.DataFrame"
]
] |
gdementen/numba | [
"78486e86ff9fbd343cac3dadbc63ec3bc66c75aa"
] | [
"numba/tests/test_sort.py"
] | [
"from __future__ import print_function\n\nimport copy\nimport itertools\nimport math\nimport random\n\nimport numpy as np\n\nfrom numba.compiler import compile_isolated, Flags\nfrom numba import jit, types, utils\nimport numba.unittest_support as unittest\nfrom numba import testing\nfrom .support import TestCase, M... | [
[
"numpy.empty",
"numpy.random.seed",
"numpy.random.random",
"numpy.isnan",
"numpy.sort",
"numpy.random.randint",
"numpy.array"
]
] |
Shreepadahs/computer_vision | [
"9380789c5fe47069aa58b33b59fdb15ead528e84"
] | [
"contrib/document_cleanup/light_weight_document_cleanup_ICDAR2021/infer.py"
] | [
"import tensorflow as tf\r\nfrom tensorflow.keras import datasets, layers, models\r\nfrom tensorflow.keras.models import Model, load_model\r\n\r\nfrom tensorflow.keras.models import model_from_json\r\nfrom tensorflow.keras.layers import Input, Add, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv... | [
[
"tensorflow.keras.models.model_from_json",
"tensorflow.convert_to_tensor"
]
] |
nestauk/funding_analytics_eu | [
"42fad368a90af2d0530ad83ac5c443c04fda1c73"
] | [
"eu_funding/utils/misc_utils.py"
] | [
"import numpy as np\n\ndef print_nested_structure(j, level=0):\n '''print_nested_structure\n Prints a list of all keys in a dictionary. The order and indentation shows any nested strucutre.\n \n Args:\n j (dict):\n level (int): Defaults to 0\n '''\n for k, v in j.items():\n pr... | [
[
"numpy.cumsum",
"numpy.zeros",
"numpy.squeeze",
"numpy.diff",
"numpy.take",
"numpy.issubdtype",
"numpy.array",
"numpy.where",
"numpy.unique"
]
] |
eartser/hyperstyle-analyze | [
"58e2d361662e73e1e047919f57ab840055783b7a"
] | [
"analysis/src/python/data_analysis/statistics/issues_change_statistics.py"
] | [
"import argparse\nimport logging\nimport sys\nfrom typing import List\n\nimport pandas as pd\n\nfrom analysis.src.python.data_analysis.model.column_name import IssuesColumns, SubmissionColumns\nfrom analysis.src.python.data_analysis.utils.df_utils import merge_dfs\nfrom analysis.src.python.data_analysis.utils.stati... | [
[
"pandas.read_csv",
"pandas.DataFrame.from_dict"
]
] |
forestyaser/HousePriceCrawler | [
"f0cf74128f9b6794f9ae6ebccc0356bb6d2f78f6"
] | [
"house_sigma/crawl_listing_url.py"
] | [
"import boto3\nfrom time import time\nimport sys\n# sys.stdout = open('log.txt', 'w')\n\nimport pandas as pd\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.options import Options\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.web... | [
[
"pandas.read_csv"
]
] |
jessicaaustin/CoTeDe | [
"0ca2a1c71de980d91262fd36fd5d8ab8cc09f019"
] | [
"tests/qctests/test_qc_tukey53H.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n\"\"\"\n\nimport numpy as np\nfrom numpy import ma\n\nfrom cotede.qctests import Tukey53H\nfrom data import DummyData\n\n\ndef test():\n profile = DummyData()\n\n profile.data['PRES'] = ma.masked_array([1.0, 100, 200, 300, 500, 5000])\n profile.dat... | [
[
"numpy.array",
"numpy.ma.masked_array",
"numpy.ma.allclose"
]
] |
vribeiro1/covid19 | [
"2528ec2e67bee5ff864a513940fb0525f98740b0"
] | [
"ards_prediction.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nimport shap\n\nfrom sklearn.model_selection import train_test_split\n\nfrom .utils.plot import (\n plot_results_1x2,\n plot_results_2x2,\n plot_shap_values,\n plot_survival,\n plot_sensitivity_specificity_vs_threshold\n)\nfrom .utils.preprocess imp... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split"
]
] |
antalszava/piquasso | [
"7ebff83145cfab44929114437c250852dff5f9a5"
] | [
"tests/api/program/test_blackbird.py"
] | [
"#\n# Copyright 2021 Budapest Quantum Computing Group\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 a... | [
[
"numpy.log"
]
] |
ValentinMouret/probability | [
"7ea6cc55e5b3fed04372cd188cd0764e92fd3cf4"
] | [
"tensorflow_probability/python/bijectors/tanh_test.py"
] | [
"# Copyright 2018 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.to_double",
"numpy.linspace",
"numpy.tanh",
"tensorflow.test.main"
]
] |
kcui/elpips | [
"87a844451aec278042f33ccd98a1d230c0773b50"
] | [
"elpips/elpips.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport itertools \nimport numbers\n\nfrom . import networks\nfrom . import pnetlin\nfrom . util import switch_case_cond, switch_case_where, for_each, as_tuple\n\n\n### Configuring E-LPIPS.\n\t\nclass Config:\n\tdef __init__(self):\n\t\tself.metric = 'vgg_ensemble'\n\t\t... | [
[
"tensorflow.reshape",
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"tensorflow.less",
"tensorflow.clip_by_value",
"tensorflow.constant",
"tensorflow.transpose",
"tensorflow.sin",
"numpy.deg2rad",
"tensorflow.stack",
"tensorflow.shape",
"tensorflow.contrib.im... |
amitdev81296/tensorflow | [
"b8bbded3c633c56b876a5600c25fdf9224c0f1ad"
] | [
"Lib/site-packages/tensorflow/python/ops/gen_array_ops.py"
] | [
"\"\"\"Python wrappers around TensorFlow ops.\r\n\r\nThis file is MACHINE GENERATED! Do not edit.\r\n\"\"\"\r\n\r\nimport collections as _collections\r\nimport six as _six\r\n\r\nfrom tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow\r\nfrom tensorflow.python.eager import context as _context\r\nfrom ... | [
[
"tensorflow.python.eager.execute.make_type",
"tensorflow.python.eager.execute.make_int",
"tensorflow.python.util.deprecation.deprecated_endpoints",
"tensorflow.python.framework.op_def_library.OpDefLibrary",
"tensorflow.python.eager.execute.convert_to_mixed_eager_tensors",
"tensorflow.pytho... |
bzhai/Ubi-SleepNet | [
"27837827dec608d06659421d073872fb1f68453e"
] | [
"data_loader/raw_data_loader.py"
] | [
"from utilities.utils import build_windowed_data\nfrom utilities.utils import load_h5_df_train_test_dataset, get_data, cast_sleep_stages\nfrom sleep_stage_config import *\nfrom sklearn.model_selection import train_test_split\n\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nimport pandas as pd\nimp... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"numpy.arange",
"torch.from_numpy",
"numpy.expand_dims",
"torch.cuda.is_available",
"numpy.concatenate"
]
] |
thangvubk/SphereRPN | [
"9b154256774437bb23d81e22990d350555d39b81"
] | [
"model/pointgroup/backbone.py"
] | [
"import torch\nimport torch.nn as nn\nimport spconv\nfrom spconv.modules import SparseModule\nfrom collections import OrderedDict\n\n\nclass ResidualBlock(SparseModule):\n def __init__(self, in_channels, out_channels, norm_fn, indice_key=None):\n super().__init__()\n\n if in_channels == out_channel... | [
[
"torch.nn.ReLU",
"torch.cat",
"torch.nn.Identity"
]
] |
ofgulban/segmentator | [
"343a410bf7d34cad267b1a95b3b66a8020dfdc5e"
] | [
"segmentator/segmentator_main.py"
] | [
"#!/usr/bin/env python\n\"\"\"Processing input and plotting.\"\"\"\n\nfrom __future__ import division, print_function\nimport numpy as np\nimport segmentator.config as cfg\nimport matplotlib\nmatplotlib.use(cfg.matplotlib_backend)\nprint(\"Matplotlib backend: {}\".format(matplotlib.rcParams['backend']))\nimport mat... | [
[
"numpy.ones",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"numpy.reshape",
"matplotlib.widgets.Button",
"matplotlib.pyplot.axes",
"numpy.arange",
"matplotlib.widgets.LassoSelector",
"matplotlib.pyplot.show",
"numpy.power",
"matplotlib.path.P... |
lilianatang/data-modelling-with-postgresql | [
"4b5d057d23c346cc36695dc0548f11908aeb5431"
] | [
"mypython/Lib/site-packages/pandas/tests/indexes/categorical/test_formats.py"
] | [
"\"\"\"\r\nTests for CategoricalIndex.__repr__ and related methods.\r\n\"\"\"\r\nimport pandas._config.config as cf\r\n\r\nfrom pandas import CategoricalIndex\r\n\r\n\r\nclass TestCategoricalIndexRepr:\r\n def test_string_categorical_index_repr(self):\r\n # short\r\n idx = CategoricalIndex([\"a\", ... | [
[
"pandas.CategoricalIndex",
"pandas._config.config.option_context"
]
] |
dumpmemory/Transformer-Explainability | [
"951e112d24c1a642ceefeb0dd03a607040305383"
] | [
"utils/saver.py"
] | [
"import os\nimport torch\nfrom collections import OrderedDict\nimport glob\n\n\nclass Saver(object):\n\n def __init__(self, args):\n self.args = args\n self.directory = os.path.join('run', args.train_dataset, args.checkname)\n self.runs = sorted(glob.glob(os.path.join(self.directory, 'experi... | [
[
"torch.save"
]
] |
kujaku11/mth5 | [
"b7681335871f3cd1b652276fd93c08554c7538ff"
] | [
"tests/test_filters.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue May 11 10:35:30 2021\n\n:copyright: \n Jared Peacock (jpeacock@usgs.gov)\n\n:license: MIT\n\n\"\"\"\n# =============================================================================\n# Imports\n# =====================================================================... | [
[
"numpy.array",
"numpy.allclose"
]
] |
ghgh3269/compression | [
"3e920bc49fa32d79c1c2917583ffb663c6ebac85"
] | [
"tensorflow_compression/python/ops/math_ops_test.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2018 Google LLC. 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... | [
[
"tensorflow.ones_like",
"tensorflow.placeholder",
"tensorflow.test.main"
]
] |
MECLabTUDA/OOD-Gen | [
"f85ea9106ae1425f18e34c9d82fa3ca4925d8d9e"
] | [
"mp/agents/segmentation_semisup_domain_pred_IRM_seg_agent.py"
] | [
"import torch\n\nfrom mp.agents.segmentation_semisup_domain_pred_agent import SegmentationSemisupDomainPredictionAgent\nfrom mp.data.pytorch.domain_prediction_dataset_wrapper import DomainPredictionDatasetWrapper\nfrom mp.eval.accumulator import Accumulator\nfrom mp.eval.inference.predict import softmax\nfrom mp.ut... | [
[
"torch.cat"
]
] |
Jean1995/Masterarbeit | [
"d7d6c4a2031f715fa788cc8d498f339d2df675ee"
] | [
"shower/plot_shower.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport sys\nimport matplotlib\nimport matplotlib.cm as cm\nfrom matplotlib.lines import Line2D\n\nfrom matplotlibconfig import *\n\nx_i_list, y_i_list, z_i_list, x_f_list, y_f_list, z_f_list, ID_list, energy_i_list = np.g... | [
[
"matplotlib.lines.Line2D",
"numpy.matmul",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.show... |
ZhekehZ/catboost | [
"de75c6af12cf490700e76c22072fbdc15b35d679"
] | [
"contrib/python/scipy/scipy/sparse/csr.py"
] | [
"\"\"\"Compressed Sparse Row matrix format\"\"\"\n\nfrom __future__ import division, print_function, absolute_import\n\n__docformat__ = \"restructuredtext en\"\n\n__all__ = ['csr_matrix', 'isspmatrix_csr']\n\n\nimport numpy as np\nfrom scipy._lib.six import xrange\n\nfrom .base import spmatrix\n\nfrom ._sparsetools... | [
[
"numpy.atleast_2d",
"numpy.empty",
"numpy.zeros",
"scipy._lib.six.xrange",
"numpy.asarray",
"numpy.size",
"numpy.asmatrix"
]
] |
NVlabs/oscar | [
"df778a4173a118f10627cb2ef4021c26303231fc"
] | [
"oscar/controllers/joint_tor.py"
] | [
"# ---------------------------------------------------------------\n# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# This work is licensed under the NVIDIA Source Code License\n# for OSCAR. To view a copy of this license, see the LICENSE file.\n# -------------------------------------------------... | [
[
"torch.zeros",
"torch.arange"
]
] |
rmunoz12/tensorpack | [
"60f4c6df7c4a27b553469352dd6ce73333db1ec6"
] | [
"tensorpack/tfutils/tower.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# File: tower.py\n\n\nimport tensorflow as tf\nfrom six.moves import zip\n\nfrom ..utils import logger\nfrom ..utils.argtools import call_only_once\nfrom ..utils.naming import MOVING_SUMMARY_OPS_KEY\nfrom ..utils.develop import HIDE_DOC\nfrom .collection import Colle... | [
[
"tensorflow.name_scope",
"tensorflow.variable_scope",
"tensorflow.get_default_graph",
"tensorflow.get_variable_scope"
]
] |
ZLLentz/lcls2 | [
"3edbea556779f619944ee9b97fb33cd815a19a37"
] | [
"psana/psana/detector/UtilsGraphics.py"
] | [
"\"\"\"\n Wrapper for graphical utils.\n\n from psana.psana.detector.UtilsGraphics import *\n from psana.psana.detector.UtilsGraphics import gr, fleximage, arr_median_limits\n\n img = det.raw.image(evt)\n arr = det.raw.calib(evt)\n amin, amax = arr_median_limits(arr, nneg=1, npos=3)\n\n flimg =... | [
[
"numpy.abs",
"numpy.median",
"numpy.quantile"
]
] |
AIRI-Institute/uncertainty_transformers | [
"982b5ae8b39cb484ce3559a72f95d18f30487e38"
] | [
"src/run_ner_ood.py"
] | [
"\"\"\" Finetuning the library models for sequence classification on GLUE (Bert, XLM, XLNet, RoBERTa, Albert, XLM-RoBERTa).\"\"\"\n\nimport warnings\n\nwarnings.simplefilter(action=\"ignore\", category=FutureWarning)\n\nimport os\nimport sys\nimport dataclasses\nfrom dataclasses import dataclass, field\nfrom typing... | [
[
"torch.utils.data.Subset",
"numpy.asarray",
"numpy.argmax"
]
] |
psorianom/rescuescore | [
"9a647cbc1fc94f9a1ea265443295e84170da81f6"
] | [
"rescuetime_wrapper.py"
] | [
"# coding: utf-8\nfrom datetime import date, timedelta\n\nimport pandas as pd\n\nfrom rescuetime.api.service import Service\nfrom rescuetime.api.access import AnalyticApiKey\n\n\ndef get_apikey():\n with open(\"apikey\", \"r\") as fileo:\n key = fileo.read()\n return key\n\n\napikey = get_apikey()\n\n\... | [
[
"pandas.DataFrame"
]
] |
ETHZ-TEC/exot_eengine | [
"7b7ce6cb949e1b0a02e716b03f2f9af751713b29"
] | [
"exot/util/plotting.py"
] | [
"# Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich)\n# 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 are met:\n# \n# * Redistributions of source code must retain the abov... | [
[
"matplotlib.pyplot.gca",
"numpy.repeat",
"numpy.asarray",
"matplotlib.collections.LineCollection",
"matplotlib.transforms.blended_transform_factory"
]
] |
sokunmin/mmdetection | [
"2d8ef6ad36dae912dba71f83934e7dd5a0ced3eb"
] | [
"mmdet/models/dense_heads/corner_head.py"
] | [
"from abc import abstractmethod\nfrom math import ceil, log\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import ConvModule, bias_init_with_prob\nfrom mmcv.ops import CornerPool, batched_nms\n\nfrom mmdet.core import multi_apply\nfrom ..builder import HEADS, build_loss\nfrom... | [
[
"torch.ones_like",
"torch.stack",
"torch.nn.functional.max_pool2d",
"torch.argsort",
"torch.zeros_like",
"torch.topk",
"torch.nn.Conv2d",
"torch.nn.ModuleList",
"torch.nn.Sequential",
"torch.nn.Identity",
"torch.abs",
"torch.nn.ReLU"
]
] |
Flsahkong/faster-rcnn.pytorch | [
"f2b4753f3ca86a19c2701d28aa135a81b2a21c25"
] | [
"test_net.py"
] | [
"# --------------------------------------------------------\n# Pytorch Multi-GPU Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick\n# --------------------------------------------------------\nfrom __future__ import absolu... | [
[
"torch.utils.data.DataLoader",
"torch.FloatTensor",
"numpy.tile",
"torch.nonzero",
"torch.load",
"numpy.sort",
"torch.autograd.Variable",
"numpy.random.seed",
"torch.no_grad",
"numpy.copy",
"torch.cuda.is_available",
"numpy.array",
"numpy.where",
"torch.Long... |
meraviverma/Spark | [
"d4c6ec6ba77effeda78302e13a637e3fe4205e80"
] | [
"python/pyspark/sql/pandas/conversion.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.dtype",
"pandas.DataFrame.from_records",
"pandas.api.types.is_datetime64tz_dtype",
"pandas.api.types.is_datetime64_dtype"
]
] |
njustkmg/PaddleMM | [
"92ae66d6e27c7a666820bc7baf8fd8fa2bd74aa5"
] | [
"torchmm/models/retrieval/sgraf.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport numpy as np\n\nfrom .layers.contrastive import ContrastiveLoss\nfrom .layers.utils import l1norm, l2norm\nfrom .layers.img_enc import EncoderImage\nfrom .layers.txt_enc import EncoderText\n\n\nclass VisualSA(nn.Module):\n \"\"\"\n ... | [
[
"torch.nn.functional.softmax",
"torch.sub",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.Sigmoid",
"torch.bmm",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.BatchNorm1d",
"torch.nn.Softmax",
"torch.mean",
"torch.transpose",
"torch.FloatTensor",
"torch... |
aianaconda/pytorch-GNN-1st | [
"0c911e23fcc6cad07ac17cb16c1bb769f9cef63e"
] | [
"code_28_GCN.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: 代码医生工作室\r\n@公众号:xiangyuejiqiren (内有更多优秀文章及学习资料)\r\n@来源: <PyTorch深度学习和图神经网络(卷 1)——基础知识>配套代码 \r\n@配套代码技术支持:bbs.aianaconda.com \r\nCreated on Sat Oct 19 20:03:44 2019\r\n\"\"\"\r\n\r\nfrom pathlib import Path #提升路径的兼容性\r\n#引入矩阵运算相关库\r\nimport numpy as np\r\nimport pand... | [
[
"numpy.ones",
"torch.nn.init.xavier_uniform_",
"torch.mm",
"numpy.random.seed",
"torch.cuda.is_available",
"torch.nn.init.zeros_",
"torch.nn.functional.softplus",
"torch.nn.init.kaiming_uniform_",
"torch.nn.functional.dropout",
"torch.device",
"numpy.unique",
"matpl... |
rkingsbury/atomate | [
"d26b65d5c46882d9585f14188514d9a65276336c"
] | [
"atomate/qchem/tests/test_drones.py"
] | [
"# Copyright (c) Materials Virtual Lab.\n# Distributed under the terms of the BSD License.\n\nimport os\nimport unittest\nfrom monty.serialization import loadfn\nfrom atomate.qchem.drones import QChemDrone\nfrom pymatgen.core.structure import Molecule\nimport numpy as np\nfrom pymatgen.analysis.local_env import Ope... | [
[
"numpy.array"
]
] |
Research-lab-KUMS/NeoAnalysis | [
"c5f25b71e16997f3a05f70b1eead11f99a3b7e2b"
] | [
"NeoAnalysis_Py2.7/NeoAnalysis/neo/io/nixio.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) 2016, German Neuroinformatics Node (G-Node)\n# Achilleas Koutsou <achilleas.k@gmail.com>\n#\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted under the terms of the BSD License... | [
[
"numpy.array",
"numpy.empty",
"numpy.transpose",
"numpy.shape"
]
] |
iclavera/meta-mb | [
"a1204e573c1415161129403cfb287bf120488fd0"
] | [
"meta_mb/envs/mb_envs/swimmer.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport os\n\nimport numpy as np\nimport tensorflow as tf\nfrom gym import utils\nfrom gym.envs.mujoco import mujoco_env\nfrom meta_mb.meta_envs.base import MetaEnv\n\n\nclass SwimmerEnv(MetaEnv, mujoco... | [
[
"numpy.copy",
"numpy.clip",
"tensorflow.square",
"numpy.concatenate",
"numpy.square"
]
] |
ai-xiaotong/face-benchmark | [
"4a4a336be6df72699120d6f0a4b7160904375cb0"
] | [
"run_evaluation.py"
] | [
"import os\nfrom itertools import islice\nimport numpy as np\nimport argparse\nimport matplotlib\nmatplotlib.use('agg')\nimport matplotlib.pyplot as plt\n\nfrom helper import roc, find_TAR_and_TH_by_FAR\n\n\ndef get_roc(path, start=1., stop=100., step=0.1):\n batch_size = 1000\n scores, gts = [], []\n with... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.xlabel"
]
] |
willBear/willBear-Fundamental_Analysis | [
"bc67eb1e69dcf6765c0b77314d37f7f165a7318f"
] | [
"venv/lib/python3.8/site-packages/pyqtgraph/graphicsItems/CurvePoint.py"
] | [
"from ..Qt import QtGui, QtCore\nfrom . import ArrowItem\nimport numpy as np\nfrom ..Point import Point\nimport weakref\nfrom .GraphicsObject import GraphicsObject\n\n__all__ = ['CurvePoint', 'CurveArrow']\nclass CurvePoint(GraphicsObject):\n \"\"\"A GraphicsItem that sets its location to a point on a PlotCurveI... | [
[
"numpy.clip"
]
] |
toddharryreeb/pandas | [
"6f7ca38be192159afb5d899f41552a5181aa2794"
] | [
"pandas/tests/indexes/datetimes/test_construction.py"
] | [
"from datetime import timedelta\nfrom operator import attrgetter\nfrom functools import partial\n\nimport pytest\nimport pytz\nimport numpy as np\n\nimport pandas as pd\nfrom pandas import offsets\nimport pandas.util.testing as tm\nfrom pandas._libs.tslib import OutOfBoundsDatetime\nfrom pandas._libs.tslibs import ... | [
[
"pandas.DatetimeIndex",
"pandas.util.testing.assert_raises_regex",
"pandas.date_range",
"pandas.util.testing.assert_numpy_array_equal",
"pandas.offsets.Week",
"pandas.offsets.QuarterBegin",
"pandas.datetime",
"pandas.offsets.BQuarterEnd",
"pandas.offsets.BDay",
"numpy.arang... |
Bill-Software-Engineer/trading-technical-indicators | [
"f7d3478c054595106afe34f08483218afe9c4ba1"
] | [
"tests/test_indicator_market_facilitation_index.py"
] | [
"\"\"\"\nTrading-Technical-Indicators (tti) python library\n\nFile name: test_indicator_market_facilitation_index.py\n tti.indicators package, _market_facilitation_index.py module unit tests.\n\"\"\"\n\nimport unittest\nimport tti.indicators\nfrom test_indicators_common import TestIndicatorsCommon\n\nimport pand... | [
[
"pandas.read_csv"
]
] |
red-tie/DRLib | [
"42398bd696b7cedc8f207385f8eac4e264bd9c4e"
] | [
"spinup_utils/plot.py"
] | [
"import seaborn as sns\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport json\nimport os\nimport os.path as osp\nimport numpy as np\n\nDIV_LINE_WIDTH = 50\n\n# Global vars for tracking and labeling data at load time.\nexp_idx = 0\nunits = dict()\n\n\ndef plot_data(data, xaxis='Epoch', value=\"TestEpRet\... | [
[
"numpy.ones",
"matplotlib.pyplot.ticklabel_format",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.figure",
"numpy.asarray",
"matplotlib.pyplot.show",
"pandas.concat",
"numpy.convolve"
]
] |
achilleas-k/brian-scripts | [
"4d2d8c9a53e7202b60c78716e8b1a9d521293c54"
] | [
"python_matlab_comparison/st_distance.py"
] | [
"from __future__ import print_function\nimport os\nimport sys\nimport subprocess as subp\nimport numpy as np\nimport scipy.io as scio\nimport spike_distance as sd\nimport spike_distance_mp as sdm\nimport metrics\n\n\n\ndef octave_spkd(st_one, st_two, cost):\n \"\"\"\n Creates an octave `m` file to run the spi... | [
[
"scipy.io.loadmat",
"numpy.abs",
"numpy.random.random",
"scipy.io.savemat",
"numpy.random.randint"
]
] |
dheeraj7596/MixText-LongTail | [
"929bee28bd4536cb475efff0dffad7b3cb2d2ac1"
] | [
"code/train.py"
] | [
"import argparse\nimport os\nimport random\nimport math\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.data as Data\nfrom transformers_dir import *\nfrom torch.autograd import Variable\nfrom torch.utils.data import Dataset, WeightedRandomSampler\n\nfr... | [
[
"torch.utils.data.DataLoader",
"numpy.multiply",
"sklearn.metrics.classification_report",
"torch.nn.functional.softmax",
"torch.no_grad",
"torch.cuda.is_available",
"torch.max",
"torch.cat",
"torch.softmax",
"numpy.append",
"sklearn.feature_extraction.text.TfidfVectoriz... |
aday651/embed-asym-exeriments | [
"986f147425c3e4f42c04a25f69577bbeef6b3c23"
] | [
"custom_scripts/skipgram_modified.py"
] | [
"import tensorflow as tf\nfrom custom_scripts.node_classifier_modified import make_node_classifier\n\n\ndef make_skipgram(**kwargs):\n \"\"\" Uses the skipgram objective for relational data\n\n Returns\n -------\n A model function for skipgram edge prediction (with a nonsense vertex classifier attached ... | [
[
"tensorflow.nn.sigmoid_cross_entropy_with_logits",
"tensorflow.equal",
"tensorflow.stack",
"tensorflow.shape",
"tensorflow.gather_nd",
"tensorflow.range",
"tensorflow.keras.regularizers.l2",
"tensorflow.expand_dims",
"tensorflow.matmul",
"tensorflow.squeeze",
"tensorflo... |
gabrielmacedoanac/kgextension | [
"0551ca278bc3de5c39baf663467be3220ad20edd"
] | [
"test/test_link_exploration.py"
] | [
"import pandas as pd\nimport pytest\nfrom kgextension.link_exploration import link_explorer\n\nclass TestLinkExplorer:\n\n def test1_default(self):\n df_input = pd.read_csv(\"test/data/link_exploration/link_exploration_test_input.csv\")\n expected_result = pd.read_csv(\"test/data/link_exploration/l... | [
[
"pandas.read_csv",
"pandas.testing.assert_frame_equal"
]
] |
sevmardi/Social_network_analysis | [
"d299fc0120f12c2ad8ca871cad160a66873dcae0"
] | [
"Questions/Question2_3.py"
] | [
"import networkx as nx\nimport helpers.DataLoader as dataLoader\nimport matplotlib.pyplot as plt\nimport helpers.DataLoader as data\n\n\nclass Question2_3:\n\n def main(self):\n \"\"\"\n Caclulate the indegree and outdegree distribution of the given graph\n \"\"\"\n # Load the data\n ... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.xlabel"
]
] |
sslowikatpalantir/spark | [
"f9dddebf019da89d8611e11e1f12bc8864c17419"
] | [
"python/pyspark/sql/tests/test_pandas_udf_grouped_map.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... | [
[
"pandas.DataFrame",
"pandas.DataFrame.from_items"
]
] |
DevinCheung/ColossalAI | [
"632e622de818697f9949e35117c0432d88f62c87"
] | [
"setup.py"
] | [
"import os\nimport subprocess\nimport sys\n\nimport torch\nfrom setuptools import setup, find_packages\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension, CUDA_HOME\n\n# ninja build does not work unless include_dirs are abs path\nthis_dir = os.path.dirname(os.path.abspath(__file__))\n\n\ndef get_c... | [
[
"torch.utils.cpp_extension.CUDAExtension",
"torch.cuda.is_available",
"torch.version.cuda.split",
"torch.__version__.split"
]
] |
JackDanger/tensorflow | [
"5d615f2f05d6ecfc37951ef574e359829cb9e3e0"
] | [
"tensorflow/python/keras/backend.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.nn.relu6",
"tensorflow.python.keras.engine.base_layer_utils.call_context",
"tensorflow.python.framework.ops.get_default_session",
"tensorflow.python.ops.array_ops.pad",
"numpy.asarray",
"tensorflow.python.ops.math_ops.reduce_min",
"tensorflow.python.ops.array_ops... |
nicoloverardo/master-degree-thesis | [
"0b36bf181ed6a00c2c0ab31acf52fba0fd5fa8f2"
] | [
"src/sird.py"
] | [
"import pandas as pd\nimport numpy as np\n\nfrom scipy.integrate import odeint\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import mean_absolute_error, mean_squared_error\n\n\ndef logistic_R0(t, R_0_start, k, x0, R_0_end):\n \"\"\"\n R0 moduled as logistic function\n \"\"\"\n\n ... | [
[
"scipy.integrate.odeint",
"numpy.empty",
"numpy.zeros",
"numpy.diff",
"numpy.append",
"numpy.isinf",
"sklearn.linear_model.LinearRegression",
"numpy.exp",
"pandas.concat",
"pandas.DateOffset",
"numpy.round",
"numpy.nan_to_num",
"pandas.Timestamp"
]
] |
ParikhKadam/NeMo | [
"ee11f7c4666d410d91f9da33c61f4819ea625013"
] | [
"nemo/collections/asr/parts/numba_utils.py"
] | [
"# Copyright 2020 NVIDIA. 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 applicab... | [
[
"numpy.abs",
"numpy.exp",
"numpy.mod",
"numpy.arange",
"numpy.angle",
"numpy.round",
"numpy.pad"
]
] |
guillermo-carrasco/bcbio-nextgen-vm | [
"74c53e72ea722c01b8c12b7dcf1703f79e377612"
] | [
"bcbiovm/docker/devel.py"
] | [
"\"\"\"Utilities to help with developing using bcbio inside of docker.\n\"\"\"\nimport copy\nimport datetime\nimport glob\nimport math\nimport os\nimport shutil\nimport subprocess\nimport sys\n\nimport boto\nimport numpy\nimport yaml\n\nfrom bcbio import utils\nfrom bcbio.distributed import objectstore\nfrom bcbio.... | [
[
"numpy.median"
]
] |
windwiki/featuretools | [
"372f513c8915e602d465069184128b9654a12d97"
] | [
"featuretools/tests/primitive_tests/test_transform_features.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pytest\n\nimport featuretools as ft\nfrom featuretools.computational_backends.feature_set import FeatureSet\nfrom featuretools.computational_backends.feature_set_calculator import (\n FeatureSetCalculator\n)\nfrom featuretools.primitives import (\n Absolute,\n ... | [
[
"numpy.allclose",
"pandas.Series",
"pandas.read_csv",
"pandas.DataFrame",
"numpy.isnan",
"numpy.array",
"pandas.isnull",
"pandas.Timestamp"
]
] |
robertopreste/prestools | [
"5c3a66ce981f374de2e6bdc2d7c927ee5b51b9bb"
] | [
"tests/test_clustering.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n# Created by Roberto Preste\nimport pytest\nimport prestools.clustering as pc\nimport numpy as np\n\n\n# pc.hierarchical_clustering\n\ndef test_hierarchical_clustering_empty_df(sample_empty_df):\n expect = None\n result = pc.hierarchical_clustering(sample_empty... | [
[
"numpy.array",
"numpy.allclose"
]
] |
Aliang-CN/GATNE | [
"b31cb7e3cf0ea4edaf5c2d848bc02d7d47db4f24"
] | [
"src/utils.py"
] | [
"import argparse\nfrom collections import defaultdict\n\nimport networkx as nx\nimport numpy as np\nfrom gensim.models.keyedvectors import Vocab\nfrom six import iteritems\nfrom sklearn.metrics import (auc, f1_score, precision_recall_curve,\n roc_auc_score)\n\nfrom walk import RWGraph\n\... | [
[
"sklearn.metrics.auc",
"sklearn.metrics.f1_score",
"sklearn.metrics.roc_auc_score",
"numpy.array",
"sklearn.metrics.precision_recall_curve",
"numpy.dot",
"numpy.linalg.norm"
]
] |
kajal-puri/torchgeometry | [
"36c4992d5f741a65a1f558266c588e37c24462da"
] | [
"test/common.py"
] | [
"import torch\n\n\ndef get_test_devices():\n \"\"\"Creates a string list with the devices type to test the source code.\n CUDA devices will be test only in case the current hardware supports it.\n\n Return:\n list(str): list with devices names.\n \"\"\"\n devices = [\"cpu\"]\n if torch.cuda... | [
[
"torch.cuda.is_available"
]
] |
BogiHsu/Tacotron2-PyTorch | [
"aafde3845828fc3b9df796e60607e0de67873409"
] | [
"train.py"
] | [
"import os\nimport time\nimport torch\nimport argparse\nimport numpy as np\nfrom inference import infer\nfrom utils.util import mode\nfrom hparams import hparams as hps\nfrom torch.utils.data import DataLoader\nfrom utils.logger import Tacotron2Logger\nfrom utils.dataset import ljdataset, ljcollate\nfrom model.mode... | [
[
"torch.utils.data.DataLoader",
"torch.load",
"torch.cuda.manual_seed",
"torch.optim.lr_scheduler.LambdaLR",
"torch.manual_seed",
"numpy.random.seed"
]
] |
cors/hls4ml | [
"d75e350b788a1114f4b50377f89bacf98dd99138"
] | [
"hls4ml/writer/vivado_writer.py"
] | [
"from __future__ import print_function\nimport tarfile\nimport yaml\nfrom shutil import copyfile, copytree, rmtree\nimport numpy as np\nimport os\nimport re\nimport glob\nfrom collections import OrderedDict\n\nfrom hls4ml.writer.writers import Writer\nfrom hls4ml.model.hls_layers import XnorPrecisionType\n\nconfig_... | [
[
"numpy.load",
"numpy.max",
"numpy.min"
]
] |
SincereJoy/SSAH_CVPR2018 | [
"82ada6db1048e51e14cd1c98469b837c78b7584e"
] | [
"load_data.py"
] | [
"import h5py\nimport numpy as np\n\ndef loading_data(path):\n\tprint('******************************************************')\n\tprint('dataset:{0}'.format(path))\n\tprint('******************************************************')\n\n\tfile = h5py.File(path,'r')\n\timages = file['images'][:].transpose(0,3,2,1)\n\tl... | [
[
"numpy.random.permutation"
]
] |
kaching-out-of-ammo/Excel_Weighbridge | [
"3d5ccd52fa659df313bed0624e05d7fda353c1a9"
] | [
"test.py"
] | [
"from picamera.array import PiRGBArray\r\nfrom picamera import PiCamera\r\nimport cv2\r\nimport time\r\nfrom threading import Thread\r\nimport imutils\r\nimport numpy as np\r\nfrom pyzbar.pyzbar import decode\r\n\r\n\r\ncamera = PiCamera()\r\ncamera.resolution = (800, 608)\r\ncamera.framerate = 32\r\nrawCapture1 = ... | [
[
"numpy.array"
]
] |
obsmax/seispy | [
"1ed5064dbcfeb4ceebf20b59b97e588609c5b8ab"
] | [
"seispy/stream.py"
] | [
"from copy import deepcopy\nimport numpy as np\nfrom numpy.lib.npyio import _savez\nfrom matplotlib.collections import LineCollection\nimport matplotlib.pyplot as plt\nfrom seispy.trace import Trace, FourierDomainTrace\nfrom seispy.errors import EmptyStreamError, DataTypeError, \\\n SamplingError, SamplingRateEr... | [
[
"numpy.dtype",
"numpy.argsort",
"numpy.asarray",
"matplotlib.pyplot.gca",
"numpy.in1d",
"numpy.abs",
"matplotlib.pyplot.get_cmap",
"numpy.random.rand",
"numpy.isnan",
"numpy.load",
"numpy.column_stack",
"numpy.arange",
"numpy.hstack",
"numpy.max",
"numpy... |
mintar/mseg-api | [
"df7b899b47b33ad82dcbf17c289856a1f1abea22"
] | [
"tests/test_conn_comp.py"
] | [
"#!/usr/bin/python3\n\nimport numpy as np\n\nfrom mseg.utils.conn_comp import scipy_conn_comp\n\n\ndef test_scipy_conn_comp():\n\t\"\"\" Make sure we can recover a dictionary of binary masks for each conn. component\"\"\"\n\t\n\t# toy semantic label map / label image\n\timg = np.array(\n\t\t[\n\t\t\t[1,1,2,3],\n\t\... | [
[
"numpy.array",
"numpy.allclose"
]
] |
mihaichris/search_with_machine_learning_course | [
"17134e63862dd65906012acb2b326f54d06de761"
] | [
"week4/create_labeled_queries.py"
] | [
"import os\nimport argparse\nimport xml.etree.ElementTree as ET\nimport pandas as pd\nimport numpy as np\nimport csv\nimport string\n\nfrom nltk.stem.snowball import SnowballStemmer\n\n# Useful if you want to perform stemming.\nimport nltk\nstemmer = nltk.stem.PorterStemmer()\n\ndef prepare_word(word):\n word = ... | [
[
"pandas.read_csv",
"numpy.select"
]
] |
zhyhan/spine-reports-gene | [
"a07b842594f33c5bf0b9095f82664857fe7be2ae"
] | [
"nets/preprocessing.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\n\n\ndef data_augmentation(image, is_training=None):\n \n if is_training:\n return preprocess_for_train(image)\n \n else:\n return preprocess_for_eva... | [
[
"tensorflow.image.random_contrast"
]
] |
shoyer/bottleneck | [
"aa71a26fe5ef4127df86276c1ee6b5ba8f6dcc5b"
] | [
"setup.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport sys\n\ntry:\n import setuptools # noqa\nexcept ImportError:\n from ez_setup import use_setuptools\n use_setuptools()\n\nfrom setuptools import setup, find_packages\nfrom setuptools.extension import Extension\nfrom setuptools.command.build_ext import build_ext as... | [
[
"numpy.get_include"
]
] |
pgtinsley/deepface | [
"156d8a2a1a38fe7234cfcf3b09b517b9b062e8da"
] | [
"api/api.py"
] | [
"from flask import Flask, jsonify, request, make_response\n\nimport argparse\nimport uuid\nimport json\nimport time\nfrom tqdm import tqdm\n\nimport tensorflow as tf\n\nfrom deepface import DeepFace\nfrom deepface.basemodels import VGGFace, OpenFace, Facenet, FbDeepFace, DeepID\nfrom deepface.basemodels.DlibResNet ... | [
[
"tensorflow.get_default_graph"
]
] |
KimuraTian/lkpy | [
"d5b1b86ba73eb0b2b2eb90682aa872917813b20e"
] | [
"tests/test_batch_recommend.py"
] | [
"import pytest\n\nimport os\nimport os.path\nfrom collections import namedtuple\nimport logging\nimport pandas as pd\nimport numpy as np\n\nimport lk_test_utils as lktu\n\nfrom lenskit.algorithms.basic import Bias, TopN\nimport lenskit.batch as lkb\n\nMLB = namedtuple('MLB', ['ratings', 'algo'])\n_log = logging.get... | [
[
"pandas.read_csv",
"numpy.arange",
"pandas.concat",
"numpy.diff"
]
] |
Rishabh-Choudhry/datasets | [
"2bad427bba6cdcab717698a70c96339733c5d42c"
] | [
"tensorflow_datasets/core/dataset_info_test.py"
] | [
"# coding=utf-8\n# Copyright 2022 The TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.random.randint"
]
] |
VoiceZen/OpenSeq2Seq | [
"e18641a761c6ec572df3faf0d808a708ddebfcbb"
] | [
"scripts/nsr_create_syn_train_csv.py"
] | [
"# Copyright (c) 2018 NVIDIA Corporation\nfrom __future__ import absolute_import, division, print_function\nfrom __future__ import unicode_literals\n\nimport string\nimport os\nimport pandas as pd\n\nif __name__ == '__main__':\n synthetic_data_root = \"/data/speech/librispeech-syn/\"\n synthetic_data_sample = syn... | [
[
"pandas.read_csv"
]
] |
aberki1234/cogent3 | [
"af98b248a999bfeefd4cfed6bd59b4f30442e2d4"
] | [
"tests/test_parse/test_pamlmatrix.py"
] | [
"#!/usr/bin/env python\nfrom io import StringIO\nfrom unittest import TestCase, main\n\nfrom cogent3.evolve.models import DSO78_freqs, DSO78_matrix\nfrom cogent3.parse.paml_matrix import PamlMatrixParser\n\n\n__author__ = \"Matthew Wakefield\"\n__copyright__ = \"Copyright 2007-2020, The Cogent Project\"\n__credits_... | [
[
"numpy.testing.assert_equal"
]
] |
liyingben/ts-raster | [
"cfec56f4aced7054dd0db3c4106194f14d2f00b9"
] | [
"tsraster/calculate.py"
] | [
"'''\ncalculate.py: a module for extracting, evaluating and saving features\n'''\n\n\nimport numpy as np\nimport pandas as pd\nimport os\nimport gdal\nimport glob\nfrom pathlib import Path\nfrom tsfresh import extract_features\nfrom tsfresh.utilities.distribution import MultiprocessingDistributor, LocalDaskDistribu... | [
[
"pandas.read_csv",
"numpy.isnan"
]
] |
rishusiva/InsurancePrediction_ANN | [
"4d73ad08b52b581feae4d6b18276cf47701f95ad"
] | [
"ANN_From_Scratch/gradient_descent.py"
] | [
"from NN_model import *\nimport math\nimport numpy as np\n\ncoef,intercept = model.get_weights()\n\ndef sigmoid(X):\n return 1/ (1+math.exp(-X))\n\n\ndef prediction_function(age,affordibility):\n weighted_sum = coef[0]*age + coef[1]*affordibility + intercept\n return sigmoid(weighted_sum)\n\n\n#print(pred... | [
[
"numpy.transpose",
"numpy.exp",
"numpy.log",
"numpy.array",
"numpy.mean"
]
] |
AicyDC/ai-safety-gridworlds | [
"b574b3e42880e32245a6c69502af3e9782ae2879"
] | [
"ai_safety_gridworlds/environments/shared/rl/array_spec.py"
] | [
"# Copyright 2018 The AI Safety Gridworlds 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# Un... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.dtype",
"numpy.asarray",
"numpy.broadcast_to",
"numpy.array"
]
] |
WEYAI/NCRFpp | [
"c205e742a674bbacea9f5047cfb03b396c50264b"
] | [
"utils/data.py"
] | [
"# -*- coding: utf-8 -*-\n# @Author: Jie\n# @Date: 2017-06-14 17:34:32\n# @Last Modified by: Jie Yang, Contact: jieynlp@gmail.com\n# @Last Modified time: 2019-01-25 20:25:59\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nimport argparse\nimport sys\nimport os\nimport torch\n... | [
[
"torch.cuda.is_available"
]
] |
stiebels/MPHYG001_assignment-1 | [
"4c786f2cd18839cb33ca1ea0ba8ac9fd19a7bf33"
] | [
"greengraph/cmd.py"
] | [
"from argparse import ArgumentParser\nfrom matplotlib import pyplot as plt\nfrom greengraph.Graph import Graph\n\n'''\nThis class implements the command line interface.\n'''\n\ndef runModule():\n parser = ArgumentParser(description='Generates a graph that displays the number of green pixels per step between two ... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.savefig"
]
] |
marcodalessandro76/MPPI | [
"ad60b73270b1f376ac501d47285146f1c3af457a"
] | [
"mppi/Parsers/YamboOutputParser.py"
] | [
"\"\"\"\nModule that manages the parsing of a Yambo o- file(s).\n\"\"\"\n\nimport numpy as np\n\n# Specifies the name of the columns of the o- files for various type of runs. There are\n# two distint dictionaries depending if the ExtendOut option has been activated or not.\n\n# The rt outputs are not modified by th... | [
[
"numpy.array"
]
] |
gregjauvion/stylegan2-ada | [
"f6ef72305212b42f42d179b2a4b6d4629b14a4fd"
] | [
"torch_utils/ops/upfirdn2d.py"
] | [
"# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, related documentation\n# and any modifications thereto. Any use, reproduction, disclosure or\n# distribution of this softwa... | [
[
"torch.ones",
"torch.as_tensor",
"torch.nn.functional.pad",
"numpy.sqrt",
"torch.device"
]
] |
JustinSGray/OpenMDAO-CADRE | [
"d8378a8a571179990531d8a409efe727cbdf2bb7"
] | [
"src/CADRE/attitude.py"
] | [
"''' Attitude discipline for CADRE '''\n\nimport numpy as np\n\nfrom openmdao.lib.datatypes.api import Float, Array\nfrom openmdao.main.api import Component\n\nfrom CADRE.kinematics import computepositionrotd, computepositionrotdjacobian\n\n# Allow non-standard variable names for scientific calc\n# pylint: disable-... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.cos",
"numpy.sin",
"numpy.dot"
]
] |
watson-developer-cloud/assistant-dialog-flow-analysis | [
"0c7bcd9527636dce77c74b80f60dbe23e6682e13"
] | [
"src/conversation_analytics_toolkit/keyword_analysis.py"
] | [
"# (C) Copyright IBM Corp. 2019, 2020.\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 ... | [
[
"pandas.DataFrame",
"sklearn.feature_extraction.text.CountVectorizer"
]
] |
open2c/cooltools | [
"704f259c4df5bc1c61be915bf56c80b00a0298ed"
] | [
"cooltools/expected.py"
] | [
"from itertools import chain, combinations\nfrom collections import defaultdict\nfrom functools import partial\n\nimport warnings\nimport multiprocess as mp\n\n\nimport numpy as np\nimport pandas as pd\nfrom scipy.signal import fftconvolve\nfrom scipy.interpolate import interp1d\n\nfrom cooler.tools import partitio... | [
[
"scipy.signal.fftconvolve",
"numpy.ones",
"numpy.histogram",
"numpy.asarray",
"numpy.log",
"numpy.isfinite",
"numpy.isnan",
"numpy.unique",
"numpy.minimum",
"numpy.bincount",
"numpy.zeros",
"numpy.searchsorted",
"numpy.count_nonzero",
"numpy.arange",
"pa... |
vferat/mne-python | [
"54e07b3257ee44ae28c5253f47ef73909ef23bfd"
] | [
"mne/forward/forward.py"
] | [
"# Authors: Matti Hämäläinen <msh@nmr.mgh.harvard.edu>\n# Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n#\n# License: BSD (3-clause)\n\n# The computations in this code were primarily derived from Matti Hämäläinen's\n# C code.\n\nfrom time import t... | [
[
"numpy.ones",
"numpy.sum",
"scipy.sparse.block_diag",
"numpy.intersect1d",
"numpy.vstack",
"numpy.append",
"scipy.linalg.norm",
"numpy.concatenate",
"numpy.where",
"numpy.round",
"numpy.unique",
"numpy.minimum",
"numpy.sqrt",
"numpy.tile",
"numpy.eye",
... |
CSI-Woo-Lab/PandaSchedulingModel | [
"0ae4a20283ec7f2ffa1d0e0ebecdb1f4d2156d8a"
] | [
"tsp_heuristic.py"
] | [
"import numpy as np\nimport torch\n\nCONST = 100000.0\ndef calc_dist(p, q):\n return np.sqrt(((p[1] - q[1])**2)+((p[0] - q[0]) **2)) * CONST\n\ndef get_ref_reward(pointset):\n\n if isinstance(pointset, torch.cuda.FloatTensor) or isinstance(pointset, torch.FloatTensor):\n pointset = pointset.detach().n... | [
[
"numpy.sqrt",
"numpy.zeros"
]
] |
adityavaishampayan/FaceSwap | [
"5b875b2bcf6212cd8404633e296a44886710d150"
] | [
"scripts_ignore/Traditional/ThinPlateSplines/ThinPlateSpline.py"
] | [
"import numpy as np\nimport cv2\nimport sys\nimport math\nimport matplotlib.pyplot as plt\n\ndef fxy(pt1,pts2,weights):\n K = np.zeros([pts2.shape[0],1])\n for i in range(pts2.shape[0]):\n K[i] = U(np.linalg.norm((pts2[i]-pt1),ord =2)+sys.float_info.epsilon)\n f = weights[-1] + weights[-3]*pt1[0] +w... | [
[
"numpy.zeros_like",
"numpy.ones",
"numpy.matmul",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.linalg.inv",
"numpy.arange",
"numpy.hstack",
"numpy.array",
"numpy.identity"
]
] |
jvrana/caldera | [
"a346324e77f20739e00a82f97530dda4906f59dd"
] | [
"caldera/utils/sparse.py"
] | [
"from typing import Optional\nfrom typing import Type\n\nimport torch\nfrom scipy.sparse import coo_matrix\n\nfrom .indexing import SizeType\nfrom .indexing import unroll_index\n\n\ndef torch_coo_to_scipy_coo(m: torch.sparse.FloatTensor) -> coo_matrix:\n \"\"\"Convert torch :class:`torch.sparse.FloatTensor` tens... | [
[
"torch.sparse_coo_tensor",
"torch.repeat_interleave",
"torch.zeros_like",
"torch.tensor",
"torch.is_tensor",
"torch.cat"
]
] |
anksng/PDF-TIFF-image-extractor-with-anonymization-of-faces-and-license-plates | [
"0854aa09b51ade3673bb512a76718b43d77b063c"
] | [
"utils.py"
] | [
"import glob\nimport os\nimport fitz\nimport PIL as P\nimport io\nimport numpy as np\nimport turicreate as tc\nimport pandas as pd\ndef load_paths(path):\n \"\"\"\n Loads pdf and tiff files from the root folder as a 1-D list.\n -----------------------------------------------------------\n :param\n ... | [
[
"numpy.array",
"numpy.stack",
"numpy.hstack",
"pandas.DataFrame"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.