repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
akashsengupta1997/STRAPS-3DHumanShapePose | [
"f649a5790cd1ace15d2fa2e06908f0633ee24097"
] | [
"augmentation/proxy_rep_augmentation.py"
] | [
"import torch\nimport numpy as np\n\n\ndef random_verts2D_deviation(vertices, delta_verts2d_dev_range=[-0.01, 0.01]):\n \"\"\"\n Randomly add 2D uniform noise to vertices to create silhouettes/part segmentations with\n corrupted edges.\n :param vertices: (bs, 6890, 3)\n :param delta_verts2d_dev_range... | [
[
"torch.rand",
"numpy.random.rand"
]
] |
Datalab-AUTH/MSc---Lampridis---MANIFEST | [
"9c13018313f2681dd27ef56ac0eb8470319a1749"
] | [
"personality/personality_classifiers.py"
] | [
"import pickle\n\nimport pandas as pd\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.svm import LinearSVC\nfrom skmultilearn.problem_transform import ClassifierChain\n\nfrom utils.preprocessing i... | [
[
"pandas.cut",
"pandas.merge",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.svm.LinearSVC"
]
] |
KirovskiXVI/dicom-sr-qi | [
"810f367d0845f4f47c3ee914502cf973b4f9b336"
] | [
"unported scripts/magnification.py"
] | [
"\"\"\"Makes box plots for DAP and exposure\r\nvs magnification. Can change some things\r\nin line to change the data source (bjh vs. slch)\r\nand to decide between graphing DAP and Exposure\r\n\"\"\"\r\n\r\nimport my_utils\r\nimport srdata\r\nimport csv\r\nimport matplotlib\r\n\r\ndef build_table():\r\n pro... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca"
]
] |
jwa7/h.e.o.m-quantum | [
"e8835ba56f59a7e70aacc988cdba541fa085cf7e"
] | [
"quantum_heom/quantum_system.py"
] | [
"\"\"\"Module for setting up a quantum system. Contains\nthe QuantumSystem class.\"\"\"\n\nfrom scipy import constants\nimport numpy as np\n\nfrom quantum_heom import evolution as evo\nfrom quantum_heom import hamiltonian as ham\nfrom quantum_heom import heom\nfrom quantum_heom import lindbladian as lind\n\nfrom qu... | [
[
"numpy.array"
]
] |
opendoor-labs/auto_ks | [
"e60bcc639ee7ee312fdb6c2d0b907e10dec09d49"
] | [
"auto_ks/kalman_smoother.py"
] | [
"import numpy as np\nimport numpy.random as npr\nfrom scipy import sparse\nfrom scipy.sparse import linalg as splinalg\nimport IPython as ipy\nimport time\nimport numbers\n\nclass KalmanSmootherParameters:\n def __init__(self, A, W_neg_sqrt, C, V_neg_sqrt):\n self.A = A\n self.W_neg_sqrt = W_neg_sq... | [
[
"numpy.array",
"numpy.zeros",
"scipy.sparse.csc_matrix",
"numpy.testing.assert_array_equal",
"numpy.ones",
"scipy.sparse.eye",
"numpy.arange",
"scipy.sparse.linalg.factorized"
]
] |
qianglin-xlnx/Vitis-AI | [
"ae1e8f9db31a1980e0b7bb86baeb898c4fe0da26",
"ae1e8f9db31a1980e0b7bb86baeb898c4fe0da26"
] | [
"VART/samples/inception_v1_mt_py/inception_v1.py",
"alveo/apps/yolo/get_mAP_darknet.py"
] | [
"'''\nCopyright 2019 Xilinx Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writ... | [
[
"numpy.empty"
],
[
"numpy.zeros"
]
] |
ConnectedSystems/flopy | [
"cf3334437be74ba780c12ff2aa2b69f3ffbf8644",
"cf3334437be74ba780c12ff2aa2b69f3ffbf8644"
] | [
"flopy/utils/reference.py",
"flopy/utils/postprocessing.py"
] | [
"\"\"\"\r\nModule spatial referencing for flopy model objects\r\n\r\n\"\"\"\r\nimport json\r\nimport numpy as np\r\nimport os\r\nimport warnings\r\n\r\nfrom collections import OrderedDict\r\n\r\n\r\nclass SpatialReference(object):\r\n \"\"\"\r\n a class to locate a structured model grid in x-y space\r\n\r\n ... | [
[
"numpy.tile",
"numpy.where",
"numpy.cos",
"numpy.max",
"numpy.sin",
"numpy.empty",
"numpy.add.reduce",
"scipy.ndimage.rotate",
"matplotlib.pyplot.subplots",
"numpy.nanmin",
"numpy.arange",
"matplotlib.pyplot.gca",
"numpy.nanmax",
"numpy.array",
"numpy.sa... |
Harshdeep1996/jina-hub | [
"3ced90575467ebb4bc070ed43a189271370b4e70"
] | [
"segmenters/nlp/NLTKSentencizer/tests/test_nltksentencizer.py"
] | [
"import numpy as np\nimport pytest\n\nfrom .. import NLTKSentencizer\n\n\n@pytest.mark.parametrize(\n 'language, expected_len, expected_first_chunk, expected_second_chunk, text',\n [\n (\n None,\n 2,\n 'Today is a good day.',\n \"Can't wait for tomorrow!\",\n... | [
[
"numpy.stack"
]
] |
jhoofwijk/adaptive | [
"ebb4879abcfba57de2808a1df5c01db8a1508a5d"
] | [
"adaptive/tests/test_learners.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport collections\nimport functools as ft\nimport inspect\nimport itertools as it\nimport math\nimport operator\nimport os\nimport random\nimport shutil\nimport tempfile\n\nimport numpy as np\nimport pytest\nimport scipy.spatial\n\nimport adaptive\nfrom adaptive.learner import (AverageL... | [
[
"numpy.allclose",
"numpy.array"
]
] |
Nyquixt/DyConv | [
"255193068424aaa83352bee258d34cb8b32b6ee6",
"255193068424aaa83352bee258d34cb8b32b6ee6"
] | [
"cifar/dyresA_resnet.py",
"convs/cc_inf.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom convs.dyres_conv import *\nfrom convs.condconv import *\n\n__all__ = ['DyResA_ResNet18']\n\nclass DyRes_BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(self, in_channels, channels, stride=1, num_experts=3):\n super().__... | [
[
"torch.nn.Linear",
"torch.nn.functional.avg_pool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.nn.functional.relu",
"torch.randn"
],
[
"torch.nn.Linear",
"torch.nn.Sigmoid",
"torch.nn.AdaptiveAvgPool2d",
"torch.Tensor",
"torch.nn.f... |
anonymous-313/tensorflow | [
"b82785818b6b020d62340eaaece32b9c75858185"
] | [
"tensorflow/python/framework/ops.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.client.pywrap_tf_session.TF_OperationGetAttrInt",
"tensorflow.python.framework.device.is_device_spec",
"tensorflow.core.framework.attr_value_pb2.AttrValue.ListValue",
"tensorflow.python.tf2.enabled",
"tensorflow.python.util.memory.dismantle_ordered_dict",
"tensorflow.pyt... |
johanaluna/lambdata | [
"342ffd027de3a7a68ce52164df568f502b65d77f"
] | [
"lambdata_johanaluna/tryme2.py"
] | [
"# Import libraries\nimport pandas\nimport numpy\nfrom sklearn.model_selection import train_test_split\n\nclass Check_Data():\n\n def __init__(self, df, name_column_target):\n self.df = df\n self.name_column_target = name_column_target\n\n # function to check the null in a data frame and report ... | [
[
"sklearn.model_selection.train_test_split"
]
] |
memasanz/02_MLOpsPython | [
"23fa96a70a58ad6a25642b20486e94080a5ea580"
] | [
"titanic/training/train.py"
] | [
"\"\"\"\nCopyright (C) Microsoft Corporation. All rights reserved.\n \nMicrosoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual,\nroyalty-free right to use, copy, and modify the software code provided by us\n(\"Software Code\"). You may not sublicense the Software Code or any use of it\n(except to... | [
[
"sklearn.impute.SimpleImputer",
"sklearn.preprocessing.StandardScaler",
"sklearn.compose.ColumnTransformer",
"sklearn.linear_model.LogisticRegression",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.model_selection.train_test_split",
"sklearn.pipeline.Pipeline",
"numpy.average",
... |
willook/semantic-segmentation-zoo | [
"7b756629ce83fab3db4d91bc2513bb555fb28bb4"
] | [
"builders/frontend_builder.py"
] | [
"import tensorflow as tf\nfrom tensorflow.contrib import slim\nfrom frontends import resnet_v2\nfrom frontends import mobilenet_v2\nfrom frontends import inception_v4\nimport os \n\n\ndef build_frontend(inputs, frontend, is_training=True, pretrained_dir=\"models\"):\n if frontend == 'ResNet50':\n with sli... | [
[
"tensorflow.contrib.slim.get_model_variables"
]
] |
jmacdonald2010/medical-data-visualizer-FFCDAP | [
"d985f5f597d096e6b315d85f100d08b06ee235ff"
] | [
"medical_data_visualizer.py"
] | [
"import pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Import data\ndf = pd.read_csv('medical_examination.csv')\n\n# Add 'overweight' column\ndf['overweight'] = df.apply(lambda x: 1 if (x.weight / (np.square(x.height / 100))) > 25 else 0, axis=1)\n\n# Normalize data by... | [
[
"numpy.square",
"numpy.ones_like",
"matplotlib.pyplot.subplots",
"pandas.melt",
"pandas.read_csv"
]
] |
jtraviesor/alfred-tf-trainer | [
"9747d24bef418415a31abfe0c9982d2f1d9d8298",
"9747d24bef418415a31abfe0c9982d2f1d9d8298"
] | [
"similarity/preprocessing.py",
"tagger/general_utils.py"
] | [
"from tensorflow.python.platform import gfile\nfrom tensorflow.contrib.learn.python.learn.preprocessing.text import CategoricalVocabulary\nimport re\nimport numpy as np\n\ntry:\n import cPickle as pickle\nexcept ImportError:\n import pickle\n\n\nTOKENIZER_RE = re.compile(r\"[A-Z]{2,}(?![a-z])|[A-Z][a-z]+(?=[A-Z])... | [
[
"tensorflow.python.platform.gfile.Open",
"tensorflow.contrib.learn.python.learn.preprocessing.text.CategoricalVocabulary"
],
[
"numpy.log10"
]
] |
zhangdongkun98/qpth | [
"255dd55596685f2eff3db584bb44c4dfdbba1f28"
] | [
"qpth/qp.py"
] | [
"import torch\nfrom torch.autograd import Function\n\nfrom .util import bger, expandParam, extract_nBatch\nfrom . import solvers\nfrom .solvers.pdipm import batch as pdipm_b\nfrom .solvers.pdipm import spbatch as pdipm_spb\n# from .solvers.pdipm import single as pdipm_s\n\nfrom enum import Enum\n\n\nclass QPSolvers... | [
[
"torch.Size",
"torch.zeros",
"torch.eig",
"torch.clamp",
"torch.all",
"torch.Tensor"
]
] |
ybdesire/machinelearning | [
"0224746332e1085336e0b02e0ca3b11d74bd9a91",
"0224746332e1085336e0b02e0ca3b11d74bd9a91"
] | [
"pandas/read_excel/read_excel.py",
"sklearn/preprocess/missing_value_mean_input.py"
] | [
"import pandas as pd\r\n\r\nxl = pd.ExcelFile(\"test.xlsx\")\r\nprint('sheet_names: {0}'.format(xl.sheet_names))\r\ndf = xl.parse(\"details\")\r\n\r\nfor index, row in df.iterrows():\r\n name = row['name']\r\n age = row['age']\r\n country = row['country']\r\n print('{0},{1}'.format(country, name))\r\n",... | [
[
"pandas.ExcelFile"
],
[
"pandas.read_csv",
"sklearn.preprocessing.Imputer"
]
] |
diadochos/elfi | [
"f2932297d686403950f7f55a290cd25af10dbda6",
"f2932297d686403950f7f55a290cd25af10dbda6"
] | [
"elfi/methods/model_selection.py",
"elfi/utils.py"
] | [
"\"\"\"This module contains methods for model comparison and selection.\"\"\"\n\nimport numpy as np\n\n\ndef compare_models(sample_objs, model_priors=None):\n \"\"\"Find posterior probabilities for different models.\n\n The algorithm requires elfi.Sample objects from prerun inference methods. For example the\... | [
[
"numpy.concatenate",
"numpy.empty",
"numpy.logical_and",
"numpy.argsort"
],
[
"numpy.random.RandomState"
]
] |
nutcrtnk/PGRA | [
"4991f591ff7593a9149cc10a484682a834230979"
] | [
"src/model/logreg.py"
] | [
"import os\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nif not os.environ.get(\"RAND\", False):\n torch.manual_seed(0)\n torch.cuda.manual_seed_all(0)\n torch.backends.cudnn.deterministic = True\n torch.backends.cudnn.benchmark = False\nelse:\n print('random seed')\n\nclas... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.cuda.manual_seed_all",
"torch.nn.init.xavier_uniform_",
"torch.manual_seed",
"torch.nn.functional.softmax"
]
] |
helloybz/CLANE | [
"60e6f0503642ac63d3bcde136885e47954067c17"
] | [
"clane/similarity.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass CosineSimilarity:\n \"\"\"\n Cosine similarity between the two vector.\n\n Given two vector v1 and v2, the cosine similarity between the two vector\n is the cosine of theta, where the theta is the angle between the two vector on therir inner product space.... | [
[
"torch.nn.Linear",
"torch.nn.init.xavier_normal_"
]
] |
BatsResearch/zsl-kg | [
"9bc4d4537a0f90ee3bbcefdf90ceae6dbcf48572",
"9bc4d4537a0f90ee3bbcefdf90ceae6dbcf48572"
] | [
"tests/test_intent_classification.py",
"tests/gnn/test_attention_agg.py"
] | [
"import os\nfrom typing import Text\nimport torch\nimport unittest\n\nimport torch.nn as nn\nimport torch.optim as optim\nfrom allennlp.models import Model\nfrom allennlp.data.vocabulary import Vocabulary\n\nfrom zsl_kg.class_encoders.auto_gnn import AutoGNN\nfrom zsl_kg.example_encoders.text_encoder import TextEnc... | [
[
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.tensor",
"torch.load",
"torch.nn.CrossEntropyLoss"
],
[
"torch.tensor",
"torch.randn"
]
] |
shaoormunir/simpletransformers | [
"7a0889a57143d9cc25f0a82b7b979e0b2c6f3a45"
] | [
"simpletransformers/question_answering/question_answering_utils.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport collections\nimport json\nimport logging\nimport math\nimport os\nimport re\nimport string\nfrom io import open\nfrom multiprocessing import Pool, cpu_count\nfrom functools import partial\nfrom pprint import pprint\n\nfrom tqdm import tqdm,... | [
[
"torch.tensor",
"torch.utils.data.TensorDataset"
]
] |
kiyoon/Video-Swin-Transformer | [
"777546f27f8f5a3c83e10d966e2149be2fc9fa31",
"7a0d40ced8fb52c064d1cd11ffa8b0c3bbb77607",
"0a6fde1abb8403f1f68b568f5b4694c6f828e27e"
] | [
"tools/misc/bsn_proposal_generation.py",
"mmaction/models/backbones/resnet3d.py",
"mmaction/models/losses/ssn_loss.py"
] | [
"import argparse\nimport os\nimport os.path as osp\n\nimport mmcv\nimport numpy as np\nimport torch.multiprocessing as mp\n\nfrom mmaction.localization import (generate_bsp_feature,\n generate_candidate_proposals)\n\n\ndef load_video_infos(ann_file):\n \"\"\"Load the video annot... | [
[
"torch.multiprocessing.Process",
"torch.multiprocessing.Manager",
"numpy.savetxt",
"numpy.save"
],
[
"torch.nn.Sequential",
"torch.nn.MaxPool3d",
"torch.nn.modules.utils._ntuple",
"torch.utils.checkpoint.checkpoint",
"torch.nn.modules.utils._triple"
],
[
"torch.diag... |
BlanchonMarc/RandomImageGenerator | [
"fd684c8f27d0c7eeec66cd2521d482a8405dd097"
] | [
"interpretImage.py"
] | [
"import numpy as np\nimport glob\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as color\nimport math\n\n\ndef ParamToInten(AoP, DoP, Inten, angle):\n return ((Inten/2.0) * (1 + DoP*np.cos(math.radians(2*AoP) - 2*math.radians(angle))))\n\n\nif __name__ == \"__main__\... | [
[
"matplotlib.image.imread",
"numpy.amax"
]
] |
Geosyntec/python-cvc | [
"9d92efe81a10d2284f796a39673a17b8ef980d27"
] | [
"pycvc/tests/external_tests.py"
] | [
"import sys\nimport os\nfrom six import StringIO\nimport datetime\nfrom pkg_resources import resource_filename\nimport textwrap\nfrom io import StringIO\n\nimport nose.tools as nt\nfrom nose.plugins.attrib import attr\nfrom unittest import mock\nimport numpy.testing as nptest\nimport pandas.util.testing as pdtest\n... | [
[
"pandas.DataFrame",
"pandas.util.testing.assert_frame_equal"
]
] |
datavistics/sms_spam | [
"d858fdd25371979b42fb66093866479fe098aff0"
] | [
"src/make_dataframe.py"
] | [
"import zipfile\nfrom pathlib import Path\n\nimport pandas as pd\nimport requests\n\nproject_dir = Path(__file__).parents[1]\nurl = 'https://archive.ics.uci.edu/ml/machine-learning-databases/00228/smsspamcollection.zip'\ndata_path = project_dir / 'data' / 'smsspamcollection.zip'\nfile_path = project_dir / 'data' / ... | [
[
"pandas.read_csv"
]
] |
crpurcell/pythonFitting | [
"54315e336593f7f105f516766fb323662eadd5e3"
] | [
"fit_1D_NestedSampling/examples/multinest/tutorials/example1/1d_multimodal.py"
] | [
"import json\nimport numpy\nfrom numpy import log, exp, pi\nimport scipy.stats, scipy\nimport pymultinest\nimport matplotlib.pyplot as plt\n\n# we define the problem: we need a prior function which maps from [0:1] to the parameter space\n\n# we only have one parameter, the position of the gaussian (ndim == 1)\n# ma... | [
[
"numpy.array",
"numpy.exp"
]
] |
langyijun/proxy-synthesis | [
"4c69a17522a4aab9e1cfe568e900ca82b109e427"
] | [
"utils/evaluation.py"
] | [
"'''\nproxy-synthesis\nCopyright (c) 2021-present NAVER Corp.\nApache License v2.0\n'''\nimport faiss\nimport numpy as np\nfrom sklearn.cluster import KMeans\nfrom sklearn.metrics.cluster import normalized_mutual_info_score\n\ndef evaluation(X, Y, Kset, args):\n\n def get_recallK(Y_query, YNN, Kset):\n re... | [
[
"numpy.max",
"numpy.empty",
"sklearn.cluster.KMeans",
"numpy.mean",
"sklearn.metrics.cluster.normalized_mutual_info_score"
]
] |
mkxia57/pyEPR | [
"fab8c9434888982dcf4a8cec1d348200dbb02d11"
] | [
"pyEPR/calcs/back_box_numeric.py"
] | [
"'''\nNumerical diagonalization of quantum Hamiltonian and parameter\nextraction.\n\n@author: Phil Reinhold, Zlatko Minev, Lysander Christakis\n\nOriginal code on black_box_hamiltonian and make_dispersive functions by Phil Reinhold\nRevisions and updates by Zlatko Minev & Lysander Christakis\n'''\n# pylint: disable... | [
[
"numpy.polyder",
"numpy.array",
"numpy.isnan",
"numpy.log",
"numpy.zeros",
"numpy.roots",
"matplotlib.pyplot.legend",
"numpy.where",
"numpy.sign",
"numpy.transpose",
"numpy.poly1d"
]
] |
novium258/cortx-1 | [
"ce5b939b33b8d24d89b31807ac3bcaa8f24096bc"
] | [
"doc/integrations/pytorch/parlai/agents/transformer/polyencoder.py"
] | [
"#!/usr/bin/env python3\r\n# Copyright (c) Facebook, Inc. and its affiliates.\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\n# hack to make sure -m transformer/generator works as expected\r\n\"\"\"\r\nPoly-encoder Agent.\r\n\"... | [
[
"torch.cat",
"torch.nn.Parameter",
"torch.nn.init.normal_",
"torch.nn.init.uniform_",
"torch.empty",
"torch.nn.CrossEntropyLoss",
"torch.sum"
]
] |
ilya16/MidiTok | [
"03d80fadbdf5bbe7802d97f7424638cff96e1a2b"
] | [
"miditok/cp_word.py"
] | [
"\"\"\" MIDI encoding method, similar to Compound Word\nhttps://arxiv.org/abs/2101.02402\n\n\"\"\"\n\nfrom typing import List, Tuple, Dict, Optional, Union\n\nimport numpy as np\nfrom miditoolkit import Instrument, Note, TempoChange\n\nfrom .midi_tokenizer_base import MIDITokenizer, Vocabulary, Event, detect_chords... | [
[
"numpy.abs"
]
] |
shibaji7/AMGeO-SD | [
"f7380271affa191f0444289e4663bcd54f36cc9b"
] | [
"sd/sd_plots.py"
] | [
"import os\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib.dates as mdates\nfrom matplotlib.dates import DateFormatter, num2date\nfrom matplotlib import patches\nimport matplotlib.patches as mpatches\nimport random\nimport pytz\n\nimport datetime as dt\nimport panda... | [
[
"matplotlib.colorbar.ColorbarBase",
"numpy.array",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.close",
"matplotlib.colors.ListedColormap",
"matplotlib.pyplot.figure",
"numpy.where",
"matplotlib.patches.Patch",
"matplotlib.colors.Bounda... |
petebachant/NACA0020-3D-OpenFOAM | [
"ddb7105d534f859bb19ff1e0bb9be39c3ae7943f"
] | [
"pyal3dtf/plotting.py"
] | [
"\"\"\"\nPlotting functions.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom . import processing as pr\nimport os\n\n\ndef plot_spanwise_pressure(ax=None, simtype=\"BR\", save=False):\n \"\"\"Plot spanwise pressure, normalized and inverted.\"\"\"\n df = pr.load_sampled_set(\"spanwise\", \... | [
[
"numpy.tan",
"numpy.sqrt",
"matplotlib.pyplot.subplots"
]
] |
kkourt/cmnnc | [
"965e8150ab50c19237dbf4afd2e62bca1f5d53c8"
] | [
"src/test_onnx.py"
] | [
"# Copyright (c) 2019-2020, IBM Research.\n#\n# Author: Kornilios Kourtis <kou@zurich.ibm.com>\n#\n# vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4:\n\nimport typing\nimport dataclasses as dc\nfrom pprint import pprint\n\nimport numpy as np\nimport onnxruntime as onnxrt\nimport onnx\n\nimport conv\nimport ... | [
[
"numpy.testing.assert_allclose",
"numpy.pad",
"numpy.array"
]
] |
srnnkls/getml-examples | [
"45d179928ce6d7dccb2848b37c709b1dae0081e0"
] | [
"data/consumer_expenditures/raw/convert_CE_data.py"
] | [
"## This script imports the CE data and formats it in such a way the\n## user can handle it way more easily in the getting started guide.\n\nimport datetime\nimport os\n\nimport numpy as np\nimport pandas as pd\n\n## -------------------------------------------------------------------\n## Setup\n\n# The folder that ... | [
[
"numpy.asarray"
]
] |
felipeescallon/equivariant-MLP | [
"1542fcbb747292ae1c529d551595d919087c617d"
] | [
"experiments/trainer/hamiltonian_dynamics.py"
] | [
"import jax.numpy as jnp\nfrom jax import grad, jit, vmap, jacfwd, jvp, vjp\nfrom jax import random\nimport numpy as np\nimport jax.numpy as jnp\nfrom jax.experimental.ode import odeint\nfrom torch.utils.data import Dataset\nfrom emlp.groups import SO2eR3,O2eR3,DkeR3,Trivial\nfrom emlp.reps import T,Scalar\nfrom oi... | [
[
"numpy.concatenate",
"numpy.sin",
"numpy.array",
"matplotlib.animation.FuncAnimation",
"numpy.zeros",
"torch.save",
"numpy.random.randn",
"numpy.split",
"matplotlib.pyplot.figure",
"numpy.eye",
"numpy.stack",
"numpy.random.randint",
"numpy.arange",
"numpy.co... |
Julian-Theis/AVATAR | [
"a20c767d8739a52f538927b4ec3d528952263d5a"
] | [
"avatar/relgan/utils/metrics/DocEmbSim.py"
] | [
"import collections\nimport math\nimport random\n\nimport nltk\nimport numpy as np\nimport tensorflow as tf\nfrom scipy.spatial.distance import cosine\n\nfrom avatar.relgan.utils.metrics.Metrics import Metrics\n\n\nclass DocEmbSim(Metrics):\n def __init__(self, oracle_file=None, generator_file=None, num_vocabula... | [
[
"tensorflow.nn.sampled_softmax_loss",
"numpy.array",
"tensorflow.zeros",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.random_uniform",
"tensorflow.train.AdagradOptimizer",
"tensorflow.transpose",
"numpy.ndarray",
"tensorflow.constant",
"tensorflow.placeholder",... |
Wiser1990/pytorch_NER_BiLSTM_CNN_CRF | [
"6dcda3558001d6c7c3b7ca63ed08718a96effe02"
] | [
"DataUtils/Embed.py"
] | [
"# @Author : bamtercelboo\n# @Datetime : 2018/8/27 15:34\n# @File : Embed.py\n# @Last Modify Time : 2018/8/27 15:34\n# @Contact : bamtercelboo@{gmail.com, 163.com}\n\n\"\"\"\n FILE : Embed.py\n FUNCTION : None\n\"\"\"\n\nimport os\nimport sys\nimport time\nimport tqdm\nimport numpy as np\nimport torch\nimpor... | [
[
"numpy.array",
"torch.nn.init.xavier_uniform",
"numpy.sum",
"numpy.random.seed",
"numpy.round",
"torch.from_numpy",
"torch.manual_seed"
]
] |
bkj/what-is-this | [
"49c6e4f9809623d8580433baf00e507faacb04f0"
] | [
"wit/dep/old_examples/simple-forum-matching.py"
] | [
"# --\n# Load deps\n\nimport keras\nimport pandas as pd\nimport urllib2\n\nfrom hashlib import md5\nfrom bs4 import BeautifulSoup\nfrom pprint import pprint\nfrom matplotlib import pyplot as plt\n\nimport sys\nsys.path.append('/Users/BenJohnson/projects/what-is-this/wit/')\nfrom wit import *\n\npd.set_option('displ... | [
[
"pandas.set_option",
"sklearn.cluster.DBSCAN",
"matplotlib.pyplot.show",
"pandas.HDFStore",
"matplotlib.pyplot.scatter"
]
] |
00make/Rosetta-zh | [
"75f4f59956bd24bbf16637d94bede8b65c9db017",
"75f4f59956bd24bbf16637d94bede8b65c9db017",
"75f4f59956bd24bbf16637d94bede8b65c9db017",
"75f4f59956bd24bbf16637d94bede8b65c9db017"
] | [
"example/tutorials/code/rosetta_naive_protocol.py",
"example/tutorials/code/tf-ds-lr.py",
"example/tutorials/code/model_plot.py",
"example/tutorials/code/rtt-logistic_regression.py"
] | [
"#!/usr/bin/env python3\n\n# Import rosetta package\nimport latticex.rosetta as rtt\nimport tensorflow as tf\n\n# Attention!\n# This is just for presentation of integrating a new protocol.\n# NEVER USE THIS PROTOCOL IN PRODUCTION ENVIRONMENT!\nrtt.activate(\"Naive\")\n\n# Get private data from P0 and P1\nmatrix_a =... | [
[
"tensorflow.multiply",
"tensorflow.Session",
"tensorflow.global_variables_initializer"
],
[
"tensorflow.string_to_number",
"tensorflow.zeros",
"tensorflow.assign",
"numpy.random.seed",
"numpy.set_printoptions",
"tensorflow.matmul",
"tensorflow.Session",
"tensorflow.... |
Artcs1/piou2 | [
"98f8d068a903d295f990609d8f90e4136e836495"
] | [
"src/eval.py"
] | [
"import sys\nfrom pycocotools.coco import COCO\nimport os\nimport cv2\nimport numpy as np\nimport mmcv\nimport codecs\nimport pandas as pd\nimport glob\nCENTERNET_PATH = '/datadrive/sangliang/CenterNet/src/lib/'\nsys.path.insert(0, CENTERNET_PATH)\n\nfrom detectors.detector_factory import detector_factory\nfrom opt... | [
[
"numpy.concatenate",
"pandas.DataFrame",
"pandas.read_csv",
"numpy.array"
]
] |
hurondp/pims | [
"7d08bc4246375255611011d465db9de89fdc6ce9"
] | [
"pims/formats/utils/reader.py"
] | [
"# * Copyright (c) 2020-2021. Authors: see NOTICE file.\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# ... | [
[
"numpy.arange"
]
] |
ftbernales/groundmotion-processing | [
"5be88da75e7168bd2421973d6f1e54a91c679dc8"
] | [
"gmprocess/io/knet/knet_fetcher.py"
] | [
"# stdlib imports\nfrom datetime import datetime, timedelta\nimport re\nfrom collections import OrderedDict\nimport tempfile\nimport os.path\nimport tarfile\nimport glob\nimport shutil\nimport logging\nimport urllib\n\n# third party imports\nimport pytz\nimport numpy as np\nimport requests\nfrom bs4 import Beautifu... | [
[
"numpy.array",
"numpy.abs",
"numpy.datetime64"
]
] |
siyangl/video-object-segmentation-motion-bilateral-network | [
"b278fed4fb7f82f97e8e355e54138e4de6c14342"
] | [
"bilateral_network/inference.py"
] | [
"import os\nimport numpy as np\nimport cv2\nimport tensorflow as tf\n\nfrom tensorflow.python.platform import app\nfrom tensorflow.python.platform import flags\n\nfrom vos import utils\nfrom data import davis_flow_dataset\n\nflags.DEFINE_string('dataset', 'Davis', 'Dataset used for training')\nflags.DEFINE_string('... | [
[
"tensorflow.train.start_queue_runners",
"tensorflow.constant_initializer",
"numpy.exp",
"tensorflow.reshape",
"tensorflow.python.platform.flags.DEFINE_float",
"tensorflow.python.platform.flags.DEFINE_string",
"tensorflow.tile",
"tensorflow.python.platform.flags.DEFINE_integer",
... |
ARQ-CRISP/bopt_grasp_quality | [
"219372e6644005651e166ed3091c5410385c7d30"
] | [
"script/show_result.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import division, absolute_import, print_function\nimport skopt\nimport argparse\nimport matplotlib.pyplot as plt\nimport matplotlib.font_manager\nimport numpy as np\nfrom rospkg.rospack import RosPack\nfrom skopt.acquisition import gaussian_ei\n# from skopt.plots import plot_... | [
[
"numpy.min",
"numpy.mean",
"matplotlib.pyplot.draw",
"numpy.concatenate",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.gca",
"numpy.array",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ion",
"matplotlib.p... |
Fenrir12/rl-qbert | [
"51ae397846c730169a9b6b76fe12d319fc5a84ff"
] | [
"qbert-agent-ale.py"
] | [
"from ale_python_interface import ALEInterface\nimport gym\nimport numpy as np\nimport random as rd\nimport matplotlib.pyplot as plt\nimport sys\nimport time as t\nfrom PIL import Image\n\nWEIGHTS1 = [1.3826337386217185, 23.894746079161084, 8.801830487930047, 11.254706535442095, 0.5956519333495852, 8.77924414367976... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.ylabel",
"numpy.sqrt",
"matplotlib.pyplot.show"
]
] |
tueboesen/Active-Learning | [
"a924355e58dbe964b063d1cad08cc47dfcf2530b"
] | [
"src/Laplacian.py"
] | [
"import time\n\nimport hnswlib\nimport numpy as np\nimport torch\nfrom scipy.sparse import coo_matrix, csr_matrix\n\n\ndef ANN_hnsw(x, k=10, euclidian_metric=False, union=True, eff=None,cutoff=False):\n \"\"\"\n Calculates the approximate nearest neighbours using the Hierarchical Navigable Small World Graph f... | [
[
"numpy.max",
"scipy.sparse.coo_matrix",
"numpy.sum",
"numpy.exp",
"numpy.mean",
"numpy.arange",
"numpy.reciprocal",
"numpy.sqrt",
"scipy.sparse.csr_matrix",
"numpy.var"
]
] |
lcy2080/deep-motion-editing | [
"7872a076dbae8b3290b0dc94c8eac04159aef65e"
] | [
"retargeting/test.py"
] | [
"import os\nfrom os.path import join as pjoin\nfrom get_error import full_batch\nimport numpy as np\nfrom option_parser import try_mkdir\nfrom eval import eval\nimport argparse\n\nimport platform\n\nplatform_name = platform.system()\n\n\ndef batch_copy(source_path, suffix, dest_path, dest_suffix=None):\n try_mkd... | [
[
"numpy.array"
]
] |
DavidMetzIMT/pyEIT | [
"a3c64f7b869e7a00a102fc93feea4999c8bed6d1",
"a3c64f7b869e7a00a102fc93feea4999c8bed6d1"
] | [
"pyeit/io/et4.py",
"examples/paper_eit2016b.py"
] | [
"# pylint: disable=no-member, invalid-name\n# pylint: disable=too-many-arguments, too-many-instance-attributes\n\"\"\"\nLoad .et4 file into mem (experimental).\nThis file structure may be modified in near future.\n\"\"\"\n# Copyright (c) Benyuan Liu. All Rights Reserved.\n# Distributed under the (new) BSD License. ... | [
[
"numpy.max",
"pandas.to_datetime",
"numpy.zeros",
"pandas.DataFrame",
"pandas.to_timedelta",
"numpy.real",
"numpy.min",
"matplotlib.pyplot.figure",
"numpy.where",
"matplotlib.pyplot.show",
"numpy.arange",
"numpy.sqrt",
"numpy.repeat",
"numpy.imag"
],
[
... |
albertchristian92/RRPN | [
"fd54271b74bbd1cd43cc00f46fd41b19336b4993"
] | [
"tools/nuscenes_to_coco.py"
] | [
"import _init_path\nimport os\nimport sys\nimport pickle\nimport numpy as np\nimport argparse\nfrom tqdm import tqdm, trange\nfrom cocoplus.coco import COCO_PLUS\nfrom pynuscenes.utils.nuscenes_utils import nuscenes_box_to_coco, nuscene_cat_to_coco\nfrom pynuscenes.nuscenes_dataset import NuscenesDataset\nfrom nusc... | [
[
"numpy.array",
"numpy.transpose",
"numpy.vstack"
]
] |
zhhugh/Violation-detection | [
"0a3c0306a9fcac0518e5adc524d457af9e58e8d3"
] | [
"test.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n'''\n@Project :building detection \n@File :test.py\n@Author :zhouhan\n@Date :2021/4/22 5:56 下午 \n'''\n\n# -*- coding: utf-8 -*-\n\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\nimport os\nimport sys\nimport random\nimport math\nimport numpy as np\nimport sk... | [
[
"numpy.sum",
"numpy.dot",
"numpy.reshape"
]
] |
pkck28/Applied-Computation-in-Mechanical-Sciences | [
"411d56faae2291fd056cd2f1a3e09e2854f84b49"
] | [
"Assignment_5/Graph_Plotter.py"
] | [
"# Importing the required module \nimport pandas as pd\nimport matplotlib.pyplot as plt\n \n# Reading Data from CSV File \ndata = pd.read_csv(\"/home/pavan/Desktop/ACMS/Assignment_5/GSS_Error.csv\")\n\n# Ploting Graph for error variation\nGSS_figure = plt.figure(1)\nplt.plot(data.index,data[\"Ea\"],'b')\nplt.xlab... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
lmmarsano/geoplot | [
"77470728ddf726292bc84b2ed207d932d2069862"
] | [
"docs/examples/aggplot-collisions.py"
] | [
"# This example demonstrates how to use the `aggplot` function, using part of a NYC traffic collisions dataset.\n#\n# In the first plot we have a bunch of point data, but don't provide any geometry about the locations. So `aggplot`\n# invents its own, partitioning the sample space into increasingly fine squares (kn... | [
[
"pandas.isnull",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.subplots_adjust"
]
] |
takaratruong/minishapeworld | [
"ee23712d59248c502f5b9247916a60853f21b508"
] | [
"msw/config/configs/spatial.py"
] | [
"from collections import namedtuple\nfrom enum import Enum\n\nimport numpy as np\n\nfrom ... import color\nfrom ... import constants as C\nfrom ... import shape\nfrom .. import spec\nfrom .. import util as config_util\nfrom . import configbase\n\n_SpatialConfigBase = namedtuple(\"SpatialConfig\", [\"shapes\", \"rel... | [
[
"numpy.random.randint",
"numpy.random.choice"
]
] |
MLforHealth/HurtfulWords | [
"b59181585aa70152f0fbe79fa2611ded928bf9f1"
] | [
"scripts/finetune_on_target.py"
] | [
"#!/h/haoran/anaconda3/bin/python\nimport sys\nimport os\nsys.path.append(os.getcwd())\nimport pandas as pd\nimport numpy as np\nimport argparse\nimport Constants\nimport torch\nimport torch.nn as nn\nfrom torch.utils import data\nimport pickle\nfrom pytorch_pretrained_bert import BertTokenizer, BertModel\nfrom run... | [
[
"torch.nn.Linear",
"torch.nn.ModuleList",
"numpy.mean",
"sklearn.model_selection.ParameterGrid",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel",
"pandas.read_pickle",
"numpy.max",
"torch.nn.Softmax",
"torch.manual_seed",
"numpy.argma... |
tambetm/homework | [
"2ed2c9cbecb3daf9b1d77023a45ad0b35da5b542"
] | [
"hw5/sac/sac.py"
] | [
"import tensorflow as tf\nimport time\n\nclass SAC:\n \"\"\"Soft Actor-Critic (SAC)\n Original code from Tuomas Haarnoja, Soroush Nasiriany, and Aurick Zhou for CS294-112 Fall 2018\n\n References\n ----------\n [1] Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine, \"Soft\n Actor-... | [
[
"tensorflow.get_default_session",
"tensorflow.minimum",
"tensorflow.train.AdamOptimizer",
"tensorflow.assign",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.stop_gradient",
"tensorflow.reduce_mean"
]
] |
Tricker-z/CSE5001-GA-mTSP | [
"108916cafecbe325302dbce4ddd07c477a0c5f79"
] | [
"script/plot.py"
] | [
"import matplotlib.pyplot as plt\n\nroutes = [\n[[37, 52], [31, 62], [37, 69], [43, 67], [49, 49], [52, 41], [38, 46], [45, 35], [52, 33], [56, 37], [37, 52]],\n[[37, 52], [48, 28], [51, 21], [25, 55], [36, 16], [39, 10], [46, 10], [59, 15], [58, 27], [5, 64], [16, 57], [27, 68], [32, 39], [30, 48], [37, 52], [17, ... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
]
] |
rgerkin/jit_hub | [
"d132225fae29286cf7ac6f08bd4099fd65dcab0f"
] | [
"backends/izhikevich.py"
] | [
"from sciunit.models.backends import Backend\nfrom quantities import mV, ms, s, V\nfrom neo import AnalogSignal\nimport numpy as np\nimport quantities as pq\nimport numpy\nimport copy\n\nfrom numba import jit#, autojit\nimport cython\n\n\nclass JIT_IzhiBackend(Backend):\n def init_backend(self):\n super()... | [
[
"numpy.bool_",
"numpy.zeros"
]
] |
ska-sa/katsdpscripts | [
"f9eaa867aad8b94c715f7286953124df00b5781c",
"f9eaa867aad8b94c715f7286953124df00b5781c"
] | [
"observation/bf_phaseup.py",
"reduction/check_noise_diode_timing.py"
] | [
"#!/usr/bin/env python\n#\n# Track calibrator target for a specified time.\n# Obtain calibrated gains and apply them to the F-engine afterwards.\n\nimport numpy as np\nimport scipy.ndimage\nfrom katcorelib.observe import (standard_script_options, verify_and_connect,\n collect_targets,... | [
[
"numpy.isnan",
"numpy.nan_to_num",
"numpy.median",
"numpy.interp",
"numpy.exp",
"numpy.nonzero",
"numpy.abs",
"numpy.clip",
"numpy.nanmedian"
],
[
"numpy.logical_or",
"numpy.array",
"numpy.asarray",
"numpy.argmin",
"numpy.zeros",
"numpy.sum",
"nu... |
djstaros/qmcpack | [
"280f67e638bae280448b47fa618f05b848c530d2",
"280f67e638bae280448b47fa618f05b848c530d2"
] | [
"nexus/lib/gamess_input.py",
"utils/afqmctools/afqmctools/wavefunction/tests/test_mol.py"
] | [
"##################################################################\n## (c) Copyright 2015- by Jaron T. Krogel ##\n##################################################################\n\n\n#====================================================================#\n# gamess_input.py ... | [
[
"numpy.array",
"numpy.abs"
],
[
"numpy.allclose"
]
] |
jungwook518/KoSpeech | [
"77b8daf2f821c8fa755e937096fdbc3536cafd81"
] | [
"kospeech/data/audio/feature.py"
] | [
"# Copyright (c) 2020, Soohwan Kim. 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 b... | [
[
"torch.hamming_window",
"torch.FloatTensor",
"torch.Tensor"
]
] |
s36934512/tensorpack | [
"78a16615f8c9e6993c2a14961ca3fdd05f7c273c",
"78a16615f8c9e6993c2a14961ca3fdd05f7c273c"
] | [
"examples/FasterRCNN/config.py",
"tensorpack/tfutils/collect_env.py"
] | [
"# -*- coding: utf-8 -*-\n# File: config.py\n\nimport numpy as np\nimport os\nimport pprint\nimport six\n\nfrom tensorpack.utils import logger\nfrom tensorpack.utils.gpu import get_num_gpu\n\n__all__ = ['config', 'finalize_configs']\n\n\nclass AttrDict():\n\n _freezed = False\n \"\"\" Avoid accidental creatio... | [
[
"numpy.ceil"
],
[
"tensorflow.python.framework.test_util.is_xla_enabled",
"tensorflow.test.is_built_with_cuda",
"tensorflow.python.client.device_lib.list_local_devices",
"tensorflow.python.framework.test_util.IsMklEnabled",
"tensorflow.config.experimental.list_physical_devices",
"t... |
JangirSumit/data_science | [
"a1957122f8a4c66e3b4c7b7c93a74c53a2db1fe4"
] | [
"2nd June Assignments/case study 3/questions.py"
] | [
"from sklearn.preprocessing import StandardScaler\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split, ShuffleSplit, GridSearchCV\nfrom sklearn import svm\nfrom sklearn import metrics\nfrom sklearn.preprocessing import LabelEncoder\n\n# 1.Load the data from “college.csv” that has attributes c... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.preprocessing.StandardScaler",
"pandas.DataFrame",
"sklearn.model_selection.ShuffleSplit",
"sklearn.metrics.accuracy_score",
"sklearn.svm.SVC",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.svm.LinearSVC"
... |
jerrytheo/mim-plotsim | [
"2baa4a75938652bfeec957f4924e11e2c7da7a71"
] | [
"simulate.py"
] | [
"from source import Environment\nimport matplotlib.pyplot as plt\nfrom matplotlib.animation import FuncAnimation\nimport numpy as np\n\n\ndef horizontal_line(xstart, xstop, yval):\n xstop += 0.01\n return np.vstack((\n np.arange(xstart, xstop, 0.01),\n np.full(int(round((xstop - xstart) * 100)),... | [
[
"matplotlib.pyplot.show",
"numpy.hstack",
"matplotlib.animation.FuncAnimation",
"numpy.arange"
]
] |
dollarkillerx/PyTorchStudy | [
"c17b2973c89e3a2f088513f29bd5eb6f47957585"
] | [
"one.py"
] | [
"import torch\n\n# 定义向量\nvectro = torch.tensor([1,2,3,4])\nprint(\"Vector:\\t\\t\",vectro)\nprint('Vector: Shape:\\t',vectro.shape)\n\n# 定义矩阵\nmatrix = torch.tensor([[1,2],[3,4]])\nprint('Matrix:\\n',matrix)\nprint('Matrix Shape:\\n',matrix.shape)\n\n# 定义张量\ntensor = torch.tensor([ [ [1,2],[3,4] ], [ [5,6],[7,8] ] ... | [
[
"torch.tensor"
]
] |
nikhilpakhariya/FaceMaskDetector | [
"5d41a1a214ff862e84cda1c1578ba9ea6fb4dcd9"
] | [
"app.py"
] | [
"import streamlit as st\nfrom PIL import Image, ImageEnhance\nimport numpy as np\nimport cv2\nimport os\nfrom tensorflow.keras.applications.mobilenet_v2 import preprocess_input\nfrom tensorflow.keras.preprocessing.image import img_to_array\nfrom tensorflow.keras.models import load_model\nimport detect_mask_image\n\... | [
[
"numpy.array",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input",
"tensorflow.keras.models.load_model",
"tensorflow.keras.preprocessing.image.img_to_array",
"numpy.expand_dims"
]
] |
ChenQuan/mars | [
"46fc9747e99210cebfabfc2d85bcc8272440d1a3"
] | [
"mars/promise.py"
] | [
"# Copyright 1999-2018 Alibaba Group Holding Ltd.\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 appl... | [
[
"numpy.random.bytes"
]
] |
emichris/Disaster-Response | [
"68d894dc5e28d461fb5a7b1b040e665119e9ad34"
] | [
"data/process_data.py"
] | [
"import sys\nimport pandas as pd\nimport numpy as np\nfrom sqlalchemy import create_engine\n\ndef load_data(messages_filepath, categories_filepath):\n '''\n Function reads in both datasets\n It returns a dataframe with messages and categories merged on 'id'\n \n '''\n messages = pd.read_csv(mes... | [
[
"pandas.read_csv",
"pandas.to_numeric",
"pandas.concat"
]
] |
mattkozlowski/packet-stats | [
"5c12b8efbf6bcb41f2ea17bac6dd41277922c001"
] | [
"PacketStats/convertion.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom subprocess import check_call\n\n\ndef export_to_txt(f_name, txt_f_name):\n \"\"\"\n Converts pcap file into txt with packets features\n\n :param f_name: str\n filename of source pcap file\n :param txt_f_name: str\n filename of target file\n ... | [
[
"pandas.read_csv"
]
] |
elenisproject/Newsclinger | [
"ac69ceff437ecc234026ded00d60d3d0f0e83a49"
] | [
"TextPreprocessor/text_preprocessing.py"
] | [
"import pandas as pd\nimport unicodedata\nimport string\nimport json\nimport sys\nsys.path.insert(1, '/Users/elenikaranikola/Desktop/NewsBackend')\nfrom settings import DB_CREDS\nfrom utilities import finalNormalize, readText, writeData\n\n#get all the data from the articles table\nsql_command = \"SELECT * FROM art... | [
[
"pandas.DataFrame"
]
] |
mukul-mehta/HipoRank | [
"b44490c4f1f3e0ff8015e3eb0f2b1955947dfe80"
] | [
"hipo_rank/similarities/cos.py"
] | [
"import torch\nimport numpy as np\n\nfrom hipo_rank import Embeddings, SentenceEmbeddings, SectionEmbedding, \\\n PairIndices, SentenceSimilarities, SectionSimilarities, Similarities\nfrom typing import List, Tuple\nfrom numpy import ndarray\n\n\nclass CosSimilarity:\n def __init__(self, threshold = 0):\n ... | [
[
"torch.cosine_similarity",
"numpy.clip",
"numpy.stack",
"torch.from_numpy"
]
] |
iamrishab/LPRNet_Pytorch | [
"b5f4b4c159d5c80b9b9e81a8eed65f4b4d79f96b"
] | [
"data/load_data.py"
] | [
"from torch.utils.data import *\nfrom imutils import paths\nimport numpy as np\nimport random\nimport cv2\nimport os\n\n# CHARS = ['京', '沪', '津', '渝', '冀', '晋', '蒙', '辽', '吉', '黑',\n# '苏', '浙', '皖', '闽', '赣', '鲁', '豫', '鄂', '湘', '粤',\n# '桂', '琼', '川', '贵', '云', '藏', '陕', '甘', '青', '宁',\n# ... | [
[
"numpy.transpose"
]
] |
levtelyatnikov/SVM-from-scratch | [
"c0faa68c0352eb65cde0d12fd5fc543bc985f5a0"
] | [
"data.py"
] | [
"import os\nimport numpy as np\nimport gzip\n\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.model_selection import train_test_split\n\n\n\"\"\"\n@author: Diego \n\"\"\"\n\n\"\"\"\nthis is the code you need to run to import data.\nYou may have to change line 36 selecting the correct path.\n\"\"\"\n... | [
[
"numpy.concatenate",
"numpy.where",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.StandardScaler"
]
] |
rao208/explainable_ai | [
"515343696b55f4fa466daca4991d68aae6e12fd2"
] | [
"Occlusion_Sensitivity/occlusion_sensitivity.py"
] | [
"\"\"\"\r\nCreated on Fri Aug 7 03:14:52 2020\r\n@author: Vanditha Rao\r\n\r\nHighly inspired from https://github.com/sicara/tf-explain\r\n\r\nThis script allows the user to implement occlusion sensitivity. Image file can\r\nbe of any format.\r\n\r\nThis script requires that tensorflow and OpenCV be installed with... | [
[
"numpy.array",
"numpy.copy",
"numpy.zeros"
]
] |
eytanadler/OpenAeroStruct | [
"a4f482c2bd09a504d378f144da95cc91053b9f3b"
] | [
"openaerostruct/aerodynamics/tests/test_rotational_velocity.py"
] | [
"import unittest\n\nimport numpy as np\n\nimport openmdao.api as om\nfrom openmdao.utils.assert_utils import assert_check_partials\n\nfrom openaerostruct.aerodynamics.rotational_velocity import RotationalVelocity\nfrom openaerostruct.utils.testing import run_test, get_default_surfaces\n\n\nclass Test(unittest.TestC... | [
[
"numpy.random.random",
"numpy.array"
]
] |
subex/Tefla | [
"34f8fd0e2f2ee02aa73c6289753e08a95cc41880"
] | [
"tefla/core/learning_ss.py"
] | [
"# -------------------------------------------------------------------#\n# Written by Mrinal Haloi\n# Contact: mrinal.haloi11@gmail.com\n# Copyright 2017, Mrinal Haloi\n# -------------------------------------------------------------------#\nfrom __future__ import division, print_function, absolute_import\n\nimport ... | [
[
"tensorflow.nn.in_top_k",
"tensorflow.constant_initializer",
"tensorflow.ones_like",
"tensorflow.merge_all_summaries",
"tensorflow.zeros_like",
"tensorflow.control_dependencies",
"tensorflow.global_variables_initializer",
"tensorflow.identity",
"tensorflow.no_op",
"tensorfl... |
mcmips/osim-rl | [
"610b95cf0c4484f1acecd31187736b0113dcfb73"
] | [
"cmaes/solver_cma.py"
] | [
"# Copyright (c) 2015, Disney Research\n# All rights reserved.\n#\n# Author(s): Sehoon Ha <sehoon.ha@disneyresearch.com>\n# Disney Research Robotics Group\n#\n# adapted by Seungmoon Song <seungmoon.song@gmail.com>\n\nfrom __future__ import division # '/' always means non-truncating division\nfrom cmaes.solver impo... | [
[
"numpy.random.rand",
"numpy.zeros",
"numpy.clip"
]
] |
xrmx/modin | [
"7f19fa2200993a0b8f009b6b603afb4a4022cec8"
] | [
"modin/engines/ray/generic/io.py"
] | [
"import pandas\nfrom pandas.io.common import _infer_compression\nfrom pandas.io.parsers import _validate_usecols_arg\nfrom pandas.core.dtypes.cast import find_common_type\n\nimport inspect\nimport os\nimport py\nimport re\nimport sys\nimport numpy as np\nimport math\nimport warnings\n\nfrom modin.error_message impo... | [
[
"numpy.array",
"pandas.Index",
"pandas.DataFrame",
"pandas.RangeIndex",
"pandas.core.dtypes.cast.find_common_type",
"pandas.read_hdf",
"pandas.Series",
"pandas.HDFStore",
"pandas.read_csv",
"pandas.read_sql"
]
] |
rsoliveirac/projeto-insights-houses | [
"ca76a6a76bf280ca1e0c3e3777f24cf6a9dae302"
] | [
"house-rocket.py"
] | [
"import pandas as pd\nimport streamlit as st\nimport folium\nimport numpy as np\nfrom streamlit_folium import folium_static\nimport plotly.express as px\n\nst.set_page_config(layout='wide')\n\n\n@st.cache(allow_output_mutation=True)\ndef get_data(path):\n data = pd.read_csv(path)\n return data\n\ndef remove_d... | [
[
"pandas.to_datetime",
"pandas.merge",
"pandas.DataFrame",
"pandas.concat",
"pandas.unique",
"pandas.read_csv"
]
] |
primeMover2011/deep-reinforcement-learning | [
"a8314b01da15e47c230a3246e5109d49c6618162"
] | [
"dqn/exercise/dqn_agent.py"
] | [
"import numpy as np\nimport random\nfrom collections import namedtuple, deque\n\nfrom model import QNetwork\n\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nBUFFER_SIZE = int(1e5) # replay buffer size\nBATCH_SIZE = 64 # minibatch size\nGAMMA = 0.99 # discount fact... | [
[
"torch.no_grad",
"torch.from_numpy",
"torch.cuda.is_available",
"numpy.arange",
"numpy.vstack"
]
] |
aditya-agrawal-30502/vformer | [
"e1f4950f980238442ff1dc39a8f0791e4fbc9dac"
] | [
"tests/test_encoder.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom vformer.functional import PatchMerging\nfrom vformer.utils import ENCODER_REGISTRY\n\nencoder_modules = ENCODER_REGISTRY.get_list()\n\n\ndef test_VanillaEncoder():\n\n test_tensor = torch.randn(2, 65, 1024)\n encoder = ENCODER_REGISTRY.get(\"VanillaEncoder\")(\n ... | [
[
"torch.randn"
]
] |
ketyi/dgl | [
"a1b859c29b63a673c148d13231a49504740e0e01",
"a1b859c29b63a673c148d13231a49504740e0e01"
] | [
"examples/pytorch/mvgrl/graph/model.py",
"examples/pytorch/gcmc/train.py"
] | [
"import torch as th\nimport torch.nn as nn\n\nfrom dgl.nn.pytorch import GraphConv\nfrom dgl.nn.pytorch.glob import SumPooling\n\nfrom utils import local_global_loss_\n\nclass MLP(nn.Module):\n def __init__(self, in_dim, out_dim):\n super(MLP, self).__init__()\n self.fcs = nn.Sequential(\n ... | [
[
"torch.nn.Linear",
"torch.nn.PReLU",
"torch.nn.ModuleList"
],
[
"torch.device",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.no_grad",
"torch.FloatTensor",
"torch.softmax",
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.random.randint",
... |
veskoch/magenta | [
"74f16be4341925341617699dffdbddadd747acad"
] | [
"magenta/music/encoder_decoder_test.py"
] | [
"# Copyright 2016 Google Inc. 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 appli... | [
[
"numpy.log",
"tensorflow.test.main"
]
] |
mingxiaoh/chainer_for_rebase | [
"8c5ba24bf81d648402d388dac1df7591b2557712"
] | [
"tests/chainer_tests/functions_tests/pooling_tests/test_max_pooling_nd.py"
] | [
"import unittest\n\nimport functools\nimport math\nimport mock\nimport numpy\nfrom operator import mul\nimport six\n\nimport chainer\nfrom chainer import cuda\nfrom chainer import functions\nfrom chainer import gradient_check\nfrom chainer import testing\nfrom chainer.testing import attr\nfrom chainer.testing impor... | [
[
"numpy.random.uniform",
"numpy.random.rand"
]
] |
Fernal73/LearnPython3 | [
"5288017c0dbf95633b84f1e6324f00dec6982d36",
"5288017c0dbf95633b84f1e6324f00dec6982d36"
] | [
"Numpy/arrays.py",
"scipy/readtxt.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\n\na = np.arange(1,16,dtype=int).reshape(3,5).T\nprint(a)\nb = a[1:4:2]\nprint(b)\na = a.T\nb = a[:,1:4:2]\nprint(b)\na = np.arange(25).reshape(5, 5)\nb = np.array([1., 5, 10, 15, 20])\nprint(a,b)\nc = a / b[:, np.newaxis]\nprint(c)\n\na = np.ran... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.argmin",
"numpy.where",
"numpy.arange"
],
[
"numpy.loadtxt",
"numpy.arange",
"numpy.savetxt"
]
] |
shagunsodhani/xplogger | [
"46107543cee9a6708d9337090b53dc88e2bfd890"
] | [
"tests/utils.py"
] | [
"import numpy as np\n\nimport xplogger.logbook\nfrom xplogger.types import ConfigType\n\n\ndef make_logbook_config(logger_dir: str) -> ConfigType:\n return xplogger.logbook.make_config(\n logger_dir=logger_dir,\n wandb_config=None,\n tensorboard_config=None,\n mlflow_config=None,\n ... | [
[
"numpy.float64",
"numpy.int64",
"numpy.float32",
"numpy.int32"
]
] |
Bilal-A-Qureshi/OpenPCDet | [
"633c6026e56fc3fb2112f2a9f7ce08a21619e78f"
] | [
"tools/train_utils/train_utils.py"
] | [
"import glob\nimport os\n\nimport torch\nimport tqdm\nimport time\nfrom torch.nn.utils import clip_grad_norm_\nfrom pcdet.utils import common_utils, commu_utils\n\n\ndef train_one_epoch(cur_epoch,model, optimizer, train_loader, model_func, lr_scheduler, accumulated_iter, optim_cfg,\n rank, tbar, ... | [
[
"torch.save"
]
] |
naoc-1861355/Public_Handpose_datasets | [
"a0119226859ffad64bd7ceac8f8b4b67d2aebf8b"
] | [
"CMU/hand_labels/normdat.py"
] | [
"import json\nimport os.path\n\nimport cv2\nimport numpy as np\n\nfrom utils import generate_json_2d\n\n\ndef normdat(outpath):\n \"\"\"\n normdat is a function that convert this dataset to standard ezxr format output\n\n Args:\n :param outpath : root output path of the formatted files\n\n Return... | [
[
"numpy.array"
]
] |
s-geronimoanderson/compat-id | [
"3ae52dd3d3e92285de425304ccde02f87d2ae880"
] | [
"deprecated/matrix.py"
] | [
"#!/usr/bin/env python\n\nfrom scipy.sparse import coo_matrix\n\nclass Matrix:\n \"\"\"A sparse matrix class (indexed from zero). Replace with NumPy arrays.\"\"\"\n def __init__(self, matrix=None, size=None):\n \"\"\"Size is a tuple (m,n) representing m rows and n columns.\"\"\"\n if matrix is N... | [
[
"scipy.sparse.coo_matrix"
]
] |
mohabouje/cntk-hotel-pictures-classificator | [
"a5b37dd90f5e7abf0c752b55b9b06951e4ffc4d1"
] | [
"Detection/ImageTaggingTool/helpers.py"
] | [
"\nfrom __future__ import print_function\nfrom builtins import str\nimport os\nimport numpy as np\nimport copy\nimport cv2\nfrom PIL import Image, ImageFont, ImageDraw\nfrom PIL.ExifTags import TAGS\n\navailable_font = \"arial.ttf\"\ntry:\n dummy = ImageFont.truetype(available_font, 16)\nexcept:\n available_... | [
[
"numpy.array"
]
] |
linzhlalala/self-critical.pytorch | [
"b856250ac52ba63656b1b03cdc3d7e830ed43f68"
] | [
"captioning/models/m2/m2transformer/models/transformer/decoders.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nimport numpy as np\n\nfrom .attention import MultiHeadAttention\nfrom .utils import sinusoid_encoding_table, PositionWiseFeedForward\nfrom ..containers import Module, ModuleList\n\n\nclass MeshedDecoderLayer(Module):\n def __init__(self, ... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.arange",
"torch.nn.init.constant_",
"torch.nn.init.xavier_uniform_",
"torch.nn.functional.log_softmax",
"torch.ones",
"numpy.sqrt",
"torch.nn.Embedding"
]
] |
alikewater/tensorflow | [
"697929b163102db63fcf0599eb718e49d5ecd2c2"
] | [
"tensorflow/contrib/slim/python/slim/nets/inception_v4_resnet_v2.py"
] | [
"# -*- coding:utf-8 -*-\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\n \n#v4.default_image_size = 229\ndef v4(inputs,\n sc='Inception-ResNet-v2'):\n '''\n Inception-V4 Inception-ResNet-v2 结构\n net structs\n --------------------------------------\n input | 229 x 22... | [
[
"tensorflow.concat",
"tensorflow.contrib.slim.max_pool2d",
"tensorflow.variable_scope",
"tensorflow.contrib.slim.arg_scope",
"tensorflow.contrib.slim.conv2d"
]
] |
mhwasil/3DmFV-Net | [
"9cf8fe5f3875e97dd34997182c5087193a9c15bc"
] | [
"train_cls.py"
] | [
"import os\nimport sys\nimport numpy as np\n\nimport matplotlib\nmatplotlib.use('pdf')\n# import matplotlib.pyplot as plt\nimport importlib\nimport argparse\nimport tensorflow as tf\nimport pickle\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.join(BASE_... | [
[
"numpy.where",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"numpy.concatenate",
"tensorflow.argmax",
"tensorflow.Variable",
"tensorflow.train.Saver",
"numpy.argmax",
"numpy.sqrt",
"matplotlib.use",
"numpy.array",
"tensorflow.minimum",
"tensorfl... |
arfc/mhtgr350-benchmark | [
"18f7b3fe5742dabb1114c3bf7760b84590d16062"
] | [
"moltres-thermal-fluids/full-assembly/auxiliary.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib.cbook import get_sample_data\nimport matplotlib.patches as mpatches\n\n\ndef add_legends_full_assembly():\n '''\n This function adds legends to 'full-assem-mesh'.\n '''\n figure = 'full-assem-mesh'\n ... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.imread",
"matplotlib.patches.Patch",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"... |
mmehrani/homans_project | [
"37bddd6ed0686739674373264526873f92640346"
] | [
"genres_holder/Homans_3_a.py"
] | [
"\"\"\"\nCreated on Mon Aug 12 10:12:03 2019\n@author: Taha Enayat, Mohsen Mehrani\n\nMain file\nModel's engine\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom datetime import datetime\n#import winsound\nimport pickle\nimport Analysis_Tools_Homans\nimport os\nimport sys\nfrom decimal import *\n\"... | [
[
"numpy.random.choice",
"numpy.random.rand",
"numpy.exp",
"numpy.size",
"numpy.random.random",
"numpy.concatenate",
"numpy.full",
"matplotlib.pyplot.savefig",
"numpy.arange",
"numpy.delete",
"numpy.array",
"numpy.zeros",
"numpy.round",
"matplotlib.pyplot.titl... |
lthamm/concept-embeddings-and-ilp | [
"27592c6424147a2fbb54d7daebc92cd72b3f4a0c"
] | [
"sources/model/finetuning/model_loaders/mobilenetv2.py"
] | [
"\"\"\"Loader of modified MobileNetV2 for finetuning on picasso dataset.\"\"\"\n\nfrom typing import Sequence, Dict\n\nimport torch\nfrom torchvision.models import MobileNetV2, mobilenet_v2\n\nfrom ..defaults import NUM_CLASSES\n\nMOBILENETV2_FINETUNE_LAYERS: Sequence[str] = (\n 'features.17',\n 'features.18'... | [
[
"torch.nn.Linear"
]
] |
rogeroyer/2019-CCF-BDCI-Finance-Information-Negative-Judgment | [
"06e0582b06f99ce3348ad91ea687ab3e9a0cf363",
"06e0582b06f99ce3348ad91ea687ab3e9a0cf363"
] | [
"Emotion_Model/voting.py",
"Entity_Model/model_lj/bert_classify_train_with_pos_samples_add_feature_extend_trainSet-PreProcess-roberta-large.py"
] | [
"import os\nimport path\nimport numpy as np\nimport pandas as pd\nfrom collections import Counter\n\nsub_path = './submit/'\n\nsub1 = pd.read_csv(sub_path + 'emotion_res_1.csv', encoding='utf-8')[['id', 'negative']]\nsub2 = pd.read_csv(sub_path + 'emotion_res_2.csv', encoding='utf-8')[['id', 'negative']]\nsub3 = pd... | [
[
"pandas.read_csv"
],
[
"tensorflow.set_random_seed",
"numpy.array",
"sklearn.model_selection.StratifiedKFold",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.save",
"numpy.random.shuffle",
"numpy.argmax",
"sklearn.preprocessing.MinMaxScaler",
"pandas.concat",
"... |
jxwhat/telegram_bot | [
"f984eeac70efeca99c89c7e3436e88de65ed99d1"
] | [
"jx_telebot.py"
] | [
"# this file provides supporting stuff for the telegram bot\n\nimport numpy as np\nimport pandas as pd\nimport yfinance as yf\nimport re\nimport random\n\nfrom datetime import datetime, timedelta\nfrom datetime import date as datetype ## clumsy code but works for now\n\nimport requests\n\nvocab_dict = {\n 'no_ch... | [
[
"pandas.isnull",
"pandas.DataFrame",
"pandas.read_csv",
"pandas.DatetimeIndex"
]
] |
Sikerdebaard/PREDICTFastr | [
"e1f172c3606e6f33edf58008f958dcd1c0ac5b7b"
] | [
"build/lib/WORC/classification/AdvancedSampler.py"
] | [
"#!/usr/bin/env python\n\n# Copyright 2016-2019 Biomedical Imaging Group Rotterdam, Departments of\n# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands\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.\... | [
[
"sklearn.externals.six.moves.range",
"sklearn.utils.check_random_state",
"numpy.random.randint",
"scipy.stats.uniform"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.