repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
cclauss/hummingbot | [
"441041faac0d5e9f06fafef0f625ab1f19642371"
] | [
"hummingbot/client/command/config_command.py"
] | [
"import asyncio\nfrom typing import (\n List,\n Any,\n)\nfrom decimal import Decimal\nimport pandas as pd\nfrom os.path import join\nfrom sqlalchemy.orm import Session\nfrom hummingbot.client.settings import (\n GLOBAL_CONFIG_PATH,\n CONF_FILE_PATH,\n)\nfrom hummingbot.client.config.global_config_map im... | [
[
"pandas.DataFrame"
]
] |
hunterhawk/Attention-on-Audio | [
"fcc7be4c9202978b74f0b1a5caabb0d950596e7b"
] | [
"test_mnist/rnn_mnist_movan.py"
] | [
"import torch\nfrom torch import nn\nimport torchvision.datasets as dsets\nimport torchvision.transforms as transforms\nimport matplotlib.pyplot as plt\n\n\n# torch.manual_seed(1) # reproducible\n\n# Hyper Parameters\nEPOCH = 1 # train the training data n times, to save time, we just train 1 epoch\... | [
[
"torch.nn.CrossEntropyLoss",
"torch.max",
"matplotlib.pyplot.title",
"torch.nn.LSTM",
"torch.utils.data.DataLoader",
"torch.nn.Linear",
"matplotlib.pyplot.show"
]
] |
pranshumalviya2/playwith_rnn | [
"f9d4c851d9aef08ac265992daac137fa9b9b7a5e"
] | [
"Text - word/text_io.py"
] | [
"import numpy as np \nfrom keras.utils import np_utils\n# import sys\n\nclass inp(object):\n\tdef __init__(self, inp='karpathy', seq=10):\n\t\tself.inp = inp\n\t\tself.seq = seq\n\t\tself.inpFile = self.inp+\".txt\"\n\t\tself.outFile = self.inp+\"-out.txt\"\n\t\tself.content = open(self.inpFile).read().split(\" \")... | [
[
"numpy.reshape"
]
] |
kkraus14/cuxfilter | [
"99d7cf67802270d24db0051162df4feb798f2e15"
] | [
"python/cuxfilter/charts/datashader/plots.py"
] | [
"from ..core.non_aggregate import (\n BaseScatter,\n BaseLine,\n BaseStackedLine,\n BaseGraph,\n)\nfrom .custom_extensions import (\n InteractiveImage,\n CustomInspectTool,\n calc_connected_edges,\n)\n\nfrom distutils.version import LooseVersion\nimport datashader as ds\nfrom datashader import ... | [
[
"pandas.cut"
]
] |
ilkhem/WDTW | [
"b8bd27a4494aa52acb45ecd2427512e1a682edb7"
] | [
"code/parallel_pool.py"
] | [
"from multiprocessing import Pool, Lock\n\nimport numpy as np\nfrom chainer import cuda\n\nfrom gradient_descent import gradient_descent\nfrom sdtw import soft_dtw, soft_dtw_grad\nfrom sinkhorn import sinkhorn_fb\n\nGPUCOUNT = 7\nGPU_PRIORITY = [2, 6, 0, 1, 4, 5, 3]\n\n\ndef prepare_data(X, Y_list):\n # example ... | [
[
"numpy.empty"
]
] |
Architecton/diplomska-naloga-koda | [
"85ddb01fc0dbf07befa73445da50656068045f29"
] | [
"algorithms/reliefseq.py"
] | [
"import numpy as np\nimport warnings\nfrom algorithms.relieff import Relieff\nfrom scipy.stats import rankdata\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\n\nclass ReliefSeq(BaseEstimator, TransformerMixin):\n\n \"\"\"sklearn compatible implementation of the ReliefSeq algorithm\n\n Brett A. Mc... | [
[
"numpy.abs",
"scipy.stats.rankdata",
"numpy.min",
"numpy.unique",
"numpy.arange",
"numpy.max",
"numpy.empty"
]
] |
jchowk/rbcodes | [
"75ca209ec0d64b1d14b50f53081760ee9a6b340b"
] | [
"GUIs/abstools/Absorber.py"
] | [
"\n\n\n'''\nAbsorber \n\nInputs:\nflux; wave; error; linelist; redshift; bin\n\n1st. Asborber will bin the flux,wave and error to clean the data\n2nd. will pull the actual lamd_rest from the atom.dat file for all lines\n-->this (2nd) will return a dictionary of lamd_rest,ion_name,fval,gamma\n\n3rd. Initialized entr... | [
[
"numpy.polynomial.legendre.Legendre.fit"
]
] |
delwp-species-modelling/frontend | [
"70b2ffeac5cd28b4d384123bf894da9361fe41e6"
] | [
"ai/lib/filter_columns.py"
] | [
"\"\"\"\n lib/filter_columns.py\n\n FIT3162 - Team 10 - Final Year Computer Science Project\n Copyright Luke Silva, Aichi Tsuchihira, Harsil Patel 2019\n\n Script to filter columns to drop the unwanted column, rename the existing columns\n for legibility and merge the multiple reliability columns into a single... | [
[
"pandas.read_csv"
]
] |
bigb8/coviddanmark | [
"927dfd7c0735edd8f2b7536a32f7ec9bd8166842"
] | [
"lib/readdataexample.py"
] | [
"import os\nimport sys\nimport datetime\n\nimport numpy as np\n\n\n\n#Example of reading data. Hospitalized patients in DK.\n\n\n# Initiation\n#Path to lib folder\nlibpath = os.path.realpath(__file__).split(\"plotter.\")[0] + os.sep\n\n#Path to data folder\ndatap = libpath.split(\"lib\")[0]+ os.sep + \"data DK\" +... | [
[
"numpy.array"
]
] |
NMNS93/snakepot | [
"58640b5c0e8bc99338f9e4e25552669da763b063"
] | [
"src/train_val_pred.py"
] | [
"\"\"\"train_val_pred.py - Split dataframe based on target variable\"\"\"\n\nimport sys\nimport os\nfrom src.log import Logger\nlog = Logger('clean')\n\nimport argparse\nimport category_encoders as ce\nimport pandas as pd\n\nclass DataSplitter():\n def __init__(self, df, target, target_1, to_predict, perc_split)... | [
[
"pandas.concat",
"pandas.read_csv"
]
] |
stroblme/hqsp-stqft | [
"c2f8f8964648578755d3938bf8658e4c834548e8"
] | [
"frontend.py"
] | [
"from matplotlib import colors\r\nimport matplotlib as mpl\r\nimport numpy as np\r\nfrom numpy import pi, string_\r\nfrom scipy import signal as scipySignal\r\nimport matplotlib.pyplot as plt\r\nfrom math import log, floor\r\nfrom copy import deepcopy\r\nimport os\r\nimport pickle\r\nimport git\r\nfrom cycler impor... | [
[
"numpy.dot",
"numpy.kaiser",
"matplotlib.pyplot.autoscale",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.plot",
"scipy.signal.correlate2d",
"numpy.hamming",
"numpy.hanning",
"numpy.where",
"matplotlib.pyplot.gca",
"numpy.swapaxes",
"matplotlib.pyplot.tight_layout",
... |
kmamine/caer | [
"d78eccc40d259371a68f834addb6b5b53ce5f340"
] | [
"caer/transforms/position.py"
] | [
"# _____ ______ _____ \n# / ____/ /\\ | ____ | __ \\\n# | | / \\ | |__ | |__) | Caer - Modern Computer Vision\n# | | / /\\ \\ | __| | _ / Languages: Python, C, C++\n# | |___ / ____ \\ | |____ | | \\ \\ http://github.com/jasmcaus/caer\n# \\_____\\/_/ \\_ \\______... | [
[
"numpy.expand_dims",
"numpy.clip",
"numpy.ascontiguousarray",
"numpy.uint8",
"numpy.empty_like",
"numpy.arange",
"numpy.dtype",
"numpy.full_like",
"numpy.zeros_like",
"numpy.any",
"numpy.float32",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
szjarek/articles-AzureML-with-Python | [
"d414a898855e74b79cdf0d06ded3d31844197aed"
] | [
"2-aml-pytorch-samples/code/train/train.py"
] | [
"import os\nimport gzip\nimport struct\nimport numpy as np\n\nimport argparse\nimport mlflow\n\nimport torch\nimport torch.optim as optim\n\nfrom torch.nn import functional as F\nfrom torch import nn\nfrom torchvision import transforms\nfrom torch.utils.data import DataLoader\n\nfrom azureml.core import Run\nfrom a... | [
[
"numpy.long",
"torch.max",
"torch.nn.functional.log_softmax",
"torch.nn.functional.dropout",
"torch.nn.functional.nll_loss",
"torch.manual_seed",
"torch.load",
"torch.nn.Conv2d",
"torch.utils.data.DataLoader",
"torch.nn.Linear",
"numpy.argmax",
"torch.no_grad",
... |
borten-fb/snorkel2 | [
"12b1768c294e2c00388c4c6d93b089e0fcab45a0"
] | [
"snorkel/classification/training/loggers/tensorboard_writer.py"
] | [
"from typing import Any\n\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom snorkel.types import Config\n\nfrom .log_writer import LogWriter\n\n\nclass TensorBoardWriter(LogWriter):\n \"\"\"A class for logging to Tensorboard during training process.\n\n See ``LogWriter`` for more attributes.\n\n P... | [
[
"torch.utils.tensorboard.SummaryWriter"
]
] |
Aditya-Kapadiya/Iguanas | [
"dcc2c1e71f00574c3427fa530191e7079834c11b"
] | [
"iguanas/pipeline/tests/test_linear_pipeline.py"
] | [
"import pytest\nimport pandas as pd\nimport numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\nfrom iguanas.rule_generation import RuleGeneratorDT, RuleGeneratorOpt\nfrom iguanas.rule_optimisation import BayesianOptimiser\nfrom iguanas.rules import Rules\nfrom iguanas.metrics import FScore, JaccardSi... | [
[
"sklearn.ensemble.RandomForestClassifier",
"numpy.random.seed",
"numpy.random.normal",
"numpy.random.uniform",
"numpy.array",
"numpy.random.randint"
]
] |
meghasin/RTX | [
"4e7b73263f60840d206ce759111214c28bfc999d"
] | [
"data/KGmetadata/dumpdata.py"
] | [
"# This script will dump indexes like node names, edge names, etc.\nimport numpy as np\nnp.warnings.filterwarnings('ignore')\nfrom neo4j.v1 import GraphDatabase, basic_auth\nimport requests_cache\nimport os\nimport sys\nimport re\n\n#requests_cache.install_cache('orangeboard')\n# specifiy the path of orangeboard da... | [
[
"numpy.warnings.filterwarnings"
]
] |
abbyxxn/maskrcnn-benchmark-3d | [
"84c5829288cd10a21d67673e7083141e4c65554f"
] | [
"maskrcnn_benchmark/modeling/roi_heads/box3d_head/box3d_head.py"
] | [
"import os\n\nimport numpy as np\nimport torch\n\nfrom maskrcnn_benchmark.structures.bounding_box import BoxList\nfrom .roi_box3d_feature_extractors import make_roi_box3d_feature_extractor\nfrom .roi_box3d_feature_extractors import make_roi_pc_feature_extractor\nfrom .roi_box3d_predictors import make_roi_box3d_pred... | [
[
"numpy.load",
"torch.as_tensor",
"torch.cat"
]
] |
educational-technology-collective/slicing-analysis | [
"3008875be5ef9c532479006640499c157b21b2b6"
] | [
"gardner/extraction/forum_feature_extractor.py"
] | [
"# Copyright (C) 2016 The Regents of the University of Michigan\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 3 of the License, or\n# (at your option) any later versi... | [
[
"pandas.cut",
"pandas.get_dummies"
]
] |
saransh09/openfl-1 | [
"beba571929a56771f2fc1671154a3dbe60b38785"
] | [
"tests/openfl/utilities/optimizers/func_for_optimization.py"
] | [
"# Copyright (C) 2021-2022 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n\"\"\"Numpy optimizers test functions module.\"\"\"\nfrom typing import Dict\n\nimport numpy as np\n\n\ndef rosenbrock_func(point: Dict[str, np.ndarray]) -> float:\n \"\"\"\n Calculate Rosenbrock function.\n\n More details... | [
[
"numpy.array",
"numpy.cos",
"numpy.sin"
]
] |
msai-amin/DP-FL | [
"be275996ef8030d3eb473d8f6d609969bb071909"
] | [
"opacus/privacy_engine.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport os\nimport types\nimport warnings\nfrom typing import List, Optional, Tuple, Union\n\nimport torch\nfrom torch import nn\n\nfrom . import privacy_analysis\nfrom .dp_model_inspector import DPModelInspector\nfrom... | [
[
"torch.normal",
"torch.cuda.manual_seed",
"torch.zeros",
"torch.random.manual_seed",
"torch.distributed.get_rank",
"torch.distributed.get_world_size"
]
] |
sage-home/sage-model | [
"73680d91494389dbc13d3edd2fbeadc023694756"
] | [
"plotting/galaxy_properties.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nExample script for plotting the data from the Mini-Millennium simulation.\n\nBy extending the model lists (e.g., IMFs, snapshots, etc), you can plot multiple\nsimulations on the same axis.\n\nRefer to the online documentation (sage-model.readthedocs.io) for full information on how\nt... | [
[
"numpy.seterr"
]
] |
marobinette/defundthepolice | [
"691cfb6b50fa973e0a91ff685664b229a92e2eee"
] | [
"main_st.py"
] | [
"import json\nimport glob\nimport os\nimport textwrap\nimport math\nimport logging\n\nimport pandas as pd\nimport streamlit as st\nfrom PIL import Image, ImageDraw, ImageFont\n\nfrom viz import bar_graph, pie_chart\n\nBAR_CHART = \"Bar Chart\"\nPIE_CHART = \"Pie Chart\"\nSTATES_FOLDER = \"data/states/\"\nst.set_opt... | [
[
"pandas.read_csv"
]
] |
c74p/Capstone-SalesForecasting | [
"9c7950dc2fe839a04a0521f7da1ed3936496cd94"
] | [
"notebooks/EDA/S04-customers.py"
] | [
"import cauldron as cd\nimport matplotlib\nimport matplotlib.pyplot as plt\nplt.rcParams.update({'figure.max_open_warning': 0}) # NOQA\nimport seaborn as sns\nsns.set() # NOQA, need this for styling\nimport pandas as pd\n\nimport os, sys # NOQA\nsys.path.append('../../src/data')\nimport make_dataset # NOQA, need th... | [
[
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.subplots"
]
] |
kblondal/RMG-Py | [
"ee14e35321c1dc3cd1900c6d2ebb27931d1bb542"
] | [
"arkane/encorr/mbac.py"
] | [
"#!/usr/bin/env python3\n\n###############################################################################\n# #\n# RMG - Reaction Mechanism Generator #\n# ... | [
[
"numpy.array",
"numpy.exp",
"numpy.linalg.norm"
]
] |
t-groth/tinygrad | [
"4aaa670d1fd6b6ebcbc472ed77277b2fd3abe387"
] | [
"tinygrad/optim.py"
] | [
"import numpy as np\n\nclass Optimizer:\n def __init__(self, params):\n self.params = params\n\nclass SGD(Optimizer):\n def __init__(self, params, lr=0.001):\n super(SGD, self).__init__(params)\n self.lr = lr\n\n def step(self):\n for t in self.params:\n t.data -= self.lr * t.grad\n\n# 80% sure ... | [
[
"numpy.square",
"numpy.zeros_like",
"numpy.sqrt"
]
] |
stonebig/pyRiemann | [
"131cc82e6faaf8b515fa44e7af64159a3e9840e9"
] | [
"examples/artifacts/plot_correct_ajdc_EEG.py"
] | [
"\"\"\"\n===============================================================================\nArtifact Correction by AJDC-based Blind Source Separation\n===============================================================================\n\nBlind source separation (BSS) based on approximate joint diagonalization of\nFourier... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.linalg.norm",
"numpy.loadtxt"
]
] |
hyyh28/gym-minigrid | [
"678b049e410eb9c07a9a77e15e239a8115edf057"
] | [
"gym_minigrid/minigrid.py"
] | [
"import math\nimport hashlib\nimport gym\nfrom enum import IntEnum\nimport numpy as np\nfrom gym import error, spaces, utils\nfrom gym.utils import seeding\nfrom .rendering import *\n\n# Size in pixels of a tile in the full-scale human view\nTILE_PIXELS = 32\n\n# Map of color names to RGB values\nCOLORS = {\n 'r... | [
[
"numpy.array",
"numpy.zeros",
"numpy.array_equal",
"numpy.ones"
]
] |
pandali1/pyGAT | [
"3d9812ce101ac74ce963d155baad35d20b5a8d34"
] | [
"layers.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass GraphAttentionLayer(nn.Module):\n \"\"\"\n Simple GAT layer, similar to https://arxiv.org/abs/1710.10903\n \"\"\"\n def __init__(self, in_features, out_features, dropout, alpha, concat=True):\n su... | [
[
"torch.nn.functional.softmax",
"torch.mm",
"torch.nn.Dropout",
"torch.empty",
"torch.Size",
"torch.nn.functional.dropout",
"torch.zeros",
"torch.ones",
"torch.cat",
"torch.isnan",
"torch.nn.init.xavier_normal_",
"torch.sparse_coo_tensor",
"torch.matmul",
"to... |
Brenn10/jetyak_uav | [
"cd8b0622f8a8d293edd00508b2210aa76a238739"
] | [
"jetyak_uav_utils/scripts/nodes/filter/filter_node.py"
] | [
"#!/usr/bin/python\n\nimport numpy as np\nimport rospy as rp\nfrom std_srvs.srv import Trigger, TriggerResponse\nfrom sensor_msgs.msg import Imu\nfrom geometry_msgs.msg import PoseStamped, Vector3Stamped\nfrom data_point import DataPoint\nfrom fusion_ekf import FusionEKF\n\nclass FilterNode():\n\n\tdef __init__(sel... | [
[
"numpy.matrix",
"numpy.eye",
"numpy.zeros"
]
] |
5cr009e/qianjinqiu | [
"68b5cd55440d0bebbd5a023b7dcce97a2bc86c75"
] | [
"Fund/FundVisualizer.py"
] | [
"#coding:utf-8\n\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport platform\n\n\ndef setup_mpl():\n fonts_dict = {\n \"Linux\": \"WenQuanYi Zen Hei\",\n \"Windows\": \"SimHei\",\n }\n # print(platform.platform())\n for system in [\"Linux\", \"Windows\"]:\n if system in pla... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
xnchu/pyspedas | [
"62657581c0b6ed980fcd99ac34455a8b7a77dede"
] | [
"pyspedas/mms/feeps/mms_feeps_pad.py"
] | [
"import warnings\nimport numpy as np\nfrom pytplot import get_data, store_data, options\nfrom pyspedas.mms.feeps.mms_feeps_pitch_angles import mms_feeps_pitch_angles\nfrom pyspedas.mms.feeps.mms_feeps_active_eyes import mms_feeps_active_eyes\nfrom pyspedas.mms.feeps.mms_feeps_pad_spinavg import mms_feeps_pad_spinav... | [
[
"numpy.isnan",
"numpy.where",
"numpy.nanmean"
]
] |
usc-isi-i2/dsbox-cleaning | [
"3cb5146dbf89f0ea2f8bf71a843eb1cfa63f7917"
] | [
"dsbox/datapreprocessing/cleaner/encoder.py"
] | [
"import logging\nfrom typing import NamedTuple, Dict, List, Set, Union\n\nimport d3m\nimport d3m.metadata.base as mbase\nimport numpy as np\nimport pandas as pd\nfrom common_primitives import utils\nfrom d3m.container import DataFrame as d3m_DataFrame\nfrom d3m.metadata import hyperparams as metadata_hyperparams\nf... | [
[
"pandas.concat",
"pandas.to_numeric",
"pandas.isnull",
"pandas.get_dummies"
]
] |
yuantn/MI-AOD | [
"e57114d60f9ce5e43839cdf7068a90ee58092ec8"
] | [
"mmdet/models/dense_heads/ssd_head.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import xavier_init\nfrom mmdet.core import (build_anchor_generator, build_assigner,\n build_bbox_coder, build_sampler, multi_apply)\nfrom ..builder import HEADS\nfrom ..losses import smooth_l1_loss\nfrom .MIA... | [
[
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.functional.cross_entropy",
"torch.nn.Conv2d",
"torch.tensor",
"torch.nn.BCELoss",
"torch.isfinite"
]
] |
yassineAlouini/TPU-Exploration | [
"d252d5953fc12ce1bbad4493f344c66027160d2c"
] | [
"notebooks/pytorch_xla_resnet18_cifar10_training.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Works for Colab only it seems? No, works with the correct version of Python.\n\n\n\"\"\"PyTorch/XLA ResNet18/CIFAR10 Training\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/github/pytorch/xla/blob/master/contrib/colab/r... | [
[
"torch.set_default_tensor_type",
"torch.nn.NLLLoss",
"matplotlib.pylab.show",
"torch.nn.Sequential",
"torch.nn.functional.log_softmax",
"torch.manual_seed",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"torch.utils.data.DataLoader",
"torch.flatten",
"torch.nn.Li... |
jianhanlim/ipr-imagecaptioning | [
"428204dd2b22cacd59ff98950f8fc7520101a427"
] | [
"addition_bi/base_model.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\nimport cPickle as pickle\nimport copy\nimport json\nfrom tqdm import tqdm\n\nfrom utils.nn import NN\nfrom utils.coco.coco import COCO\nfrom utils.coco.pycocoevalcap.eval import COCOEvalCap\nfrom utils.mis... | [
[
"matplotlib.pyplot.imshow",
"tensorflow.get_variable",
"matplotlib.pyplot.imread",
"tensorflow.global_variables",
"pandas.DataFrame",
"tensorflow.get_default_graph",
"tensorflow.Variable",
"numpy.save",
"matplotlib.pyplot.axis",
"tensorflow.train.Saver",
"numpy.load",
... |
MartinoMensio/allennlp | [
"9a6dce3997d17185650a5377c9a7a5af0f1ac241"
] | [
"allennlp/data/fields/text_field.py"
] | [
"\"\"\"\nA ``TextField`` represents a string of text, the kind that you might want to represent with\nstandard word vectors, or pass through an LSTM.\n\"\"\"\nfrom typing import Dict, List, Optional\nimport textwrap\n\nfrom overrides import overrides\nfrom spacy.tokens import Token as SpacyToken\nimport torch\n\nfr... | [
[
"torch.LongTensor"
]
] |
jturner65/Getup-DartEnv | [
"a952a98d4c8a39510f70db5eaf1f2386350a828a"
] | [
"gym/envs/dart/reacher.py"
] | [
"# This environment is created by Karen Liu (karen.liu@gmail.com)\r\n\r\nimport numpy as np\r\nfrom gym import utils\r\nfrom gym.envs.dart import dart_env\r\n\r\nclass DartReacherEnv(dart_env.DartEnv, utils.EzPickle):\r\n def __init__(self):\r\n self.target = np.array([0.8, -0.6, 0.6])\r\n self.act... | [
[
"numpy.square",
"numpy.isfinite",
"numpy.multiply",
"numpy.linalg.norm",
"numpy.cos",
"numpy.sin",
"numpy.array"
]
] |
singaln/Roformer_Simlarity | [
"9e813c3a6a9517aa0c07738821e6b4a8e9b0aff3"
] | [
"utils.py"
] | [
"# coding=utf-8\n# @Time:2021/6/29:45\n# @author: SinGaln\n\n\"\"\"utils文件\"\"\"\nimport os\nimport torch\nimport random\nimport logging\nimport numpy as np\nfrom model import BertModelOutputs\nfrom transformers import BertConfig, BertTokenizer\nfrom sklearn.metrics import precision_score, recall_score, f1_score\n\... | [
[
"numpy.random.seed",
"torch.manual_seed",
"sklearn.metrics.precision_score",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"sklearn.metrics.f1_score",
"sklearn.metrics.recall_score"
]
] |
jiwoongim/IMsML | [
"2f5647794b433c1cb63f14ba1bcbf4919ca48b87"
] | [
"code/model_kit/conv_layer.py"
] | [
"import math\nimport tensorflow as tf\n\nfrom utils.utils import base_name\nfrom utils.nn_utils import init_weights, activation_fn, _get_variable\n\nclass Conv_Layer(object):\n def __init__(self, Xdim, kern_sz, filter_sz, atype, scope_name, \\\n stride=[2,2], padding='SAME', dformat='NHWC'):\n... | [
[
"tensorflow.nn.bias_add",
"tensorflow.variable_scope",
"tensorflow.truncated_normal_initializer",
"tensorflow.nn.conv2d"
]
] |
CYENS/Continual_Learning_on_the_Edge_with_TensorFlow-Lite | [
"26d4551a0542cd779f699ee5e5ca674a6c316f59"
] | [
"Offline Experiments/lat_utils.py"
] | [
"# IMPORTANT NOTE - THIS CODE WAS NOT WRITTEN BY THE AUTHOR OF THE PAPER SUBJECT TO DOUBLE-BLIND REVIEW\n# CODE USED FROM PAPER: https://arxiv.org/abs/1912.01100\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n################################################################################\n# Copyright (c) 2020.... | [
[
"torch.max",
"numpy.sqrt",
"torch.zeros",
"numpy.asarray",
"numpy.concatenate",
"numpy.max",
"torch.no_grad",
"torch.FloatTensor",
"torch.cuda.is_available",
"numpy.square",
"torch.from_numpy",
"torch.tensor",
"numpy.random.set_state",
"torch.dot",
"torc... |
sidharthkumar10500/motion_correction | [
"56fda2df3c464b25d8374f06e80849c5b1d92717"
] | [
"datagen.py"
] | [
"import numpy as np\nimport sigpy as sp\nimport torch\nfrom torch.utils.data import Dataset\nimport scipy\nfrom scipy import ndimage\n\"\"\"\nDataloader for the motion corrupt images \n\"\"\"\nclass MotionCorrupt(Dataset):\n def __init__(self, sample_list, num_slices,\n center_slice):\n se... | [
[
"numpy.mod",
"torch.is_tensor",
"torch.load"
]
] |
abugler/SMLFinalProject | [
"d89bbe959ca35ecee53660ac3b88fedb1d1df4d9"
] | [
"scripts/analyze.py"
] | [
"from runners.experiment_utils import load_experiment, save_experiment\nfrom src import logging\nfrom runners.utils import load_yaml, flatten\nfrom . import cmd, document_parser\nimport glob\nimport pandas as pd\nimport os\nimport copy\nimport numpy as np\nfrom argparse import ArgumentParser\n\nimport gspread\nfrom... | [
[
"numpy.trunc",
"numpy.mean",
"pandas.DataFrame",
"numpy.unique"
]
] |
neuromodulation/py_neuromodulation | [
"1e8505d4324c9d2f37e5d56629a2ee418ea0b12b"
] | [
"py_neuromodulation/nm_coherence.py"
] | [
"from scipy import signal\nimport numpy as np\n\nclass NM_Coherence:\n \n def __init__(self, fs, window, fbands, fband_names, ch_1_name, ch_2_name, ch_1_idx, ch_2_idx, coh, icoh) -> None:\n self.fs = fs\n self.window = window\n self.Pxx = None\n self.Pyy = None\n self.Pxy = ... | [
[
"scipy.signal.csd",
"numpy.abs",
"numpy.bitwise_and",
"numpy.array",
"scipy.signal.welch"
]
] |
zv/pandas | [
"2fad5d71053e31cae87f72b199a5699c51851110"
] | [
"pandas/tests/io/test_sql.py"
] | [
"\"\"\"SQL io tests\n\nThe SQL tests are broken down in different classes:\n\n- `PandasSQLTest`: base class with common methods for all test classes\n- Tests for the public API (only tests with sqlite3)\n - `_TestSQLApi` base class\n - `TestSQLApi`: test the public API with sqlalchemy engine\n - `TestSQLit... | [
[
"pandas._testing.equalContents",
"pandas.to_datetime",
"pandas.Series",
"pandas.io.sql.read_sql_table",
"pandas.io.sql.read_sql",
"pandas.DataFrame",
"pandas.core.dtypes.common.is_datetime64tz_dtype",
"numpy.round",
"numpy.dtype",
"numpy.random.randn",
"pandas.io.sql.SQ... |
scheckmedia/dl-framework | [
"8fea39e166fda0ff8fa51696831bf5cb42f3ed10"
] | [
"dlf/losses/ntxent_loss.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\nfrom dlf.core.registry import register_loss\n\n\n@register_loss('NTXentLoss', 'ntxentloss', 'ntx_ent_loss', 'ntexnt_loss')\nclass NTXentLoss(tf.keras.losses.Loss):\n \"\"\"Implementation of NTXentLoss like used in SimCLR\n\n # Arguments\n batch_size: int.... | [
[
"tensorflow.matmul",
"tensorflow.keras.losses.CategoricalCrossentropy",
"tensorflow.concat",
"tensorflow.range"
]
] |
concerttttt/RCNNs-on-Win64 | [
"603f46efcf9fb74eb0c0975e021ce2c7db184bb7"
] | [
"RCNN-Python/utils/color_space.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy\nimport skimage.io\nimport skimage.color\n\ndef convert_color(I, name):\n if len(I.shape) != 3:\n I = skimage.color.gray2rgb(I)\n\n converters = {'rgb' : lambda I: I,\n 'lab' : to_Lab,\n 'rgi' : to_rgI,\n ... | [
[
"numpy.sqrt",
"numpy.dstack"
]
] |
shelper/pypeline | [
"70e800a8b40592e9cde9491c77860143a732e6d3"
] | [
"pypeline/impl/oct/spectrum.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\npypeline.spectrum\n~~~~~~~~~~~~~~~~~\n\nthis module defines the spectrum or interferogram in OCT\nit should be the subclass of BaseData\n\"\"\"\n\nfrom .basedata import BaseData\nfrom scipy import signal\n\n\nclass Spectrum(BaseData):\n \"\"\"\n spectrum data based off the ... | [
[
"scipy.signal.gaussian"
]
] |
zburning/gluon-nlp | [
"101ce13bad3c26c802a4ff8ef47954fd2d0555d2"
] | [
"scripts/bert/pretraining_utils.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.random.seed"
]
] |
patrickmelix/Python4ChemistryTools | [
"a2891045edb44f2ff408a26855f6edb45328447f"
] | [
"move_atom.py"
] | [
"#!/usr/bin/env python3\n#\n# moves a chosen atom from a ase-compatible input around and saves all the coordinate files as xyz\n#\n# by Patrick Melix\n# 2017/03/17\n#\n# Usage:\n# a) Call this script, answer the questions, done.\n# b) Call this script with follogin arguments: <deltaX> <deltaY> <deltaZ> <nX> <nY> <n... | [
[
"numpy.array"
]
] |
caiostringari/deepwaves | [
"2ed647f24e5965c0b5a2c52f3a7640e0df27c207"
] | [
"tracking/track.py"
] | [
"\"\"\"\r\nOptical flow.\r\n\r\nOriginal SORT code is from https://github.com/abewley/sort/blob/master/sort.py#L239\r\n\r\nPROGRAM : SORT.py\r\nPOURPOSE : Track detected waves using SORT.\r\nAUTHOR : Caio Eadi Stringari\r\nEMAIL : caio.stringari@gmail.com\r\nV2.0 : 30/09/2020 [Caio Stringari]\r\n\"\"... | [
[
"pandas.read_csv",
"numpy.expand_dims",
"numpy.sqrt",
"numpy.maximum",
"numpy.minimum",
"numpy.isnan",
"numpy.vstack",
"numpy.concatenate",
"numpy.deg2rad",
"numpy.ma.masked_invalid",
"scipy.optimize.linear_sum_assignment",
"numpy.array",
"numpy.where",
"num... |
kon-rad/tensorflow-chatbot | [
"9fb3b7dd40248748e13545e4f5f898d6208b3a64"
] | [
"execute.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.train.get_checkpoint_state",
"tensorflow.gfile.Exists",
"tensorflow.gfile.GFile",
"numpy.random.random_sample",
"tensorflow.ConfigProto",
"tensorflow.compat.as_bytes",
"tensorflow.initialize_all_variables",
"numpy.argmax",
"tensorflow.GPUOptions",
"tensorflow.Se... |
blaylockbk/HRRR_archive_download | [
"a9d6e0d5df3d3baa6fd2a9470ac20e838b52e650"
] | [
"herbie/archive.py"
] | [
"#!/usr/bin/env python3\n\n## Brian Blaylock\n## May 3, 2021\n\n\"\"\"\n===============================\nHerbie: Retrieve NWP Model Data\n===============================\n\nHerbie is your model output download assistant with a mind of his own!\nHerbie might look small on the outside, but he has a big heart on the\n... | [
[
"pandas.to_timedelta",
"pandas.read_csv",
"pandas.to_datetime"
]
] |
ksuarz/mongo-monary-driver | [
"491279737aef7e4d247b4cd9b3b7d87b82b21145"
] | [
"monary/monary.py"
] | [
"# Monary - Copyright 2011-2013 David J. C. Beach\n# Please see the included LICENSE.TXT and NOTICE.TXT for licensing information.\n\nimport os.path\nimport platform\nfrom urllib import urlencode\nfrom ctypes import *\n\ntry:\n # if we are using Python 2.7+\n from collections import OrderedDict\nexcept Import... | [
[
"numpy.ma.masked_array",
"numpy.zeros",
"numpy.ones"
]
] |
RobbenRoll/emgfit | [
"780482a61f4dc080590c0036e9b729c0429530df"
] | [
"emgfit/sample.py"
] | [
"################################################################################\r\n##### Python module for creating simulated time-of-flight mass spectra with\r\n##### Gaussian and hyper-exponentially-modified Gaussian lines shapes\r\n##### Author: Stefan Paul\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nf... | [
[
"numpy.linspace",
"numpy.random.choice",
"pandas.DataFrame",
"numpy.atleast_1d",
"scipy.stats.exponnorm.rvs",
"numpy.append",
"scipy.stats.norm.rvs",
"scipy.stats.uniform.rvs",
"numpy.count_nonzero",
"numpy.array",
"numpy.histogram",
"numpy.sum",
"numpy.empty"
... |
ahmadhafidh/analysis-of-sentiment-ranking-and-rating-apps | [
"0d9b71eef573bff27575ff0d5be211b51cefd31b"
] | [
"sklearn_try/try_new_datasentimen.py"
] | [
"from sklearn.feature_extraction.text import CountVectorizer\r\nfrom sklearn.feature_extraction.text import TfidfTransformer\r\nfrom sklearn.naive_bayes import MultinomialNB\r\nfrom sklearn.pipeline import Pipeline\r\nimport pickle\r\nimport mysql.connector\r\nimport json\r\n\r\nmydb = mysql.connector.connect(\r\n ... | [
[
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.feature_extraction.text.TfidfTransformer"
]
] |
ademyanchuk/pytorch_segmentation | [
"b615d584631c09b1223670bdb409f90199e1b4ae"
] | [
"models/unet.py"
] | [
"from base import BaseModel\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom itertools import chain\nfrom utils.helpers import initialize_weights, set_trainable\nfrom models import resnet\n\n\ndef x2conv(in_channels, out_channels, inner_channels=None):\n inner_channels = out_channels /... | [
[
"torch.nn.Sequential",
"torch.nn.ConvTranspose2d",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.functional.pad",
"torch.nn.init.kaiming_normal_"
]
] |
inaccel/TractSeg | [
"cc9feefd71ba9fcfacc4d3a7656f1a77bab9a287"
] | [
"tractseg/data/data_loader_inference.py"
] | [
"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom os.path import join\nfrom builtins import object\nimport numpy as np\n\nfrom tractseg.libs.system_config import SystemConfig as C\nfrom tractseg.libs import exp_utils\nfrom tractseg.libs import ... | [
[
"numpy.random.seed",
"numpy.reshape",
"numpy.nan_to_num",
"numpy.array",
"numpy.zeros"
]
] |
dualword/faunus | [
"89f14398b960889cc74d0cceab96ef0e197088ae"
] | [
"examples/gromos_bend/gromos_bend_plot.py"
] | [
"#!/bin/env python\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\n\nmc = np.loadtxt('gromos_bend_mc_rdf.dat', unpack=True, usecols=(0,1))\nld = np.loadtxt('gromos_bend_md_rdf.dat', unpack=True, usecols=(0,1))\n\nplt.plot(mc[0], mc[1], label='Monte Carlo', linewidth=10, alpha=0.3)\nplt.plot(ld[0], ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel"
]
] |
caley/sympy | [
"7dfa5ceadf8b1500119583b33c70b618b59ca7ac"
] | [
"sympy/stats/drv.py"
] | [
"from sympy import (Basic, sympify, symbols, Dummy, Lambda, summation,\n Piecewise, S, cacheit, Sum, exp, I, Ne, Eq, poly,\n series, factorial, And, lambdify, floor)\n\nfrom sympy.polys.polyerrors import PolynomialError\nfrom sympy.stats.crv import reduce_rational_inequalities_wr... | [
[
"numpy.random.default_rng"
]
] |
reeya26/textscrub | [
"794357fe0c86dde30b611d86381e39de3537f7db"
] | [
"textscrub/clean.py"
] | [
"import unicodedata\nimport regex as re\nimport sys\n\nfrom string import punctuation\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.cluster import dbscan\nimport Levenshtein\n\n\ndef remove_glyphs(text):\n \"\"\"\n Remove all the non-ascii, non-latin and non-printable characters\n from the raw t... | [
[
"pandas.Series",
"pandas.DataFrame",
"sklearn.cluster.dbscan"
]
] |
Oliph/likertScalePlot | [
"8b980a813a56008089be61bd0932e2e83e9da854"
] | [
"likertscaleplot/likertScalePlot.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nPlotting function to draw a likert scale.\n\nTo plot diverging horizontal barchart as needed for a likert scale\nA simple code that try to mimic what it is possible with the package HH in R.\nThis script is an adaptation of the answers found:\n\"\"\"\n\n__a... | [
[
"matplotlib.pyplot.show",
"pandas.DataFrame",
"matplotlib.pyplot.Normalize",
"matplotlib.pyplot.suptitle",
"numpy.array",
"numpy.sum",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure"
]
] |
JonathanGildevall/Automatic-Emergency-Detection-in-Naval-VHF-Transmissions | [
"b691f29b3d3568666bcb0716ebd9efba465a26c2"
] | [
"startupkit/src/convert_wav2vec2_original_pytorch_checkpoint_to_pytorch.py"
] | [
"# coding=utf-8\n# Copyright 2021 The HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"torch.no_grad"
]
] |
eugenemfu/TTS_HW | [
"34b3a32da2904578ddbd86bfd9529798cc3a1e9f"
] | [
"wavelet_prosody_toolkit/test/diff_num.py"
] | [
"# travis test for comparing prominence and boundary values across versions.\n# allow for minor differences in values \nimport sys, glob\nimport numpy as np\nref_files = sorted(glob.glob(sys.argv[1]+\"/*.prom\"))\ntest_files = sorted(glob.glob(sys.argv[2]+\"/*.prom\"))\n\nfor i in range(len(ref_files)):\n ref = ... | [
[
"numpy.array"
]
] |
wngfra/ros2_tactile | [
"feb0ea2703052cbd56965a2dd12b4068334f4ea9"
] | [
"finger_sense/finger_sense/commander.py"
] | [
"# Copyright (c) 2020 wngfra\n# Use of this source code is governed by the Apache-2.0 license, see LICENSE\nimport numpy as np\nimport os\nimport rclpy\nimport time\nfrom collections import deque\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import animation\nfrom matplotlib import pyplot as plt\nfrom s... | [
[
"numpy.hstack",
"sklearn.decomposition.IncrementalPCA",
"numpy.save",
"matplotlib.animation.FuncAnimation",
"numpy.zeros",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.figure"
]
] |
erasromani/pytorch_wrapper | [
"8f790b7c8af5c70a093656bf806613f9e4a4e5c3"
] | [
"pytorch_wrapper/metrics.py"
] | [
"import gin\nimport torch\nimport dataclasses\nimport torch.nn.functional as F\n\nfrom typing import Any, Callable, List\n\ndef accuracy(input, target):\n input = F.softmax(input, dim=1)\n pred = input.max(1, keepdim=True)[1]\n accuracy = pred.eq(target.view_as(pred))\n return accuracy\n\n@gin.configura... | [
[
"torch.nn.functional.softmax"
]
] |
xiaolu1990/pandapower | [
"53af7f2d455dc4ff6a4fcaccc870b0076fa97bf9"
] | [
"pandapower/test/networks/test_cigre_networks.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright (c) 2016-2017 by University of Kassel and Fraunhofer Institute for Wind Energy and\n# Energy System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed\n# by a BSD-style license that can be found in the LICENSE file.\n\nimport pandas as pd\nimp... | [
[
"pandas.Series"
]
] |
vinhtq115/CRAFT-pytorch | [
"2be0399fde1ba9bbe7af73e29054fbb678a1d01b"
] | [
"craft_detector/craft.py"
] | [
"\"\"\" \nCopyright (c) 2019-present NAVER Corp.\nMIT License\n\"\"\"\n\n# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom craft_detector.basenet.vgg16_bn import vgg16_bn, init_weights\n\n\nclass double_conv(nn.Module):\n def __init__(self, in_ch, mid_ch, out_... | [
[
"torch.cat",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
hdoupe/OG-USA | [
"2e5c116bb8656ab190a59e431a8d57415fe26b08"
] | [
"ogusa/tax.py"
] | [
"'''\n------------------------------------------------------------------------\nFunctions for taxes in the steady state and along the transition path.\n------------------------------------------------------------------------\n'''\n\n# Packages\nimport numpy as np\nfrom ogusa import utils\n\n'''\n-------------------... | [
[
"numpy.squeeze",
"numpy.sort",
"numpy.zeros_like",
"numpy.transpose",
"numpy.zeros"
]
] |
cwlroda/falldetection | [
"536816022208e00f61d7c13613d1447c4bc6bfb2"
] | [
"core_others/tpu-usbcamera-sync.py"
] | [
"import sys\nimport argparse\nimport numpy as np\nimport cv2\nimport time\n#from edgetpu.detection.engine import DetectionEngine\nfrom edgetpu.basic.basic_engine import BasicEngine\n\n\nkeypointsMapping = ['Nose', 'Neck', 'R-Sho', 'R-Elb', 'R-Wr', 'L-Sho', 'L-Elb', 'L-Wr', 'R-Hip', 'R-Knee', 'R-Ank', 'L-Hip', 'L-Kn... | [
[
"numpy.dot",
"numpy.linspace",
"numpy.uint8",
"numpy.subtract",
"numpy.linalg.norm",
"numpy.full",
"numpy.ones",
"numpy.append",
"numpy.array",
"numpy.zeros",
"numpy.where",
"numpy.vstack"
]
] |
seu-labview/ObjectDatasetTools | [
"491c4c1d760dd3fd95b4a91abb3b929f16a08633"
] | [
"registration.py"
] | [
"\"\"\"\nregistration.py\n---------------\n\nFunctions for registering (aligning) point clouds with ICP and feature registration.\n\n\"\"\"\n\nfrom open3d import *\nimport numpy as np\nimport cv2\n\ndef icp(source,target,voxel_size,max_correspondence_distance_coarse,max_correspondence_distance_fine,\n method... | [
[
"numpy.dot",
"numpy.linalg.svd",
"numpy.sqrt",
"numpy.asarray",
"numpy.tile",
"numpy.asmatrix",
"numpy.linalg.det",
"numpy.mean",
"numpy.identity",
"numpy.float32",
"numpy.argpartition",
"numpy.array",
"numpy.sum",
"numpy.vstack"
]
] |
b-carter/SufficientInputSubsets | [
"ed9d64a37d6ed2ff5ae012461bcc7ed4684aa6dd"
] | [
"rationale_objects.py"
] | [
"import numpy as np\nimport os\nimport json\nimport types\n\nimport sis\nimport lime_helper\nfrom numpy_encoder import NumpyJSONEncoder\nfrom packages.IntegratedGradients.IntegratedGradients import integrated_gradients\n\n\n##########################################\n## Rationale keys for various methods (SIS and ... | [
[
"numpy.take",
"numpy.multiply",
"numpy.asarray",
"numpy.arange",
"numpy.rint",
"numpy.linalg.norm",
"numpy.cumsum",
"numpy.copy",
"numpy.delete",
"numpy.mean",
"numpy.count_nonzero",
"numpy.ravel_multi_index",
"numpy.savetxt",
"numpy.argsort",
"numpy.arr... |
google/empirical-calibration | [
"0765bbd82377e8b7c613a021d07adcc101779385"
] | [
"empirical_calibration/data/kang_schafer_test.py"
] | [
"# Copyright 2019 The Empirical Calibration 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"numpy.random.seed",
"numpy.unique"
]
] |
ZXin0305/hri | [
"b91d89158fc2d05ca4d3ea3ba4a7b9f69b0221a2"
] | [
"test.py"
] | [
"import numpy as np\nfrom IPython import embed\nfrom time import time\nimport torch\nimport math\nimport random\n\n# xx = np.zeros(shape=(2,15,4), dtype=np.float)\n\n# xx[0, 2, 2] = 1\n# xx[1, 2, 2] = 0.5\n\n# yy = xx[:,2,2].argsort()\n# xx = xx[yy]\n# embed()\n\n# xx = np.ones(shape=(75,45))\n# xx = xx.tolist()\n#... | [
[
"torch.tensor"
]
] |
jiajunhua/tensorflow | [
"0a926cbec33cfb4c24f76d519cd72608c2488458"
] | [
"tensorflow/python/client/session_clusterspec_prop_test.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.core.protobuf.config_pb2.RunMetadata",
"tensorflow.core.protobuf.config_pb2.RunOptions",
"tensorflow.python.ops.array_ops.placeholder",
"tensorflow.python.ops.array_ops.zeros",
"tensorflow.python.framework.ops.device",
"tensorflow.python.ops.math_ops.add",
"tensorflow.pytho... |
Linyhazel/posenet-pytorch | [
"d517137b34ff43be0115b11635e4b262dd9c2051"
] | [
"webcam_demo.py"
] | [
"import torch\nimport cv2\nimport time\nimport argparse\n\nimport posenet\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--model', type=int, default=101)\nparser.add_argument('--cam_id', type=int, default=0)\nparser.add_argument('--cam_width', type=int, default=1280)\nparser.add_argument('--cam_height'... | [
[
"torch.Tensor",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
joembis/Learning_Path | [
"3b16d34db622e7c6c53c830b88534ee882c1854a"
] | [
"Python/random_walks.py"
] | [
"from random import choice\r\nimport matplotlib.pyplot as plt\r\n\r\nclass RandomWalk():\r\n\t\"\"\"A class to generate a random walk\"\"\"\r\n\r\n\tdef __init__(self, num_points=5000):\r\n\t\t\"\"\"initialising the random walk attributes\"\"\"\r\n\t\tself.num_points=num_points\r\n\r\n\t\t\"\"\"all walks start at 0... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter"
]
] |
cbinyu/mriqc_comparison | [
"b0703390a54c9720ecfaa5c590888c461ce50856"
] | [
"mriqc_comparison/utils.py"
] | [
"\"\"\" Definitions to configure the app \"\"\"\n\nfrom pathlib import Path\n\nDEVICE_SERIAL_NO = '166018' # Default 'device_serial_no'\n\n# Keys that are relevant for IQMs\nRELEVANT_KEYS = [\n 'bids_meta.modality',\n 'spacing_x', 'size_x',\n 'spacing_y', 'size_y',\n 'spacing_z', 'size_z',\n 'bi... | [
[
"pandas.DataFrame.from_dict"
]
] |
gustavopdias/global-indicators | [
"adcf1f5638a254f0d6df7234f31d6e87be9ec10e"
] | [
"process/pre_process/11_urban_covariates.py"
] | [
"'''\r\n -- Create layer of additional urban study region covariates\r\n'''\r\n\r\nimport time \r\nimport psycopg2\r\nimport pandas as pd\r\nimport geopandas as gpd\r\n\r\nfrom _project_setup import *\r\nfrom script_running_log import script_running_log\r\n\r\ndef main():\r\n start = time.time()\r\n script = ... | [
[
"pandas.read_csv"
]
] |
MiroK/nEuronMI | [
"227b26598fa2cde5aabec68db898f308fb44aa31"
] | [
"neuronmi/mesh/meshconvert.py"
] | [
"\"\"\" Module for converting various mesh formats.\"\"\"\n\n# Copyright (C) 2006 Anders Logg\n#\n# This file is part of DOLFIN.\n#\n# DOLFIN is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License as published by\n# the Free Software Foundation, either... | [
[
"numpy.array"
]
] |
heilongjiangjs/GeetChinese_crack | [
"9654fdd5ca4b7990c5a9ccbffaf0b6a055f79b73"
] | [
"lib/datasets/imdb.py"
] | [
"# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom ... | [
[
"numpy.hstack",
"numpy.arange",
"numpy.sort",
"numpy.zeros_like",
"numpy.zeros",
"numpy.where",
"numpy.vstack"
]
] |
Derikka/lcls-tools | [
"76c58cfeb35e792509c11ae6bf5a3ca3448faa12"
] | [
"lcls_tools/image_processing/image_processing_test.py"
] | [
"import sys\nimport unittest\nimport numpy as np\nimport image_processing as ip\nfrom mat_image import MatImage\n\nFILE = 'test_image.mat'\nCAMERA = 'CAMR:LGUN:210'\n\nclass ImageProcessingTest(unittest.TestCase):\n \n def setUp(self):\n \"\"\"Use test image\"\"\"\n self.MI = MatImage()\n ... | [
[
"numpy.array_equal"
]
] |
daemon/neurometer | [
"c839765492b0ae5bdbcc826808b2ae196b9b1c0c"
] | [
"examples/measure_component.py"
] | [
"import gc\nimport random\n\nfrom easydict import EasyDict as edict\nfrom matplotlib.lines import Line2D\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom scipy import stats\nfrom tqdm import tqdm\nimport pandas as pd\nimport fire\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nimport torc... | [
[
"torch.nn.Sequential",
"torch.cuda.synchronize",
"pandas.read_csv",
"pandas.concat",
"matplotlib.pyplot.title",
"torch.zeros",
"torch.nn.Conv2d",
"pandas.DataFrame",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.set_grad_enabled",
"torch.nn.BatchNorm2d",
"torc... |
theawless/tweet-rank | [
"e02dcdd9914933e68243794725ed7b27cf332a7a"
] | [
"network/ltr.py"
] | [
"import re\nimport time\n\nimport nltk\nimport nltk.sentiment\nimport pandas as pd\nfrom geopy.distance import great_circle\nfrom pymongo import MongoClient\nfrom tqdm import tqdm\n\nclient = MongoClient()\ndb = client['vegas']\n\nEVENT_TIME = 1506837900 # 10:05 PM 1st October, 2017 (PDT)\nEVENT_COORDINATE = (36.1... | [
[
"pandas.factorize",
"pandas.DataFrame"
]
] |
3loi/MSP_Face | [
"f44300f05f6ec4e59374387b39702a419f73e5f0"
] | [
"AudioVisual_Modality/fusion_model_train.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@author: winston\n\"\"\"\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom keras.models import Model\nfrom keras.layers import Dense, Input\nfrom keras.callbacks import ModelCheckpoint\nfrom keras.optimizers import Adam\nfrom scipy.io imp... | [
[
"numpy.random.seed",
"scipy.io.loadmat",
"numpy.random.shuffle",
"matplotlib.pyplot.plot",
"numpy.concatenate",
"numpy.array"
]
] |
hot-cheeto/leo | [
"29acfd7bb3779ea2048fa253dc8347cd621a8a17"
] | [
"utils.py"
] | [
"# Copyright 2018 DeepMind Technologies Limited\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applic... | [
[
"tensorflow.gfile.DeleteRecursively",
"tensorflow.gfile.Open",
"tensorflow.gfile.Exists",
"tensorflow.gfile.MkDir",
"tensorflow.gfile.Rename",
"tensorflow.gfile.Glob",
"tensorflow.logging.info"
]
] |
mahdihosseini/CONet | [
"d1dabd074c5bee080ec5d58b382243b95a66993f"
] | [
"CONet/operations.py"
] | [
"import torch\nimport torch.nn as nn\n\nOPS = {\n 'none': lambda C, stride, affine: Zero(stride),\n 'avg_pool_3x3': lambda Cin, Cout, stride, affine: nn.AvgPool2d(3, stride=stride, padding=1,\n count_include_pad=False),\n 'max_pool_3x3': lam... | [
[
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
Marianna-Karavangeli/Earthquake_scraper | [
"95a6399fcd15ca99188e8f1a4b536dd16d732a4e"
] | [
"Earthquake_scraper/scraper/selectscrapeandsave.py"
] | [
"from Earthquake_scraper.visit_main_page import visit_main_page\nfrom selenium.webdriver.common.keys import Keys\nfrom selenium.webdriver.common.action_chains import ActionChains\n\nimport time\nimport os\nimport pandas as pd\n\n\nclass SelectScrapeandSave:\n\n def __init__(self):\n self.driver = visit_ma... | [
[
"pandas.DataFrame.from_dict"
]
] |
throughput-ec/UnacquiredSites | [
"a2eb8e5116a7df701b1c84b94edfa7172bd188a9"
] | [
"src/modules/predicting/predict.py"
] | [
"import argparse\nimport os\nimport cProfile\nimport pstats\nimport io\nimport pandas as pd\nimport json\nimport utils as utils\n\n\nfrom sklearn.feature_extraction.text import CountVectorizer\n\nimport nltk\nfrom nltk.tokenize import sent_tokenize, word_tokenize\nfrom nltk.corpus import stopwords\nfrom nltk.stem.s... | [
[
"pandas.merge",
"pandas.read_csv",
"pandas.concat",
"pandas.json_normalize",
"pandas.DataFrame"
]
] |
CQCL/aqua | [
"f6dd74434068fdba9100b60cfd8d85fdbbe52ef9"
] | [
"qiskit_aqua/algorithms/adaptive/qaoa/varform.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright 2018 IBM.\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.eye",
"numpy.zeros"
]
] |
edgardeng/python-data-science-days | [
"726451c827da502b585605f2ada1160817d25479"
] | [
"day13-matplotlib-introduction/index.py"
] | [
"# matplotlib introduction\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib as matplot\nfrom matplotlib.ticker import NullFormatter\n\n\ndef simple_plt():\n x = np.linspace(0, 2, 10)\n plt.plot(x, x, label='linear')\n plt.plot(x, x**2, label='quadratic')\n plt.plot(x, x**3, label=... | [
[
"matplotlib.pyplot.legend",
"numpy.linspace",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"numpy.random.randint",
"matplotlib.pyplot.gca",
"numpy.arange",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.... |
resibots/kaushik_2020_famle | [
"bbedd22a1eb6bba3cc0728fba5025b91186b6628"
] | [
"online_adaptation/ant_env_meta_v2.py"
] | [
"import fast_adaptation_embedding.env\nimport fast_adaptation_embedding.models.famle as nn_model\nfrom fast_adaptation_embedding.controllers.random_shooting import RS_opt\nimport torch\nimport numpy as np\nimport copy\nimport gym\nimport time\nfrom datetime import datetime\nimport pickle\nimport os\nfrom os import ... | [
[
"numpy.min",
"numpy.power",
"torch.cat",
"torch.sum",
"numpy.cumsum",
"numpy.save",
"numpy.ones",
"numpy.concatenate",
"numpy.max",
"numpy.argmax",
"torch.FloatTensor",
"numpy.random.rand",
"torch.device",
"numpy.load",
"numpy.array",
"numpy.zeros",
... |
yoelcortes/biosteam | [
"8d90788f87efb3b23428387d79097817962cad97"
] | [
"biosteam/units/heat_exchange.py"
] | [
"# -*- coding: utf-8 -*-\n# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules\n# Copyright (C) 2020-2021, Yoel Cortes-Pena <yoelcortes@gmail.com>\n# \n# This module is under the UIUC open-source license. See \n# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt\n# for lice... | [
[
"numpy.polyfit",
"numpy.array",
"numpy.polyval"
]
] |
marathomas/meerkat_umap | [
"1c1c23eba6e6219d777464f5afdb6c778198e09e"
] | [
"notebooks/run_all_datasets.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# Evaluate an embedding\n\nimport os\nimport pandas as pd\nimport sys\nimport numpy as np\nfrom pandas.core.common import flatten\nimport pickle\nfrom pathlib import Path\nimport datetime\nimport scipy\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport matplot... | [
[
"numpy.triu_indices",
"numpy.asarray",
"numpy.random.shuffle",
"scipy.spatial.distance.pdist",
"matplotlib.pyplot.close",
"numpy.savetxt",
"numpy.zeros",
"numpy.loadtxt"
]
] |
SabrinaRichter/batchglm | [
"2da429f895f7eb577a835da334f4ae146a9422ce"
] | [
"batchglm/train/tf/stats.py"
] | [
"import tensorflow as tf\n\n\ndef normalize(measure: tf.Tensor, data: tf.Tensor, name=\"normalize\") -> tf.Tensor:\n \"\"\"\n Normalize measure (e.g. `RMSD` or `MAE`) with the range of `data`\n\n :param measure: the measure which should be normalized\n :param data: Tensor representing the data by which ... | [
[
"tensorflow.maximum",
"tensorflow.minimum",
"tensorflow.name_scope",
"tensorflow.squared_difference",
"tensorflow.abs"
]
] |
showintime/MachineLearningToolkit | [
"cb265f8b0d3ca5aa16ad92cdbe74e138b5f56023"
] | [
"MyModel.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 30 18:40:01 2019\n\n@author: ZWH\n\"\"\"\n\n'''\n#LinearRegression\n\n\nimport numpy as np\nW=np.array([0.54,0.76,0.534,0.675]).reshape(4,1)\nB=1.78\ndef func(x):\n return x@W+B+np.random.random(size=(x.shape[0],1))*0.1\nx=np.random.random(size=(1000,4))\ny=fu... | [
[
"matplotlib.pyplot.yticks",
"numpy.argmax",
"numpy.mean",
"numpy.identity",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
fikrirazor/Complete-Gini-Indext-Text-klasifikasi-email-spam | [
"76a0e2cde0d216eb905ca4bb2fca218b899c7b73"
] | [
"gita.py"
] | [
"'''\r\nCreated on Thu Feb 14 18:34:19 2019\r\n\r\n@Author : Fikri Rozan Imadudin\r\n'''\r\nimport numpy as np\r\nimport preprocessing\r\n\r\nclass gita(object):\r\n '''\r\n Menghitung Complete Gini Index Text A antara dua variabel kontinu\r\n\r\n Parameters\r\n ----------\r\n alpha : smoothing agar ... | [
[
"numpy.where",
"numpy.sum",
"numpy.vstack",
"numpy.unique"
]
] |
ShuhuaGao/rfBFE | [
"74100cca045fdba4479f07633e4418848ab161a9"
] | [
"src/feature_selection.py"
] | [
"import pandas as pd\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.model_selection import GridSearchCV\n\n\ndef random_forest_classification(x_train, y_train):\n params = {'n_estimators': [10, 20, 30, 50],\n 'max_depth': [3],\n 'min_samples_split': [2],\n ... | [
[
"pandas.Series",
"sklearn.ensemble.RandomForestClassifier"
]
] |
d-sot/nwb-jupyter-widgets | [
"f9bf5c036c39f29e26b3cdb78198cccfa1b13cef"
] | [
"nwbwidgets/controllers.py"
] | [
"from ipywidgets import widgets, Layout\nimport numpy as np\n\n\ndef move_range_slider_up(slider):\n value = slider.get_interact_value()\n value_range = value[1] - value[0]\n max_val = slider.get_state()['max']\n if value[1] + value_range < max_val:\n slider.set_state({'value': (value[0] + value_... | [
[
"numpy.isnan"
]
] |
YinghuaHuang/daguan-2019 | [
"b0f6b36dba6467fcb1b26c92c78c6be3bd3063b1"
] | [
"opennmt/models/sequence_tagger.py"
] | [
"\"\"\"Sequence tagger.\"\"\"\n\nimport tensorflow as tf\nimport numpy as np\n\nfrom opennmt import inputters\nfrom opennmt.models.model import Model\nfrom opennmt.utils.misc import print_bytes\nfrom opennmt.utils.losses import cross_entropy_sequence_loss\n\n\nclass SequenceTagger(Model):\n \"\"\"A sequence tagger... | [
[
"tensorflow.get_variable",
"tensorflow.metrics.accuracy",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.where",
"tensorflow.contrib.crf.crf_decode",
"tensorflow.py_func",
"tensorflow.metrics.precision",
"tensorflow.layers.dense",
"tensorflow.gather",
"numpy.lo... |
kjappelbaum/MMD-critic | [
"ac8e48adc8b8eefdfb517baa92cb2e045a861747"
] | [
"mmdcritic/helper.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nimport numpy as np\nfrom scipy.spatial.distance import euclidean\nfrom six.moves import range\n\n\ndef write_outputfile(array, filename):\n \"\"\"writes array to file\"\"\"\n np.save(filename, array)\n\n\n... | [
[
"numpy.quantile",
"scipy.spatial.distance.euclidean",
"numpy.save",
"numpy.random.randint"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.