repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
VirtueQuantumCloud/projectqX
[ "fa484fe037a3a1772127bbd00fe4628ddba34611" ]
[ "projectq/ops/_qubit_operator_test.py" ]
[ "# Copyright 2017 ProjectQ-Framework (www.projectq.ch)\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.float64", "numpy.complex128" ] ]
evarol/ot_tracking
[ "cddf27558fa5679ef06aad6a0945c34db0209ee7" ]
[ "python/otimage/deformations.py" ]
[ "\"\"\"Deformation models for worm registration\"\"\"\n\nfrom abc import ABC, abstractmethod\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.preprocessing import PolynomialFeatures\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.pipeline import Pipeline\n\n\nclass DeformationMo...
[ [ "numpy.full", "numpy.array", "sklearn.linear_model.LinearRegression", "sklearn.preprocessing.PolynomialFeatures", "numpy.linalg.det" ] ]
evazhang612/honygenerator
[ "cafcf1736faba978ecaed624b949ebc1498477ee" ]
[ "language-modeling-master/src/nnlm-mc-drop.py" ]
[ "import torchtext, random, torch\n\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nimport numpy as np\nfrom tqdm import tqdm\n\nglobal use_cuda\nuse_cuda = torch.cuda.is_available()\ndevice = 0 if use_cuda else -1\n\nTEXT = torchtext.data.Field()\ntrain, val, test = t...
[ [ "torch.nn.Linear", "torch.nn.NLLLoss", "torch.cat", "torch.nn.Dropout", "torch.optim.Adam", "numpy.mean", "torch.nn.functional.log_softmax", "torch.cuda.is_available", "torch.LongTensor", "torch.nn.Embedding" ] ]
Haunter17/MIR_SU17
[ "0eaefb8cab78ca896c1ed0074892c296110eb161", "0eaefb8cab78ca896c1ed0074892c296110eb161" ]
[ "exp2/exp2c.py", "exp8/exp8g_none.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport h5py\nimport time\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n# Functions for initializing neural nets parameters\ndef init_weight_variable(shape):\n initial = tf.truncated_normal(shape, stddev=0.1, dtype=tf.float32)\n return tf....
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.nn.conv2d", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.InteractiveSession", "matplotlib.pyplot.savefig", "tensorflow.argmax", "tensorflow...
michellesima/transformers
[ "327b32277d882e13b104dd8502a83a8668ea84e9" ]
[ "utils.py" ]
[ "import pandas as pd\r\nfrom nltk.stem import WordNetLemmatizer \r\nfrom transformers import *\r\n\r\ndef repeatN(list, n):\r\n ori = list\r\n for _ in range(n):\r\n list = list.append(ori, ignore_index=True)\r\n return list\r\n\r\ndef agen_verbs():\r\n '''\r\n for word in each category, get i...
[ [ "pandas.read_csv" ] ]
gormlabenz/People-Counting-in-Real-Time
[ "d9bdfc1d428e249aa1d86b355a2aa67b5199ae2a" ]
[ "run_2.py" ]
[ "import argparse\nimport csv\nimport datetime\nimport logging\nimport time\nfrom itertools import zip_longest\n\nimport cv2\nimport dlib\nimport imutils\nimport numpy as np\nimport schedule\nfrom imutils.video import FPS, VideoStream\nfrom PIL import Image\n\nfrom mylib import config, epd4in2, thread\nfrom mylib.ce...
[ [ "numpy.array", "numpy.arange", "numpy.mean" ] ]
yingwaner/C-MNMT
[ "3a87f75302efc859139af72483f480a1cac86f25" ]
[ "fairseq/sequence_generator.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\n\nimport torch\n\nfrom fairseq import search, utils\nfrom fairseq.data import data_utils\nfrom fairseq.models import Fa...
[ [ "torch.stack", "torch.masked_select", "torch.nn.ModuleList", "torch.gather", "torch.arange", "torch.no_grad", "torch.index_select", "torch.topk" ] ]
sct-pipeline/contrast-agnostic-softseg-spinalcord
[ "4d3429f311c2c4787c63c290acf3cafa0a4e15bf" ]
[ "create_training_joblib.py" ]
[ "import pandas as pd\nimport joblib\nimport numpy as np\nimport argparse\nimport os\n\n\n# Inputs:\n# --sct_train_file: Pickle file that was holds the a list of the dataset used for training.\n# Can be downloaded at: https://github.com/sct-data/deepseg_sc_models\n# train_valid_te...
[ [ "pandas.read_pickle", "numpy.in1d", "pandas.merge" ] ]
rafvasq/cage-challenge-1
[ "95affdfa38afc1124f1a1a09c92fbc0ed5b96318", "95affdfa38afc1124f1a1a09c92fbc0ed5b96318" ]
[ "CybORG/CybORG/Agents/ComplexAgents/utilities/data_structures/Action_Balanced_Replay_Buffer.py", "CybORG/CybORG/Agents/ComplexAgents/actor_critic_agents/SAC_Discrete.py" ]
[ "import random\nfrom collections import namedtuple, deque\nimport torch\nimport numpy as np\nfrom .Replay_Buffer import Replay_Buffer\n\nclass Action_Balanced_Replay_Buffer(Replay_Buffer):\n \"\"\"Replay buffer that provides sample of experiences that have an equal number of each action being conducted\"\"\"\n ...
[ [ "torch.cuda.is_available" ], [ "torch.zeros", "torch.min", "numpy.log", "torch.no_grad", "torch.optim.Adam", "torch.nn.functional.mse_loss", "torch.log", "torch.argmax", "torch.sum" ] ]
xuyanbo03/lab
[ "cf2f5250e1a00ecce37b3480df28c3a5dcd08b57" ]
[ "python/tests/episode_time_test.py" ]
[ "# Copyright 2017-2018 Google Inc.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is dist...
[ [ "numpy.zeros" ] ]
trimitri/freqle
[ "67f48a0f4a4ab181902796339e7d0ad7a40399c0" ]
[ "parsers.py" ]
[ "\"\"\"Parse output from various sources into `FreqSeries` objects.\"\"\"\nfrom typing import List\nimport pandas as pd\n\nfrom .freq_series import FreqSeries\n\n\ndef fokus2_txt(file_name: str, session: str = None,\n drop_lines: List[int] = None) -> FreqSeries:\n \"\"\"Parse frequency measurement ...
[ [ "pandas.to_datetime", "pandas.read_table", "pandas.read_csv" ] ]
hebrewsnabla/dh
[ "222e3d4d8d4d04cd63074327ebb5fb39ea4441b7" ]
[ "pyscf/dh/grad/udfdh.py" ]
[ "from __future__ import annotations\n# dh import\ntry:\n from dh.udfdh import UDFDH\n from dh.dhutil import calc_batch_size, gen_batch, gen_shl_batch, tot_size, timing\n from dh.grad.rdfdh import get_H_1_ao, get_S_1_ao, generator_L_1\n from dh.grad.rdfdh import Gradients as RGradients\nexcept ImportErro...
[ [ "numpy.einsum", "numpy.asarray", "numpy.zeros" ] ]
frankxu2004/tacred-relation-cotrain
[ "005dd0cf27d6a68fcf3cbef736de3fe9759ce6b4", "005dd0cf27d6a68fcf3cbef736de3fe9759ce6b4" ]
[ "prepare_vocab.py", "model/rnn.py" ]
[ "\"\"\"\nPrepare vocabulary and initial word vectors.\n\"\"\"\nimport json\nimport msgpack\nimport pickle\nimport argparse\nimport numpy as np\nfrom collections import Counter\n\nfrom utils import vocab, constant, helper\n\n\ndef parse_args():\n parser = argparse.ArgumentParser(description='Prepare vocab for rel...
[ [ "numpy.save" ], [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.cat", "torch.nn.LSTM", "torch.nn.functional.softmax", "torch.nn.init.xavier_uniform", "torch.autograd.Variable", "torch.nn.CrossEntropyLoss", "torch.save", "torch.from_numpy", "to...
hengwei-chan/TDC
[ "d19bd63c46c8f283c19764c3c9970de66f9a5d29" ]
[ "tdc/utils.py" ]
[ "import requests\nfrom zipfile import ZipFile \nimport os, sys\nimport numpy as np\nimport pandas as pd\nfrom pandas.errors import EmptyDataError\nimport json\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nimport subprocess\nimport pickle\nfrom fuzzywuzzy import fuzz\nfrom tqdm import tqdm\nfrom .metadata i...
[ [ "numpy.array", "numpy.random.choice", "numpy.median", "numpy.random.seed", "pandas.DataFrame", "matplotlib.pyplot.subplots", "numpy.mean", "numpy.random.shuffle", "numpy.nanargmax", "numpy.std", "matplotlib.pyplot.show", "numpy.log10", "numpy.nanmax", "numpy...
newUtkarsh/detectron2
[ "e1c055abff34513f347a767f43bfe60e275b136c" ]
[ "detectron2/utils/events.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport datetime\nimport json\nimport logging\nimport os\nfrom collections import defaultdict\nfrom contextlib import contextmanager\nimport torch\nfrom fvcore.common.file_io import PathManager\nfrom fvcore.common.history_buffer import HistoryB...
[ [ "torch.cuda.max_memory_allocated", "torch.cuda.is_available", "torch.utils.tensorboard.SummaryWriter" ] ]
SGeetansh/dffml
[ "04647bdcadef2f7e7b59cdd8ac1e89f17ef1095b" ]
[ "model/pytorch/dffml_model_pytorch/pytorch_base.py" ]
[ "import os\nimport pathlib\nfrom typing import Any, Tuple, AsyncIterator, List, Type, Dict\nimport copy\nimport time\n\nimport torch\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler\n\nimport numpy as np\n\nfrom dffml.record import Record\nfrom dffml.model.accuracy import Accuracy\nfrom dffml.base...
[ [ "torch.device", "numpy.array", "torch.optim.lr_scheduler.StepLR", "torch.max", "torch.save", "torch.no_grad", "torch.utils.data.random_split", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load", "torch.nn.functional.softmax", "torch.set_grad_enab...
ElielGez/Malicious_URL_zdm_new_features_lee_eliel
[ "04935b5b1b280906d684be36977151d89a09b4c6" ]
[ "Tools/collect_entropy.py" ]
[ "import pandas as pd\nfrom collections import defaultdict\nfrom urllib.parse import urlparse\nimport math\n\n\ndf = pd.read_csv('Final_newData_withFeatures.csv')\n\nurls = df['0']\n\nentropies = []\n\nfor index, url in enumerate(urls):\n domain=\"\"\n if url[:4] == 'http':\n domain = urlparse(url).net...
[ [ "pandas.read_csv", "pandas.Series" ] ]
gayhub-wpp/alpha_pipe_oldversion
[ "877047442ae939df3f15611d48ea2df1476a940c" ]
[ "alpha_pipe/analyzer/utils.py" ]
[ "from numpy import sqrt, mean\nfrom collections import Iterable\nfrom functools import wraps\nimport six\nimport pandas as pd\nimport numpy as np\nimport re\nimport warnings\n\nfrom IPython.display import display\nfrom pandas.tseries.offsets import CustomBusinessDay, Day, BusinessDay\nfrom scipy.stats import mode\n...
[ [ "pandas.tseries.offsets.CustomBusinessDay", "scipy.stats.mode", "pandas.qcut", "numpy.mean", "pandas.concat", "numpy.concatenate", "pandas.Timedelta", "pandas.set_option", "pandas.DataFrame", "pandas.MultiIndex", "numpy.sqrt", "numpy.isfinite", "numpy.array", ...
ExesiosPB/libm
[ "09c2638d895a4ba69e0d7f4f0e353f27d4b7911f", "8cb05bd9704c77e700fd2462e032cefd9a3ef475" ]
[ "tests/test_data_factory.py", "tests/utils/ReferenceData.py" ]
[ "import unittest\n\nimport pandas as pd\n\nfrom scripts import FilePaths\nfrom scripts import data_factory as factory\n\n\nclass TestDataFactory(unittest.TestCase):\n\n def setUp(self):\n self.__df = pd.read_pickle(FilePaths.us_patents_random_100_pickle_name)\n self.__df = self.__df.reset_index()\n...
[ [ "pandas.read_pickle" ], [ "pandas.Timestamp", "pandas.concat" ] ]
Zims/scraping-flask-sample
[ "083a4cf142d26bd40c807b718dcbabae2efd3cb2" ]
[ "scrapers/city24_scraper.py" ]
[ "from bs4 import BeautifulSoup\nimport requests\nimport pandas as pd\nimport time\nfrom datetime import datetime, timezone, timedelta\nimport pytz\n\ntz=pytz.timezone(\"Europe/Riga\")\ntime_now = datetime.now(tz)\nformat = \"%Y-%m-%d-%T\"\ntime_now = time_now.strftime(format)\ntime_now = time_now\n\ndef refresh_tim...
[ [ "pandas.DataFrame" ] ]
raijinspecial/imgclsmob
[ "c5d3ab207a6304f1343e4394f0467bdc7403a72a", "c87c0942420876941868c016211073dec4392e4d", "c5d3ab207a6304f1343e4394f0467bdc7403a72a", "c5d3ab207a6304f1343e4394f0467bdc7403a72a", "c5d3ab207a6304f1343e4394f0467bdc7403a72a" ]
[ "tensorflow_/tensorflowcv/models/mnasnet.py", "pytorch/pytorchcv/models/ibnbresnet.py", "pytorch/pytorchcv/models/peleenet.py", "gluon/gluoncv2/models/densenet_cifar.py", "gluon/gluoncv2/models/resnet_cifar.py" ]
[ "\"\"\"\n MnasNet, implemented in TensorFlow.\n Original paper: 'MnasNet: Platform-Aware Neural Architecture Search for Mobile,' https://arxiv.org/abs/1807.11626.\n\"\"\"\n\n__all__ = ['MnasNet', 'mnasnet']\n\nimport os\nimport tensorflow as tf\nfrom .common import conv2d, batchnorm, is_channels_first, flatte...
[ [ "tensorflow.trainable_variables", "tensorflow.nn.relu", "tensorflow.Session", "tensorflow.reset_default_graph", "tensorflow.layers.dense", "tensorflow.global_variables_initializer", "tensorflow.layers.average_pooling2d" ], [ "torch.nn.Linear", "torch.nn.init.kaiming_uniform...
JTZ18/auto-tinder
[ "c1d0795a402fa6c10d625d3b283597eb6b25c06b" ]
[ "person_detector.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom object_detection.utils import ops as utils_ops\nfrom PIL import Image\n\n\n\nPERSON_CLASS = 1\nSCORE_THRESHOLD = 0.5\n\ndef run_inference_for_single_image(image, sess):\n ops = tf.compat.v1.get_default_graph().get_operations()\n all_tensor_names = {output.nam...
[ [ "tensorflow.expand_dims", "tensorflow.compat.v1.get_default_graph", "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.cast", "tensorflow.compat.v1.GraphDef", "tensorflow.compat.v2.io.gfile.GFile", "tensorflow.squeeze", "tensorflow.greater", "tensorflow.slice", ...
kknet/imalookalike
[ "ca0917bbc24b74d560ebe5b83dd882a6683abddf" ]
[ "benchmark/net/facenet_predictor.py" ]
[ "import tensorflow as tf\nimport benchmark.net.facenet.facenet as facenet\nfrom benchmark.net.facenet import detect_face\nimport cv2\nimport numpy as np\n\n\n# some constants kept as default from facenet\nminsize = 20\nthreshold = [0.6, 0.7, 0.7]\nfactor = 0.709\nmargin = 44\ninput_image_size = 160\n\nsess = None\n...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "tensorflow.get_default_graph", "numpy.minimum", "tensorflow.Session", "numpy.squeeze", "numpy.maximum" ] ]
hanranCode/mega.pytorch
[ "28c8a184372aa57a942576a944b3526590bc1ace", "28c8a184372aa57a942576a944b3526590bc1ace" ]
[ "mega_core/modeling/roi_heads/box_head/inference.py", "tests/test_box_coder.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nfrom mega_core.structures.bounding_box import BoxList\nfrom mega_core.structures.boxlist_ops import boxlist_nms\nfrom mega_core.structures.boxlist_ops import cat_boxlist\n...
[ [ "torch.nonzero", "torch.cat", "torch.full", "torch.nn.functional.softmax" ], [ "numpy.array" ] ]
jschneidewind/pyH2A
[ "66f3943916ebdf5a4bae1706b74e5cef6131460e" ]
[ "Code/Plugins/Replacement_Plugin.py" ]
[ "from input_modification import insert, process_input, sum_all_tables\nimport numpy as np\nimport find_nearest as fn\n\nclass Replacement_Plugin:\n\t'''\n\t______________\n\tRequired Input\n\t______________\n\n\t# Planned Replacement\n\tName | Frequency (years) | Cost ($) | Path (optional)\n\t--- | --- | ---\n\tstr...
[ [ "numpy.ceil" ] ]
ishine/qa_match
[ "f1ede11a3e799edfb5e90d5b4396b304d2365778" ]
[ "sptm/run_classifier.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nfinetune on pretrained model with trainset and devset\n\"\"\"\n\nimport sys\nimport os\nimport tensorflow as tf\nimport numpy as np\nimport argparse\nimport models\nimport utils\n\n\ndef evaluate(sess, full_tensors, args, model):\n total_num = 0\n right_num = 0\n for batch...
[ [ "tensorflow.set_random_seed", "tensorflow.logging.set_verbosity", "numpy.random.seed", "numpy.sum", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.logging.info", "tensorflow.global_variables", "tensorflow.ConfigProto", "numpy.argmax", "tensorflow.app.run", ...
jsturtz/env
[ "d523b0be3345f883a727679d58ff29efb4389d16" ]
[ "Lib/site-packages/pandas_ml/snsaccessors/test/test_sns.py" ]
[ "#!/usr/bin/env python\nimport pytest\n\nimport matplotlib\nmatplotlib.use('Agg')\n\nimport numpy as np # noqa\nimport sklearn.datasets as datasets # noqa\n\nimport pandas_ml as pdml # noqa\nimport pandas_ml.util.testing as tm # noqa\n\ntry:\n import seaborn as sns...
[ [ "matplotlib.use", "sklearn.datasets.load_diabetes", "numpy.random.randn", "matplotlib.pyplot.subplots", "sklearn.datasets.load_iris" ] ]
i-pan/kaggle-melanoma
[ "def5cfbbb7cbf80560b41ef93fd2d6ee6e9e7b5a", "def5cfbbb7cbf80560b41ef93fd2d6ee6e9e7b5a" ]
[ "src/factory/evaluate/metrics.py", "src/check_cv_scores.py" ]
[ "import numpy as np\n\nfrom sklearn import metrics\n\n\ndef auc(y_true, y_pred, **kwargs):\n # y_pred.shape = (N, C)\n # AUC for melanoma (class 0)\n return {'auc': metrics.roc_auc_score((y_true==0).astype('float'), y_pred[:,0])}\n\n\ndef mel_auc(y_true, y_pred, **kwargs):\n # y_pred.shape = (N, C)\n ...
[ [ "sklearn.metrics.f1_score", "numpy.argmax", "sklearn.metrics.roc_auc_score" ], [ "numpy.max", "numpy.sort" ] ]
zhaoyuzhi/ChildPredictor
[ "ba36d9851a37522ec5a0de4eab3b973f872d885e", "ba36d9851a37522ec5a0de4eab3b973f872d885e" ]
[ "code/babymapping_1219/Models/pggan_tf_official/mapping_4.py", "code/ProGAN/tfutil.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.autograd as autograd\nfrom torchvision import models\nimport torch.nn.functional as F\nimport numpy as np\nimport math\n\nimport torch\nimport torch.nn as nn\n\n\"\"\"\n Mapping network\n Input: two tensor of size (batchsize, 512, 4, 4)\n Output: a tensor ...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LeakyReLU", "torch.nn.Conv2d", "torch.randn" ], [ "tensorflow.get_default_session", "tensorflow.group", "tensorflow.is_variable_initialized", "tensorflow.reshape", "tensorflow.assign_add", "tensorflow.zeros_like", "tenso...
jiricejchan/AnonymniAnalytici
[ "e4e96f943d0b2232d9099c6e7bb690a3d25ea422" ]
[ "2018_02_15_cryptocurrencies_trading/algorithms/shared/shannon's_demon-1500960177478.py" ]
[ "from catalyst.api import order_target_percent, record, symbol, set_benchmark\r\n\r\ndef initialize(context):\r\n context.ASSET_NAME = 'USDT_REP'\r\n context.asset = symbol(context.ASSET_NAME)\r\n set_benchmark(context.asset)\r\n context.is_first_time = True\r\n \r\n # For all trading pairs in the...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.legend", "matplotlib.pyplot.gcf", "matplotlib.pyplot.subplot" ] ]
telemetry2u/public
[ "cda938d5806c034e5cb3277a6c98fb1acbc0f528" ]
[ "Python/Telemetry2U.py" ]
[ "#!/usr/bin/env python\n# Simple Python script demonstrating use of the Telemetry2U APi\n# to retrieve data from LoRaWAN nodes.\n\n# MIT License\n# Copyright (c) 2021 Telemetry2U Pty Lrd\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation fi...
[ [ "matplotlib.pyplot.show", "pandas.json_normalize" ] ]
lyyu0413/InstaF_Python
[ "949f5bd1c6d4d534409e36c977fd3b12b555f3d3" ]
[ "InstaF_Python/RGB_manipulation.py" ]
[ "# Copyright 2019 Betty Zhou\n\nimport numpy as np\nimport skimage.io\nimport pytest\n\ndef RGB_manipulation(input_path, output_path, R = 2, G = 2, B = 2):\n '''\n Manipulates the RGB intensity of an image\n\n Inputs\n ------\n input_path: string, path for an image file in .png format\n output_pat...
[ [ "numpy.array" ] ]
shafferm/kb_DRAM
[ "f414190b56e12aef939e405413b930b96ccb781a" ]
[ "lib/kb_DRAM/kb_DRAMImpl.py" ]
[ "# -*- coding: utf-8 -*-\n#BEGIN_HEADER\nimport logging\nimport os\nimport pandas as pd\nimport yaml\nimport warnings\n\nfrom mag_annotator import __version__ as dram_version\nfrom mag_annotator.database_processing import import_config, set_database_paths, print_database_locations\nfrom mag_annotator.annotate_bins ...
[ [ "pandas.read_csv" ] ]
Niky1/size-image-annotator
[ "fce57e97ac61601aa8c67cf69438f6dc6dbac946" ]
[ "plot_results.py" ]
[ "import json\nimport os.path\nimport sys\nfrom os import path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom imageio import imread\nfrom matplotlib import gridspec\n\nwith open(sys.argv[1]) as f:\n data = json.load(f)\npicture_indices = [i for datapoint in data for i in (\n datapoint[\"left\"], ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.imshow", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.figure" ] ]
minister19/Python_snippets
[ "69accc4278443271aefc7e354161eac7df2fa283" ]
[ "pandas/rolling_mean.py" ]
[ "import matplotlib\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom numpy import NaN\n\nis_ipython = 'inline' in matplotlib.get_backend()\nif is_ipython:\n from IPython import display\n\n\ndef plot_single_with_mean(config):\n '''\n config: {\n 'id': unique identifier,\n 'title': ''...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.pause", "pandas.Series", "matplotlib.pyplot.show", "matplotlib.get_backend" ] ]
norbertosanchezdichi/TIL
[ "2e9719ddd288022f53b094a42679e849bdbcc625" ]
[ "MachineLearning/Classification/KernelSupportVectorMachine(SVM)Classification/kernel_support_vector_machine_(svm)_classification.py" ]
[ "# Import libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Import dataset\ndataset = pd.read_csv('Social_Network_Ads.csv')\nX = dataset.iloc[:, :-1].values\nY = dataset.iloc[:, -1].values\n\nprint(f\"X = {X}\")\nprint(f\"Y = {Y}\")\nprint()\n\n# Split Dataset: Training Set an...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.colors.ListedColormap", "sklearn.svm.SVC", "sklearn.metrics.accuracy_score", ...
sulaymandesai/pyUSID
[ "fa4d152856e4717c92b1fbe34222eb2e1c042707" ]
[ "examples/beginner/plot_hdf_utils_read.py" ]
[ "\"\"\"\n================================================================================\n04. Utilities for reading h5USID files\n================================================================================\n\n**Suhas Somnath**\n\n4/18/2018\n\n**This document illustrates the many handy functions in pyUSID.hdf_...
[ [ "numpy.array", "matplotlib.pyplot.subplots" ] ]
t-b/pynwb
[ "b58e7b003247485120380360bb112bc6b22c7e60" ]
[ "docs/gallery/general/linking_data.py" ]
[ "'''\nModular Data Storage using External Files\n===========================================\n\nPyNWB supports linking between files using external links.\n'''\n\n####################\n# Example Use Case: Integrating data from multiple files\n# ---------------------------------------------------------\n#\n# NBWCont...
[ [ "numpy.arange" ] ]
YeongHyeon/CVAE
[ "5db95ea6a1a01475cd0356e31bf593f09b5479c2" ]
[ "source/datamanager.py" ]
[ "import numpy as np\nimport tensorflow as tf\n\nfrom sklearn.utils import shuffle\n\nclass Dataset(object):\n\n def __init__(self, normalize=True):\n\n print(\"\\nInitializing Dataset...\")\n\n self.normalize = normalize\n\n (x_tr, y_tr), (x_te, y_te) = tf.keras.datasets.mnist.load_data()\n ...
[ [ "numpy.ndarray.astype", "tensorflow.keras.datasets.mnist.load_data", "numpy.expand_dims", "sklearn.utils.shuffle" ] ]
bdpedigo/molesq
[ "297c08dc0a41390dda5e8e5fc1bda612d7c417c0" ]
[ "tests/test_utils.py" ]
[ "import numpy as np\n\nfrom molesq.utils import grid_field\n\n\ndef test_grid_field():\n test, shape = grid_field([0, 0], [2, 2])\n ref = np.array(\n [\n [0, 0],\n [0, 1],\n [1, 0],\n [1, 1],\n ]\n ).astype(test.dtype)\n assert np.allclose(test, ...
[ [ "numpy.allclose", "numpy.array" ] ]
Saduf2019/tensorflow-1
[ "f210b2b2f8489ffe97edac886238242288950439" ]
[ "tensorflow/python/ops/ragged/ragged_tensor.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.math_ops.equal", "tensorflow.python.ops.gen_ragged_conversion_ops.ragged_tensor_from_variant", "tensorflow.python.ops.math_ops.minimum", "tensorflow.python.ops.array_ops.ones", "tensorflow.python.ops.math_ops.reduce_sum", "tensorflow.python.framework.type_spec.type_s...
zfergus2/Seam-Minimization-Service
[ "2cfce0e4e29d3b40b0b8626994a6e6b89d5303cd" ]
[ "seam_erasure/points_in_triangle.py" ]
[ "\"\"\"\nUtility file for testing if points are in a given triangle.\n\nWritten by Zachary Ferguson\n\"\"\"\n\nimport numpy\n\n\ndef points_in_triangle(tri, points, tol=1e-8):\n \"\"\"\n Test if the points are inside the triangle.\n\n Input:\n tri - the triangle as a matrix where the rows are the xy...
[ [ "numpy.all", "numpy.ones", "numpy.zeros", "numpy.linalg.solve" ] ]
minotm/NTA
[ "cc8aba4ea46fe40ce621f1314d9798f54de41d5b" ]
[ "preprocessing/her2_split_and_imbalance.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated 2022\n\n@author: Mason Minot\n\"\"\"\nfrom Levenshtein import distance as levenshtein_distance\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\n\n\nprint('Now Executing Trastuzumab Train/Val/Test Splitti...
[ [ "numpy.random.seed", "pandas.DataFrame", "numpy.random.permutation", "numpy.round", "pandas.concat", "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
jdvelasq/techminer-api
[ "d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da", "d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da" ]
[ "techminer2/slope_chart.py", "techminer2/lotka_law.py" ]
[ "\"\"\"\nSlope Chart\n===============================================================================\n\"\"\"\nimport textwrap\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n# from .plots.multiindex2text import multindex2text\n\nTEXTLEN = 35\n\n\ndef slope_chart(\n...
[ [ "matplotlib.pyplot.Figure", "numpy.linspace", "matplotlib.pyplot.cm.get_cmap", "matplotlib.rc" ], [ "matplotlib.pyplot.cm.get_cmap", "pandas.isna", "matplotlib.pyplot.subplots" ] ]
andrewkouri/lidar-bonnetal
[ "a0b5c6aba530701084ac66a02532689ed580f934" ]
[ "train/tasks/semantic/dataset/kitti/parser.py" ]
[ "import os\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nfrom common.laserscan import LaserScan, SemLaserScan\n\nEXTENSIONS_SCAN = ['.bin']\nEXTENSIONS_LABEL = ['.label']\n\n\ndef is_scan(filename):\n return any(filename.endswith(ext) for ext in EXTENSIONS_SCAN)\n\n\ndef is_label(filen...
[ [ "numpy.zeros", "torch.from_numpy", "torch.full", "torch.tensor", "torch.utils.data.DataLoader" ] ]
sarahsester/q_hackathon
[ "963dcfbe8e3fa8bda954f4fc6db8a238f1d8a720" ]
[ "src/teacher_school_allocation.py" ]
[ "from ortools.linear_solver import pywraplp\nimport pandas as pd\nimport numpy as np\n\n\ndef create_cost_matrix(distances, pref_big_school, pref_rural):\n cost_matrix = distances + 10 * pref_big_school + 10 * pref_rural\n return cost_matrix\n\n\ndef find_optimal_allocation(df_schools, distances, pref_big_sch...
[ [ "pandas.read_pickle", "pandas.DataFrame", "pandas.read_csv", "numpy.array" ] ]
rdesarz/rrtstar
[ "0e2737fbb7bb7e45789d606e6c6c2b7ce5824f65" ]
[ "rrtstar/sampling.py" ]
[ "import random\n\nimport numpy as np\n\nfrom rrtstar.geometry import Zone2d, Point2d\n\n\ndef generate_new_sample_uniform(planification_zone: Zone2d) -> Point2d:\n x = np.random.uniform(planification_zone.x_min, planification_zone.x_max, 1)\n y = np.random.uniform(planification_zone.y_min, planification_zone....
[ [ "numpy.random.uniform" ] ]
Bobyuan1015/KDA
[ "ce442922deb93b1bfe2ad7c418f1c63f5c40e000" ]
[ "helper/webSearchCloseWords.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n File Name: url_content.py\n Description : the main detail logic of auditing url sms\n Author : yuanfang\n date: 2019/12/13\n\"\"\"\n\nfrom lxml import html\nimport pandas as pd\nimport sys\nimport os\nimport pathlib\nimport re\nimport requests\n\nfrom he...
[ [ "pandas.read_csv" ] ]
N-Lambin/TFE-EEG
[ "0308e790a8f1045c85cbc1ec9e054e6136af58a3" ]
[ "Python/miscellaneous/plt.py" ]
[ "import matplotlib.pyplot as plt\nimport csv\nimport numpy as np\nfrom scipy import signal\n\nfileDir = 'winkLeft\\\\winkLeft10Data\\\\'\nfileName = 'AF3.csv'\nfs = 128\nx = []\n\nwith open(\".\\\\csv\\\\csvCleanData\\\\\" + fileDir + fileName, \"r\") as csvfile:\n csv_reader = csv.reader(csvfile, delimiter = '\...
[ [ "matplotlib.pyplot.show", "numpy.array", "matplotlib.pyplot.semilogy", "scipy.signal.periodogram" ] ]
TUM-LMF/MTLCC-pytorch
[ "894a470be2fb4b9e2e0b9e20e8684131ffdb5577" ]
[ "src/models/convlstm/convlstm.py" ]
[ "import torch.nn as nn\nfrom torch.autograd import Variable\nimport torch\n\n\nclass ConvLSTMCell(nn.Module):\n\n def __init__(self, input_size, input_dim, hidden_dim, kernel_size, bias):\n \"\"\"\n Initialize ConvLSTM cell.\n \n Parameters\n ----------\n input_size: (in...
[ [ "torch.zeros", "torch.sigmoid", "torch.cat", "torch.stack", "torch.nn.ModuleList", "torch.split", "torch.nn.Conv2d", "torch.tanh" ] ]
huakeda1/Basic-algorithm-and-framework-study-for-AI
[ "8776dc500772a6c1f28be9c4a426ed9eca2ec775" ]
[ "search_engine/search_engine_with_rank.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport pandas as pd\nimport jieba\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom functools import reduce\nimport numpy as np\nimport os\nimport re\nfrom scipy.spatial.distance import cosine\n\n\n# In[2]:\n\n\ncsv_file='dataset/news.csv'\ni...
[ [ "numpy.where", "pandas.read_csv", "scipy.spatial.distance.cosine", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
LordDarkula/eva
[ "93433bc88f361c277690c9e31f1b8de657f25823" ]
[ "test/expression/test_logical.py" ]
[ "# coding=utf-8\n# Copyright 2018-2020 EVA\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 l...
[ [ "pandas.DataFrame" ] ]
rravenel/furuta_pendulum
[ "b2f2a3bb8c6f2676671a24c6f9ea4d8e6479835f", "b2f2a3bb8c6f2676671a24c6f9ea4d8e6479835f" ]
[ "bldc/odrive/drag_profiler.py", "simple/src/run.py" ]
[ "import odrive\nimport matplotlib.pyplot as plt\nimport time\n\n'''\nMeasure internal drag/friction. Spin it up and clock it slowing down.\n\n1465rpm / 154 rad/s / 24.4Hz: -356 rad/s^2\n2197rpm / 230 rad/s / 36.6Hz: -378 rad/s^2\n2930rpm / 307 rad/s / 48.8Hz: -342 rad/s^2\n3663rpm / 383 rad/s / 61.0Hz: -324 rad/s^...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ], [ "numpy.nonzero", "tensorflow.ConfigProto", "numpy.zeros" ] ]
arassadin/SYQ
[ "d30e6f0053ada3ad504038698a8756425594aa22" ]
[ "tensorpack/train/input_data.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# File: input_data.py\n# Author: Yuxin Wu <ppwwyyxxc@gmail.com>\n\nimport tensorflow as tf\nimport threading\nfrom abc import ABCMeta, abstractmethod\nimport six\n\nfrom ..dataflow import DataFlow, RepeatedData\nfrom ..tfutils.summary import add_moving_summary\nfrom ...
[ [ "tensorflow.FIFOQueue", "tensorflow.constant_initializer", "tensorflow.cast", "tensorflow.device" ] ]
myychal/hypernet
[ "778e9c1a2f27ab1c664bb6d8ea49c65d0c7bdade", "778e9c1a2f27ab1c664bb6d8ea49c65d0c7bdade" ]
[ "python_research/preprocessing/attribute_profiles/max_tree/attribute_matrix_construction.py", "python_research/experiments/multiple_feature_learning/utils/unbalanced_data.py" ]
[ "import numpy as np\nfrom .attributes_incrementally import StandardDeviation, LengthOfDiagonal, \\\n FirstHuMoment, Area\nfrom ..utils.data_types import Pixel\n\n\ndef construct_area_matrix(image: np.ndarray) -> np.ndarray:\n matrix = np.ones(image.shape, dtype=Area)\n image_width = image.shape[1]\n for...
[ [ "numpy.ones", "numpy.amax", "numpy.zeros", "numpy.amin" ], [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.delete", "numpy.load", "numpy.min", "numpy.where", "numpy.unique" ] ]
kitstar/nni
[ "c5c0fa2e2dede71d2797a8bafa85c90f59d311f8" ]
[ "src/sdk/pynni/tests/test_trial.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n#\n# MIT License\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and\n# associated documentation files (the \"Software\"), to deal in the Software without restriction,\n# including without limitation th...
[ [ "numpy.array", "numpy.float32" ] ]
bgoli/stochpy
[ "ba06e5eaf1204dbc8ea39996ff8a08e9b0b5997d" ]
[ "stochpy/modules/Analysis.py" ]
[ "#! /usr/bin/env python\n\"\"\"\nAnalysis\n========\n\nThis module provides functions for Stochastic Simulation Algorithms Analysis (SSA). Implemented SSAs import this module to perform their analysis. Plotting of time series species, propensities), distributions (species, propensities, distributions), autocorrelat...
[ [ "numpy.concatenate", "numpy.product", "numpy.array", "matplotlib.colors.is_color_like", "numpy.zeros", "numpy.log", "numpy.fft.fftpack.ifft", "numpy.mean", "numpy.diff", "numpy.std", "numpy.fft.fftpack.fft", "numpy.fft.fftpack.ifftn", "numpy.issubdtype", "nu...
mahdiqezlou/vw_spectra
[ "975b125a03b3f8505e01db7fd4b4c3c609271499" ]
[ "vw_plotspectra.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Contains the plotting-specific functions specific to the velocity width analysis.\"\"\"\n\nfrom __future__ import print_function\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom fake_spectra import plot_spectra as ps\nfrom fake_spectra import haloassigned_spectra as hs\nimp...
[ [ "matplotlib.pyplot.xlim", "numpy.median", "numpy.min", "numpy.where", "numpy.size", "numpy.cumsum", "numpy.max", "numpy.random.normal", "numpy.histogram", "matplotlib.pyplot.semilogx", "matplotlib.pyplot.fill_between", "numpy.arange", "numpy.log10", "numpy.a...
pw0908/RMG-Py
[ "3846fcce701f2a5fd12dbfa429687e9fcd647298" ]
[ "rmgpy/tools/data.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n###############################################################################\n# #\n# RMG - Reaction Mechanism Generator #\n# ...
[ [ "numpy.array" ] ]
michael-weinstein/Elevation
[ "cd783ed7ea09d6d7c8c13dbba0c5f7daf5fa1719" ]
[ "tests/predict_test.py" ]
[ "import os\nimport sys\nimport shutil\n\nimport unittest\n# from mock import patch, Mock, PropertyMock, MagicMock\n\nimport pandas as pd\nimport numpy as np\nfrom warnings import warn\n\n\nclass PredictTest(unittest.TestCase):\n\n def __init__(self, *args, **kwargs):\n super(PredictTest, self).__init__(*a...
[ [ "numpy.random.RandomState", "pandas.DataFrame", "pandas.read_excel", "numpy.allclose", "numpy.abs" ] ]
talumbau/blaze
[ "66c9e61476f11d53f7b734664214537182397739" ]
[ "blaze/objects/array.py" ]
[ "\"\"\"This file defines the Concrete Array --- a leaf node in the expression graph\n\nA concrete array is constructed from a Data Descriptor Object which handles the\n indexing and basic interpretation of bytes\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nimport datashape\n\nfrom ...
[ [ "numpy.array" ] ]
LaiaTarres/TransferLearningMusic
[ "d662327d320031ea3492720b5134ccc01d17983a" ]
[ "src/vggish_input.py" ]
[ "# Copyright 2017 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 requi...
[ [ "numpy.mean" ] ]
ajschmidt8/cugraph
[ "7ad8fc36254bbc7d1a1dc7d321a93b08a66c26ab" ]
[ "python/cugraph/dask/common/input_utils.py" ]
[ "# Copyright (c) 2020-2021, NVIDIA CORPORATION.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applica...
[ [ "numpy.array" ] ]
Suke-H/LearningToPaint
[ "444e01477ff1b632df931da67af67464c0f9cb98" ]
[ "copy_logo.py" ]
[ "from glob import glob\nimport numpy as np\nimport shutil\nimport os\n\nSOURCE_PATH = \"data/LLD-logo-files/\"\nMV_PATH = \"image/\"\n\nimgs = np.array(glob(SOURCE_PATH + \"**\"))\nN = len(imgs)\nprint(N)\n\nchoice = np.random.choice(N, 10)\nprint(choice)\n\nfor img in imgs[choice]:\n # img_name = os.path.basena...
[ [ "numpy.random.choice" ] ]
OrtnerMichael/magPyLib
[ "4c7e7f56f6e0b915ec0e024c172c460fa80126e5", "4c7e7f56f6e0b915ec0e024c172c460fa80126e5" ]
[ "magpylib/_src/display/plotly/plotly_sensor_mesh.py", "tests/test_exceptions.py" ]
[ "import numpy as np\n\n\ndef get_sensor_mesh(\n x_color=\"red\",\n y_color=\"green\",\n z_color=\"blue\",\n center_color=\"grey\",\n x_show=True,\n y_show=True,\n z_show=True,\n center_show=True,\n colorize_tails=True,\n):\n \"\"\"\n returns a plotly mesh3d dictionary of a x,y,z arr...
[ [ "numpy.concatenate", "numpy.array" ], [ "numpy.array", "scipy.spatial.transform.Rotation.from_quat", "numpy.zeros" ] ]
hadrianl/rqalpha_kairui
[ "eb0e0de1d69f1a4d6f349d4dc011e1c9eccfe2d8" ]
[ "rqalpha/examples/extend_api/HKMod/realtime_data_source.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 2018/10/30 0030 9:43\n# @Author : Hadrianl \n# @File : realtime_data_source\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 Licen...
[ [ "pandas.Timestamp", "numpy.array" ] ]
ryanmdavis/classifyHistology
[ "563687250f6d81a7e2596607587238354e7279e5" ]
[ "train_net/read_and_reshape_data.py" ]
[ "from tensorflow.examples.tutorials.mnist import input_data\n\ndef readReshapeData(path):\n # extract data\n data = input_data.read_data_sets(path,one_hot=True)\n \n # print info about the datasets\n # Shapes of training set\n print(\"Training set (images) shape: {shape}\".format(shape=data.train....
[ [ "tensorflow.examples.tutorials.mnist.input_data.read_data_sets" ] ]
ty-97/SDA
[ "047d8e6ed238f77d8a7846cf3ac9916c4f0d8fbc" ]
[ "test_models.py" ]
[ "# Code for \"TSM: Temporal Shift Module for Efficient Video Understanding\"\r\n# arXiv:1811.08383\r\n# Ji Lin*, Chuang Gan, Song Han\r\n# {jilin, songhan}@mit.edu, ganchuang@csail.mit.edu\r\n\r\nimport os\r\nimport time\r\nimport shutil\r\nimport torch.nn.parallel\r\nimport torch.backends.cudnn as cudnn\r\nimport ...
[ [ "sklearn.metrics.confusion_matrix", "torch.nn.functional.softmax" ] ]
1512474508/deep-generative-models
[ "67d65d63f9f67050c29ae500bdd6b4518da14f7c" ]
[ "src/train_DBM.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport os\nimport pickle\nimport datetime\nimport argparse\nimport re\nimport glob\nfrom obj.DBM import DBM\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.image as mpimg\nfrom skimage.transform import resize\n\n################################\n# ...
[ [ "numpy.asarray", "matplotlib.image.imread", "numpy.mean", "tensorflow.reshape", "numpy.std" ] ]
deecamp2019-group20/CNN_PokerNet
[ "751576cb941be57c8a37656feaff14b414c3dcb2" ]
[ "game/engine.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n自定义相关类\n\"\"\"\nimport numpy as np\nfrom typing import List, Tuple, Dict\nimport pandas as pd\nfrom collections import defaultdict\nfrom os.path import join, abspath, dirname\nfrom .card_util import All as backup, cache\nfrom .gameutil import card_show\nfrom copy import copy\nfrom ...
[ [ "numpy.all", "numpy.array", "numpy.random.shuffle", "numpy.zeros" ] ]
marcelooyaneder/Arboretum_Antumapu
[ "bc1d850ea0c6d45368b3bdb8b834b05dd49f9a57" ]
[ "main.py" ]
[ "# -*- coding: utf-8 -*-\r\n\r\n\"\"\" # CRÉDITOS\r\nSoftware desarrllado en el laboratorio de biología de plantas ubicado en el campus Antumapu perteneciente a la Universidad de Chile.\r\n - Autores: \r\n - Paulette Naulin Gysling. \r\n - Marcelo Oyaneder Labarca.\r\n - Contacto:\r\n - marcelo.oyaneder.l@gm...
[ [ "pandas.DataFrame", "pandas.read_excel", "numpy.base_repr", "pandas.ExcelWriter", "pandas.read_csv" ] ]
nchlis/rsom_vasculature
[ "320b6f0ff0a9968f18c6500aaa93d4c1d86ad25f" ]
[ "step1_UNET_train.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Sep 6 16:04:13 2018\n\n@author: N.Chlis\n\"\"\"\n#if used on a non-GUI server ######\n#import matplotlib\n#matplotlib.use('Agg')\n###################################\n\nimport tensorflow as tf\ngpus = tf.config.experimental.list_physical_devices('GPU')\nif gpus:\n ...
[ [ "numpy.zeros_like", "numpy.array", "numpy.random.choice", "numpy.load", "tensorflow.config.experimental.set_memory_growth", "numpy.random.uniform", "numpy.arange", "numpy.flip", "sklearn.model_selection.train_test_split", "numpy.expand_dims", "tensorflow.config.experime...
helderpsilva/tictactoe_reinforcement_learning
[ "2d7abfb1832545d7287f84f1f7cf4f94cdb8adbb" ]
[ "assets/agent.py" ]
[ "# importar librarias necessarias.\nimport numpy as np\n\nclass Agent():\n \"\"\"Criação da entidade agente\"\"\"\n\n # O símbolo é X ou 0\n # O epsilon é a probabilidade que o agente tem de fazer uma escolha aleatória\n # O learning rate é a taxa de aprendizagem\n def __init__(self, symbol, epsilon ...
[ [ "numpy.random.random", "numpy.argmax" ] ]
mchoi8739/sagemaker-debugger
[ "fcc02366d06308642cf96b17aae417db9c1192d5" ]
[ "tests/profiler/tensorflow2/test_native_tf2_profiler.py" ]
[ "# Standard Library\nimport os\n\n# Third Party\nimport pytest\nimport tensorflow as tf\nfrom tests.profiler.core.utils import validate_python_profiling_stats\nfrom tests.tensorflow2.utils import ModelType\n\n# First Party\nimport smdebug.tensorflow as smd\nfrom smdebug.core.collection import CollectionKeys\nfrom s...
[ [ "tensorflow.one_hot", "tensorflow.keras.optimizers.Adam", "tensorflow.GradientTape" ] ]
prarabdh9909/audio
[ "6bad3a66a7a1c7cc05755e9ee5931b7391d2b94c" ]
[ "test/torchaudio_unittest/functional/functional_impl.py" ]
[ "\"\"\"Test defintion common to CPU and CUDA\"\"\"\nimport torch\nimport torchaudio.functional as F\nfrom parameterized import parameterized\nfrom scipy import signal\n\nfrom torchaudio_unittest import common_utils\n\n\nclass Lfilter(common_utils.TestBaseMixin):\n def test_simple(self):\n \"\"\"\n ...
[ [ "torch.zeros", "torch.rand", "scipy.signal.butter", "torch.ones", "torch.random.manual_seed", "torch.from_numpy", "torch.tensor" ] ]
berndbohnet/flax
[ "5aa7f335bb8819088c8b1aa89aa459c99eb00c1c" ]
[ "tests/core/design/core_custom_vjp_test.py" ]
[ "# Copyright 2022 The Flax 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 applicable law or a...
[ [ "numpy.sign" ] ]
diningphil/CGMM-ICML2018
[ "c6da2ac267edae0a0326818c6b4f4a6c141a053f", "c6da2ac267edae0a0326818c6b4f4a6c141a053f" ]
[ "util.py", "cgmm_classifier_task.py" ]
[ "from typing import Optional, Tuple, List\n\nimport torch\nimport torch_geometric\n\n\ndef extend_lists(data_list: Optional[Tuple[Optional[List[torch.Tensor]]]],\n new_data_list: Tuple[Optional[List[torch.Tensor]]]) -> Tuple[Optional[List[torch.Tensor]]]:\n r\"\"\"\n Extends the semantic of Py...
[ [ "torch.Size", "torch.mul", "torch.ones", "torch.unique_consecutive", "torch.cumsum", "torch.sparse.mm" ], [ "torch.load", "torch.reshape" ] ]
Z-T-WANG/DeepReinforcementLearningControlOfQuantumCartpoles
[ "3b243f235b4945a4817b738d8dbc412937de9f28" ]
[ "implementation codes/quartic oscillator/setupC.py" ]
[ "from distutils.core import setup, Extension\nfrom math import pi\nimport numpy as np \nimport os, sys, shutil, glob\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--lambda', default= pi/25., type=float, metavar='\\lambda',\n help='the strength of the quartic anharmo...
[ [ "numpy.get_include" ] ]
urigoren/allennlp
[ "236e1fd01ca30409cd736625901292609009f5c4" ]
[ "allennlp/training/metrics/attachment_scores.py" ]
[ "from typing import Optional, List\n\nfrom overrides import overrides\nimport torch\n\nfrom allennlp.training.metrics.metric import Metric\n\n\n@Metric.register(\"attachment_scores\")\nclass AttachmentScores(Metric):\n \"\"\"\n Computes labeled and unlabeled attachment scores for a\n dependency parse, as w...
[ [ "torch.ones_like" ] ]
emycooper/adaptnlp
[ "2e39f81a7faa4c7cd1d2a3764790cf7bb7ad7469" ]
[ "adaptnlp/training.py" ]
[ "from typing import Union, Dict\nfrom pathlib import Path\nimport json\nimport csv\n\nimport numpy as np\n\nfrom adaptnlp import EasyDocumentEmbeddings\n\nfrom flair.datasets import CSVClassificationCorpus\nfrom flair.data import Corpus\nfrom flair.embeddings import DocumentRNNEmbeddings\nfrom flair.models import T...
[ [ "numpy.gradient" ] ]
AlexanLee/DeepCTR
[ "1ff32c6b0105e3341ddf34e7074e596032bff158" ]
[ "examples/run_dien.py" ]
[ "import numpy as np\nimport tensorflow as tf\n\nfrom deepctr.models import DIEN\nfrom deepctr.inputs import SparseFeat, DenseFeat, VarLenSparseFeat, get_feature_names\n\n\ndef get_xy_fd(use_neg=False, hash_flag=False):\n feature_columns = [SparseFeat('user', 3, embedding_dim=10, use_hash=hash_flag),\n ...
[ [ "numpy.array", "tensorflow.compat.v1.disable_eager_execution" ] ]
ColdTeapot273K/bert-extractive-summarizer
[ "19c4b5a5790294bbbc5a26e8248655705710ff14" ]
[ "summarizer/model_processors.py" ]
[ "from summarizer.bert_parent import BertParent\nfrom summarizer.cluster_features import ClusterFeatures\nfrom summarizer.sentence_handler import SentenceHandler\nfrom typing import List\nfrom abc import abstractmethod\nimport numpy as np\nfrom transformers import *\n\n\nclass ModelProcessor(object):\n\n def __in...
[ [ "numpy.random.seed" ] ]
sajastu/abs-summarization
[ "9d4b35b457cfd617965ed1fab68c173c98333439", "9d4b35b457cfd617965ed1fab68c173c98333439" ]
[ "onmt/utils/loss.py", "onmt/tests/test_models.py" ]
[ "\"\"\"\nThis includes: LossComputeBase and the standard NMTLossCompute, and\n sharded loss compute stuff.\n\"\"\"\nfrom __future__ import division\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport onmt\nfrom onmt.modules.sparse_losses import SparsemaxLoss\nfrom onmt.modu...
[ [ "torch.nn.NLLLoss", "torch.autograd.backward", "torch.split", "torch.nn.functional.kl_div", "torch.full" ], [ "torch.zeros", "torch.cat", "torch.ones" ] ]
Fred62879/ACORN
[ "2de0bf747d595dbdc4d67311fb8f46cf47f9b4cb" ]
[ "utils.py" ]
[ "import os\nimport torch\nimport numpy as np\nimport skimage.measure\nimport matplotlib.pyplot as plt\n\nfrom tqdm import tqdm\nfrom astropy.io import fits\nfrom astropy.wcs import WCS\nfrom astropy.nddata import Cutout2D\nfrom torchvision.utils import make_grid\n\n\ndef cond_mkdir(path):\n if not os.path.exists...
[ [ "numpy.max", "torch.cat", "numpy.zeros_like", "torch.cuda.synchronize", "numpy.zeros", "numpy.round", "matplotlib.pyplot.savefig", "torch.split", "torch.no_grad", "numpy.min", "numpy.save", "numpy.mean", "torch.cuda.is_available", "torch.tensor", "numpy....
t24kc/raspberry-pi
[ "505a504019165fb4a66c13bc27eff443bc083b1d" ]
[ "main/handler.py" ]
[ "from datetime import datetime\nfrom time import sleep\nfrom lib.mail import Mail\nfrom lib.spread_sheet import SpreadSheet\nfrom sensor.SHT31 import SHT31\nfrom sensor.BH1750FVI import BH1750FVI\nfrom sensor.VL6180 import VL6180X\nfrom sensor.CO2MINI import CO2MINI\nfrom sensor.relay_module import RelayModule\n\ni...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots" ] ]
tum-ai/expingo-inpainting-service
[ "657f65316c179f85507350d55e4ab4ac429552a0" ]
[ "app/main.py" ]
[ "import numpy as np\nimport cv2\n\nimport uvicorn\nimport tensorflow as tf\nimport neuralgym as ng\nfrom fastapi.middleware.cors import CORSMiddleware\nfrom pydantic import BaseModel\n\nfrom fastapi import FastAPI, UploadFile, File\nfrom fastapi import HTTPException\nfrom inpaint.inpainting_model import InpaintCAMo...
[ [ "numpy.concatenate", "numpy.array", "tensorflow.assign", "tensorflow.reset_default_graph", "tensorflow.Session", "tensorflow.reverse", "tensorflow.ConfigProto", "tensorflow.constant", "tensorflow.saturate_cast", "numpy.transpose", "tensorflow.contrib.framework.load_vari...
rkent/BDBD
[ "c5d391da84faf5607c443078781f8b4e1c017dd5" ]
[ "src/bdbd/src/bdbd/analysis/motion/NewRaph10.py" ]
[ "# newton-raphson iteration of motion equations\n\nimport numpy as np\nimport rospy\nimport math\nimport time\nfrom bdbd_common.utils import fstr, gstr\nfrom bdbd_common.msg import LeftRights\nfrom bdbd_common.geometry import lr_est, default_lr_model, D_TO_R\n\ndef estr(a):\n return fstr(a, fmat='10.7g', n_per_l...
[ [ "numpy.concatenate", "numpy.square", "numpy.array", "numpy.sin", "numpy.empty", "numpy.asarray", "numpy.zeros", "numpy.dot", "numpy.absolute", "matplotlib.pyplot.figure", "matplotlib.pyplot.waitforbuttonpress", "numpy.power", "numpy.cos", "numpy.cumsum", ...
Zhangxu0501/models
[ "42a3da72313b8814ef0ced8f425af90b57313b9f", "42a3da72313b8814ef0ced8f425af90b57313b9f" ]
[ "research/ptn/train_ptn.py", "research/object_detection/anchor_generators/multiple_grid_anchor_generator_test.py" ]
[ "# Copyright 2017 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 requi...
[ [ "tensorflow.train.AdamOptimizer", "tensorflow.concat", "numpy.minimum", "tensorflow.Graph", "tensorflow.image.resize_nearest_neighbor", "tensorflow.DeviceSpec", "tensorflow.identity", "tensorflow.control_dependencies", "tensorflow.app.run", "tensorflow.train.SyncReplicasOpt...
jaegonlee/fer
[ "628651d88568103f5b2b3e081d5c6b5dab39267d" ]
[ "FER_osc.py" ]
[ "#!/usr/local/bin/python3\n\nfrom keras.models import model_from_json\nimport numpy as np\nimport cv2\nimport argparse\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\nimport math\n\nfrom pythonosc import udp_client\n\nclass FacialExpressionModel(object):\n EMOTIONS_LIST = [\"Angry\", \"Disgust\", \"Fear\", \...
[ [ "numpy.argmax" ] ]
harshasunder-1/pyleecan
[ "32ae60f98b314848eb9b385e3652d7fc50a77420" ]
[ "Tests/Methods/Machine/test_Magnet_Type_10_meth.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pytest\n\nfrom pyleecan.Classes.LamSlotMag import LamSlotMag\nfrom pyleecan.Classes.SlotMFlat import SlotMFlat\nfrom pyleecan.Classes.MagnetType10 import MagnetType10\nfrom pyleecan.Classes.Segment import Segment\nfrom pyleecan.Methods.Machine.Magnet.comp_surface import comp_surfa...
[ [ "numpy.exp" ] ]
ajlee21/Batch_effects_simulation
[ "d707321346de48de5e63cf251280bdf9372be59c", "d707321346de48de5e63cf251280bdf9372be59c" ]
[ "simulate_expression_compendia_modules/cca_core.py", "archive/scripts/functions/cca_core.py" ]
[ "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.random.normal", "numpy.zeros_like", "numpy.dot", "numpy.cov", "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.linalg.eigh", "numpy.linalg.pinv", "numpy.diagonal", "numpy.eye", "numpy.mean", "numpy.any", "numpy.conj", "numpy.sqrt", "numpy.l...
chenjun2hao/segmentation.pytorch
[ "a319d0f006559dd58bd853065e6fe79ae8c23791" ]
[ "eval_multipro.py" ]
[ "# System libs\nimport os\nimport argparse\nfrom distutils.version import LooseVersion\nfrom multiprocessing import Queue, Process\n# Numerical libs\nimport numpy as np\nimport math\nimport torch\nimport torch.nn as nn\nfrom scipy.io import loadmat\n# Our libs\nfrom mit_semseg.config import cfg\nfrom mit_semseg.dat...
[ [ "torch.nn.NLLLoss", "numpy.concatenate", "torch.zeros", "torch.max", "torch.no_grad", "scipy.io.loadmat", "torch.cuda.set_device", "torch.utils.data.DataLoader" ] ]
rohitmalik10/MOJOwork
[ "8767a39b4397032b98d878bbc9aea7642a83f75c" ]
[ "Assignments 2/question3.py" ]
[ "import requests\nimport json\n\nurl = \"https://awm16002.srv.wifi.arista.com/new/webservice/login/modScanWifi/86400\"\n\npayload = \"{\\n\\\"type\\\":\\\"apikeycredentials\\\",\\n\\\"keyId\\\":\\\"KEY-ATN565039-674\\\",\\n\\\"keyValue\\\":\\\"16d7b32456a7700568d359fa452818bd\\\"\\n}\"\nheaders1 = {\n 'Content-T...
[ [ "pandas.DataFrame" ] ]
fourierer/mmpose
[ "1b481a4e46cea7cf47e01669d61ac4670f361e07" ]
[ "mmpose/models/losses/mse_loss.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom ..registry import LOSSES\n\n\n@LOSSES.register_module()\nclass JointsMSELoss(nn.Module):\n \"\"\"MSE loss for heatmaps.\n\n Args:\n use_target_weight (bool): Option to use weighted MSE loss.\n Different joint types may have different target weight...
[ [ "torch.cat", "torch.nn.MSELoss", "torch.gather", "torch.sum", "torch.randn", "torch.topk" ] ]
hunglvfimo/keras-retinanet
[ "af5948a1d52edf30f2eb50d7332a6a3a9971ad66" ]
[ "keras_retinanet/callbacks/eval.py" ]
[ "\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\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 la...
[ [ "tensorflow.Summary" ] ]
shuvrag/breathe-easy
[ "0d20e5f7a81669e1e2f298fb8999837310c0593c" ]
[ "breathe-easy.py" ]
[ "import streamlit as st\nimport pandas as pd\nimport numpy as np\nimport datetime\nfrom datetime import timedelta\nimport plotly.graph_objects as go\n\ntimechoice = [' ', '00:00:00', '01:00:00', '02:00:00', '03:00:00',\n '04:00:00', '05:00:00', '06:00:00', '07:00:00',\n'08:00:00', '09:00:00', '10:00:00', '11...
[ [ "pandas.to_datetime" ] ]
wunlung/tensorflow
[ "e2b05608125d66716ada95433850b3ce8405c1e4" ]
[ "tensorflow/contrib/tensor_forest/client/random_forest.py" ]
[ "# Copyright 2016 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.math_ops.maximum", "tensorflow.contrib.learn.python.learn.estimators.head.regression_head", "tensorflow.contrib.learn.python.learn.estimators.model_fn.ModelFnOps", "tensorflow.python.platform.tf_logging.info", "tensorflow.python.ops.control_flow_ops.group", "tensorfl...
golf-canada/airbyte
[ "a81b183a6b62d6bb4256347aaf39a3ada061aabe" ]
[ "airbyte-integrations/connectors/source-file/integration_tests/conftest.py" ]
[ "\"\"\"\nMIT License\n\nCopyright (c) 2020 Airbyte\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, mer...
[ [ "pandas.read_csv" ] ]
entn-at/cyclevae-vc-neuralvoco
[ "e0188457fe6d16e53b91066600dfe6fd5a9f8c23" ]
[ "src/bin/calc_rec-cycrec-gv_gru-cycle-mcepvae-laplace_noar.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright 2020 Patrick Lumban Tobing (Nagoya University)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\nfrom __future__ import division\n\nimport argparse\nimport logging\nimport math\nimport os\nimport sys\n\nimport numpy as np\nimport torch\nim...
[ [ "torch.multiprocessing.Process", "numpy.array", "torch.cat", "numpy.log", "torch.no_grad", "torch.FloatTensor", "torch.cuda.device", "numpy.mean", "torch.ones", "torch.multiprocessing.Manager", "numpy.std", "torch.load", "torch.nn.functional.softmax", "numpy...
hyx100e/athena-1
[ "2ff02d5f54070563c6a600199ae9e8d3ca3c66dd" ]
[ "athena/models/speech_transformer.py" ]
[ "# coding=utf-8\n# Copyright (C) 2019 ATHENA AUTHORS; Xiangang Li; Dongwei Jiang; Xiaoning Lei\n# 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...
[ [ "tensorflow.TensorArray", "tensorflow.shape", "tensorflow.random_uniform_initializer", "tensorflow.ones", "tensorflow.nn.relu6", "tensorflow.reshape", "tensorflow.math.ceil", "tensorflow.keras.Model", "tensorflow.nn.top_k", "tensorflow.maximum", "tensorflow.reduce_mean"...