repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
anthonyhu/tumblr-sentiment
[ "33607d3662842815e6ae8d4a981b782ec3c485e8" ]
[ "datasets/dataset_utils.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.train.Int64List", "tensorflow.train.BytesList", "tensorflow.gfile.Open" ] ]
BiolabHHU/Image-denoising-with-MRFNet
[ "79420d707058de0ac04522d499adef79b5f6fc6e" ]
[ "MRFNETgray/utils.py" ]
[ "import math\nimport torch.nn as nn\nimport numpy as np\nfrom skimage.metrics import peak_signal_noise_ratio, structural_similarity\n\n\ndef weights_init_kaiming(m):\n classname = m.__class__.__name__\n if classname.find('Conv') != -1:\n nn.init.kaiming_normal(m.weight.data, a=0, mode='fan_in')\n el...
[ [ "torch.nn.init.kaiming_normal", "numpy.rot90", "numpy.flipud", "numpy.transpose", "torch.nn.init.constant" ] ]
dadepo/spark
[ "8dbb7cb5cc0b6dd6639badedc69310ba4078542b" ]
[ "python/pyspark/sql/pandas/conversion.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "pandas.DataFrame.from_records", "pandas.api.types.is_datetime64tz_dtype", "pandas.api.types.is_datetime64_dtype", "numpy.dtype" ] ]
prise6/smart-iss-posts
[ "fc913078e7fbe6343fd36ec6ca9852322247da5d" ]
[ "iss/clustering/ClassicalClustering.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport os\nimport numpy as np\nfrom iss.clustering import AbstractClustering\nfrom sklearn.decomposition import PCA\nfrom sklearn.cluster import KMeans\nfrom sklearn.cluster import AgglomerativeClustering\nfrom sklearn.metrics import silhouette_samples\nfrom iss.tools import Tools\nfrom ...
[ [ "sklearn.cluster.KMeans", "sklearn.metrics.silhouette_samples", "numpy.unique", "sklearn.manifold.TSNE", "numpy.mean", "sklearn.cluster.AgglomerativeClustering", "numpy.array", "numpy.where", "sklearn.decomposition.PCA" ] ]
mark-rtb/TensorflowTTS
[ "9999bbc39de6e5b7e5ef9aac25c5256c2bf77051" ]
[ "utils/config_manager.py" ]
[ "import subprocess\nimport shutil\nfrom pathlib import Path\n\nimport numpy as np\nimport tensorflow as tf\nimport ruamel.yaml\n\nfrom model.models import AutoregressiveTransformer, ForwardTransformer\nfrom utils.scheduling import piecewise_linear_schedule, reduction_schedule\n\n\nclass ConfigManager:\n \n de...
[ [ "tensorflow.train.Checkpoint", "numpy.array", "tensorflow.keras.optimizers.Adam", "tensorflow.train.CheckpointManager" ] ]
jaymedina/notebooks
[ "48b982081dfc6df83cb8d9170568149a2dd021cc" ]
[ "notebooks/COS/AsnFile/test_asn.py" ]
[ "#!/usr/bin/env python\n#%%[markdown]\n### From here, you can run the `calcos` pipeline on your new association file.\n##### Running `calcos` is explained in *much* more detail in our [Notebook on running the pipeline](https://github.com/spacetelescope/notebooks/blob/master/notebooks/COS/CalCOS/CalCOS.ipynb)\n\n###...
[ [ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
TheNeuralBit/google-cloud-python
[ "226cdf12f5dd69afb0ef665bb9e897d32d56f4b6" ]
[ "bigquery/tests/unit/test__pandas_helpers.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed t...
[ [ "pandas.Series", "pandas.DataFrame" ] ]
connesy/hep_ml
[ "41e97d598e621ce323a92a607625213ef9d45a36" ]
[ "hep_ml/losses.py" ]
[ "\"\"\"\n**hep_ml.losses** contains different loss functions to use in gradient boosting.\n\nApart from standard classification losses, **hep_ml** contains losses for uniform classification\n(see :class:`BinFlatnessLossFunction`, :class:`KnnFlatnessLossFunction`, :class:`KnnAdaLossFunction`)\nand for ranking (see :...
[ [ "numpy.take", "numpy.linspace", "numpy.sqrt", "numpy.in1d", "numpy.cumsum", "pandas.DataFrame", "numpy.concatenate", "numpy.max", "numpy.mean", "scipy.sparse.vstack", "numpy.exp", "numpy.where", "numpy.unique", "numpy.clip", "numpy.arange", "numpy.co...
egivental/resetInterpretability
[ "cb1d62bb89512c3469c641f2082f24c813ab2b26" ]
[ "model/CORELS/CORELS.py" ]
[ "import os\nimport subprocess\nimport sys\nimport numpy as np\nimport pandas as pd\nimport string\nfrom .dataMaker import CorelsDataMake\nimport copy\n\n\n#This method accepts a string which contains a definition of a dictionary \n#it returns a dictionary, which contains certain inputs that correspond to an output\...
[ [ "pandas.DataFrame" ] ]
gitvicky/tf-pde
[ "9ff131192aa21babc4238bd5d123fedefbf48d9e" ]
[ "Examples/Burgers_test.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jun 18 16:04:32 2020\n\n@author: Vicky\n\nNeural PDE - Tensorflow 2.X\nTesting with Burgers Equation\n\nPDE: u_t + u*u_x - 0.1*u_xx\nIC: u(0, x) = -sin(pi.x/8)\nBC: Periodic \nDomain: t ∈ [0,10], x ∈ [-8,8]\n\"\"\"\nimport os \nimport numpy a...
[ [ "numpy.hstack", "numpy.random.choice", "numpy.sin", "numpy.real", "numpy.shape", "numpy.meshgrid", "numpy.vstack" ] ]
suokunlong/spyder
[ "2d5d450fdcef232fb7f38e7fefc27f0e7f704c9a" ]
[ "spyder/plugins/variableexplorer/widgets/arrayeditor.py" ]
[ "# -*- coding: utf-8 -*-\r\n#\r\n# Copyright © Spyder Project Contributors\r\n# Licensed under the terms of the MIT License\r\n# (see spyder/__init__.py for details)\r\n\r\n\"\"\"\r\nNumPy Array Editor Dialog based on Qt\r\n\"\"\"\r\n\r\n# pylint: disable=C0103\r\n# pylint: disable=R0903\r\n# pylint: disable=R0911\...
[ [ "numpy.array", "numpy.abs" ] ]
SX-Aurora/mpi4py-ve
[ "aa6b1f97933196f8a485d5d808e89d5a29b58b1c" ]
[ "demo/osu_latency.py" ]
[ "# http://mvapich.cse.ohio-state.edu/benchmarks/\n\nfrom mpi4pyve import MPI\n\ndef osu_latency(\n BENCHMARH = \"MPI Latency Test\",\n skip = 1000,\n loop = 10000,\n skip_large = 10,\n loop_large = 100,\n large_message_size = 8192,\n MAX_MSG_SIZE = 1<<22,\n ):\n\n comm = MPI.COMM_WORLD\n ...
[ [ "numpy.zeros" ] ]
TheoBuchwald/UCPH-KVM
[ "bf77ad06bc1d7077e3cbcd81854f0fbfcd7323f7" ]
[ "KurtGroup/Kurt/output_processing.py" ]
[ "\nimport subprocess\nimport numpy as np\nfrom typing import List\nfrom chemical_information import AtomicInformation\n\ndef Forward_search_last(file: str, text: str, error: str, quiet: bool = False) -> int:\n \"\"\"Searches from the beggining of the file given to the end where it returns the linenumber of the l...
[ [ "numpy.log", "numpy.linalg.eigh", "numpy.prod", "numpy.array", "numpy.exp" ] ]
AdmitHub/cloud
[ "e9e116d462ea5603c3ccac22b22be33d9452ed1a" ]
[ "src/python/tensorflow_cloud/tuner/optimizer_client.py" ]
[ "# Lint as: python3\n# Copyright 2020 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.get_logger" ] ]
lrgr/imuse-server
[ "b80e1626ad645f63e66efead8f00bbc5af50ac5a" ]
[ "server/scale_exposures.py" ]
[ "import pandas as pd\nimport numpy as np\n\nfrom web_constants import *\nfrom signatures import Signatures, get_signatures_by_mut_type\nfrom project_data import ProjectData, get_selected_project_data\n\nfrom compute_exposures import compute_exposures\n\ndef scale_exposures(chosen_sigs, projects, mut_type, single_sa...
[ [ "pandas.notnull" ] ]
Apucs/Name-Entity-Recognition
[ "6eadc81871ad615726c82f7a4506baca5b7facee" ]
[ "src/inference.py" ]
[ "import torch\r\nfrom spacy.lang.en import English\r\nfrom build_dataloader import corpus\r\nfrom data import config\r\n\r\n\r\n\r\ndef infer(checkpoint_path, sentence, true_tags=None):\r\n\r\n model = torch.jit.load(checkpoint_path)\r\n model.eval()\r\n # tokenize sentence\r\n nlp = English()\r\n to...
[ [ "torch.LongTensor", "torch.jit.load" ] ]
leifdenby/convorg
[ "1a1279c3438fa5283578c30b15bb71686a83f846" ]
[ "convorg/cloudstatistics.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Statistical functions for binary cloud masks. \"\"\"\nimport numpy as np\nimport scipy as sc\n\nfrom skimage import measure\nfrom scipy.spatial.distance import pdist\n\n\n__all__ = [\n 'get_cloudproperties',\n 'neighbor_distance',\n 'iorg',\n 'scai',\n]\n\n\ndef get_cloud...
[ [ "numpy.sum", "numpy.sqrt", "numpy.asarray", "scipy.integrate.trapz", "numpy.reshape", "numpy.isnan", "numpy.arange", "numpy.sort", "numpy.ones", "scipy.stats.mstats.gmean", "scipy.spatial.distance.pdist", "numpy.nansum", "numpy.exp", "scipy.spatial.cKDTree" ...
matteonicolo/Forex
[ "efc2ba94417a3c0f9c034cd002242eb37c235cf8" ]
[ "bk_data.py" ]
[ "import sys\r\nsys.path.append(\"C:/Users/GiovanniRocco/Anaconda3/envs/forex\")\r\n\r\nimport time\r\nimport pandas as pd\r\nimport numpy as np\r\nimport json\r\nimport oandapyV20.endpoints.instruments as instruments\r\nfrom oandapyV20 import API\r\nfrom setup import account_id, key, api\r\nimport datetime\r\nfrom ...
[ [ "pandas.DataFrame" ] ]
AliJahan/examples
[ "ae625ca94ff5b82d7743d4555ddebeb728cc1430" ]
[ "imagenet/main.py" ]
[ "import argparse\nimport os\nimport random\nimport shutil\nimport time\nimport warnings\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.distributed as dist\nimport torch.optim\nimport torch.multiprocessing as mp\nimport torch.utils.data\nimport to...
[ [ "torch.nn.CrossEntropyLoss", "torch.distributed.init_process_group", "torch.multiprocessing.spawn", "torch.cuda.set_device", "torch.load", "torch.manual_seed", "torch.nn.DataParallel", "torch.no_grad", "torch.cuda.is_available", "torch.cuda.device_count", "torch.nn.para...
yogurfrul/tensorpack
[ "af5864439e22bb63a55eb2349164087e89a2ae6e" ]
[ "tensorpack/dataflow/dataset/cifar.py" ]
[ "# -*- coding: utf-8 -*-\n# File: cifar.py\n\n# Yukun Chen <cykustc@gmail.com>\n\nimport os\nimport pickle\nimport numpy as np\nimport tarfile\nimport six\nfrom six.moves import range\n\nfrom ...utils import logger\nfrom ...utils.fs import download, get_dataset_path\nfrom ..base import RNGDataFlow\n\n__all_...
[ [ "numpy.array", "numpy.mean", "numpy.transpose" ] ]
fcdl94/ICL
[ "9e79abf8b3d45334302c4716ebc1fa9b3119d986" ]
[ "methods/icarl_revgrad.py" ]
[ "from .icarl_da import ICarlDA\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport logging\n\n\nclass ICarlRG(ICarlDA):\n\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n self.domain_criterion = nn.BCEWithLogitsLoss()\n self.lam = 0\n self.coun...
[ [ "torch.LongTensor", "torch.ones", "torch.zeros", "torch.tensor", "torch.nn.BCEWithLogitsLoss", "numpy.exp", "numpy.zeros" ] ]
tjhlp/tests
[ "7407df7dbfdf12a5f69ba7bc8bf8d14131534ac2" ]
[ "numpytest/matplotlib/matplotlib_tjh_02.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\nx = np.linspace(-1, 1, 50)\nprint(x)\ny1 = 2 * x + 1\ny2 = x ** 2\nplt.figure(num=1)\n# image\nplt.plot(x, y1, label='linear')\nplt.plot(x, y2, color='red', label='cubic',linestyle='--')\n# limit\nplt.xlim(-1, 2)\nplt.ylim(-2, 3)\nticks = ...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.yticks", "matplotlib.pyplot.legend", "numpy.linspace", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
Hhhhhhhhhhao/image-cartoonization
[ "073b51656b96b069496917d212119caad7bf4728" ]
[ "utils/wb_utils.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom skimage import segmentation, color\nfrom joblib import Parallel, delayed\n\n\ndef box_filter(x, r):\n ch = list(x.size())[1]\n \n weight = 1 / ((2*r+1) ** 2)\n\n box_kernel = weight * np.ones((ch, 1, 2*r+1, 2*r+1))\n box_kernel ...
[ [ "torch.normal", "torch.ones", "numpy.asarray", "torch.nn.functional.conv2d", "torch.from_numpy", "numpy.ones", "numpy.shape", "torch.rand", "numpy.array" ] ]
DCMLab/pitchplots
[ "ce29631380bc93e267d6bf62e342d377a9e75f18" ]
[ "static.py" ]
[ "\"\"\"\r\nFunctions for none moving charts\r\n\"\"\"\r\nimport math\r\n\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.patches as patches\r\nimport matplotlib\r\n\r\nfrom pitchplots.reader import get_df_short\r\nfrom pitchplots.functions import get_acc, get_ste...
[ [ "pandas.concat", "matplotlib.colors.LogNorm", "pandas.Series", "pandas.isnull", "matplotlib.patches.RegularPolygon", "pandas.DataFrame", "matplotlib.colors.Normalize", "matplotlib.colorbar.ColorbarBase", "matplotlib.pyplot.close", "matplotlib.cm.get_cmap", "matplotlib.p...
calum-chamberlain/generalized-phase-detection
[ "9a7ff77fe292c0be6d9dcaaca41f158736f22b73" ]
[ "gpd/helpers/numpy.py" ]
[ "import numpy as np\n\n\ndef sliding_window(data, size, stepsize=1, padded=False, axis=-1, copy=True):\n \"\"\"\n Calculate a sliding window over a signal\n Parameters\n ----------\n data : numpy array\n The array to be slided over.\n size : int\n The sliding window size\n stepsiz...
[ [ "numpy.lib.stride_tricks.as_strided", "numpy.floor" ] ]
ryankshah/kymatio
[ "38cead012d1b134843a1dd0d5ea160042037c7da" ]
[ "tests/scattering1d/test_torch_scattering1d.py" ]
[ "import pytest\nimport torch\nfrom kymatio import Scattering1D\nimport math\nimport os\nimport io\nimport numpy as np\n\n\nbackends = []\nskcuda_available = False\ntry:\n if torch.cuda.is_available():\n from skcuda import cublas\n import cupy\n skcuda_available = True\nexcept:\n Warning('...
[ [ "torch.abs", "torch.ones", "numpy.allclose", "numpy.fft.fft", "torch.zeros", "torch.sqrt", "torch.manual_seed", "torch.randn", "numpy.load", "torch.sum", "torch.from_numpy", "numpy.fft.ifft", "torch.cuda.is_available", "torch.arange", "torch.allclose", ...
tkhe/ssd-family
[ "a797ec36fda59549aff54419c105813c33d8cdd3" ]
[ "ssd/modeling/extra_layers/pelee_extra_layers.py" ]
[ "import torch.nn as nn\n\nfrom ssd.layers import Conv2d\n\n\nclass ResBlock(nn.Module):\n def __init__(self, in_channels):\n super(ResBlock, self).__init__()\n\n self.branch1 = nn.Sequential(\n Conv2d(in_channels, 128, kernel_size=1),\n Conv2d(128, 128, kernel_size=3),\n ...
[ [ "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm2d" ] ]
KshitijKarthick/tvecs
[ "bcec2d09045319472036aa7aa03084ca2569b7bb" ]
[ "tvecs/evaluation/evaluation.py" ]
[ "#!/usr/bin/env python2.7\n# -*- coding: utf-8 -*-\n\"\"\"Module to Evaluate T-Vecs model against Human Semantic Similarity Score.\"\"\"\nimport os\nimport codecs\nfrom scipy.stats import pearsonr\nfrom gensim.models import Word2Vec\n\nfrom tvecs.logger import init_logger as log\nfrom tvecs.bilingual_generator impo...
[ [ "scipy.stats.pearsonr" ] ]
alxyok/ransplacement
[ "9434dbe458b5d1e31be65c976fc693965997d504" ]
[ "trainer.py" ]
[ "# MIT License\n\n# Copyright (c) 2021 alxyok\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, ...
[ [ "torch.set_default_dtype" ] ]
offroad-robotics/gpr-lib
[ "a5d61c825f22dd3aae8a1107142356d22907474f" ]
[ "examples/ground_truth_2d_example.py" ]
[ "# Copyright (c) 2021, Jeremy Roy\r\n# All rights reserved.\r\n\r\n# Redistribution and use in source and binary forms, with or without\r\n# modification, are permitted provided that the following conditions are met:\r\n# 1. Redistributions of source code must retain the above copyright\r\n# notice, this list of...
[ [ "numpy.array" ] ]
arssly/openvqa
[ "f10254a05819f813b71337a2ee45b2be09ab8e5d" ]
[ "openvqa/premodels/resnet/preproc.py" ]
[ "import torch\nfrom PIL import Image\nfrom openvqa.premodels.resnet.resnet_model import model, preproc_transform\n\n\ndef preproc_to_feats(image):\n input_tensor = preproc_transform(image)\n input_batch = input_tensor.unsqueeze(0) # create a mini-batch as expected by the model\n\n if torch.cuda.is_availab...
[ [ "torch.no_grad", "torch.cuda.is_available" ] ]
VivianYuan12138/python_matplotlib_learning
[ "c1011b8ed850959f66472e2d81b7d41f0623d06b" ]
[ "example/example1.py" ]
[ "# ① 导入库\nimport matplotlib.pyplot as plt #导入matplotlib库中的pyplot子库\n# ② 新建绘图区\nfig, ax = plt.subplots(figsize=(6,4)) #指定绘图区大小为6*4英寸\nplt.rcParams['font.sans-serif'] = ['SimHei'] #设置显示中文字体(黑体)\n# ③ 准备数据\nseazons=['一季度', '二季度', '三季度','四季度'] #设置分类轴显示文本\nsales=[2780,1950,2680,2120] #设置某产品的销售量数据\nindex=[0,1,2,3] #index控...
[ [ "matplotlib.pyplot.text", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.grid", "matplotlib.pyplot.bar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ]...
cikrhazo/FERSNet
[ "a5d9d2e71cf4e4026012f4c2cca7db6a11d162f9" ]
[ "network.py" ]
[ "import torch\nimport torch.nn as nn\nfrom LeakyUnit import LeakyUnit\nfrom net_utlz.blocks import BasicBlock, conv1x1, UNetUp, Transform\n\ncfg = {\n 'VGG13': [(64, 64), (64, 64), 'D1:128, 64',\n (128, 128), (128, 128), 'D:128, 64',\n (256, 128), (256, 256), 'D:256, 128',\n ...
[ [ "torch.nn.ZeroPad2d", "torch.nn.ConvTranspose2d", "torch.cat", "torch.randn", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.LeakyReLU", "torch.nn.InstanceNorm2d", "torch.nn.BatchNorm2d", ...
arekmula/skull_stripping
[ "d03cef81392f8cd243dc1c6d32ffa897af922eb2" ]
[ "tf_implementation/experiments/show_slices_from_generator.py" ]
[ "from argparse import ArgumentParser\nfrom pathlib import Path\nfrom matplotlib import pyplot as plt\n\nfrom segmentation.dataset import scans_generator\n\n\ndef main(args):\n train_path = Path(args.train_dir_path)\n val_path = Path(args.val_dir_path)\n\n train_scans, val_scans, train_samples, val_samples ...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
nng555/fairseq
[ "c9730a125825a85f33042e1b9fd1959b8ca829e5" ]
[ "scripts/wilcox_test.py" ]
[ "import os\nimport argparse\nimport time\nimport copy\nimport numpy as np\nfrom scipy.stats import wilcoxon, mannwhitneyu\n\nimport hydra\nimport omegaconf\nfrom omegaconf import DictConfig\nfrom hydra import slurm_utils\n\n@hydra.main(config_path='/h/nng/conf/robust/config.yaml', strict=False)\ndef display_results...
[ [ "scipy.stats.wilcoxon", "numpy.average" ] ]
hgfe/DCSSR
[ "949359eeab248a220834f49ab238dbbf93e656d5" ]
[ "utils.py" ]
[ "from PIL import Image\nimport os\nfrom torch.utils.data.dataset import Dataset\nfrom torchvision.transforms import ToTensor\nimport random\nimport torch\nimport numpy as np\nfrom skimage import measure\nfrom torch.nn import init\n\nclass TrainSetLoader(Dataset):\n def __init__(self, dataset_dir, cfg):\n ...
[ [ "torch.abs", "numpy.ascontiguousarray", "numpy.squeeze", "numpy.array", "torch.nn.init.xavier_normal" ] ]
ContinuumIO/chaco
[ "e4a42b91cb25ef7191fd465caaef2c3256fc668e", "e4a42b91cb25ef7191fd465caaef2c3256fc668e" ]
[ "chaco/tests/create_2d_test_case.py", "examples/demo/edit_line.py" ]
[ "from __future__ import with_statement\n\nfrom chaco.api import Plot, ArrayPlotData\n\nfrom traits.api import HasTraits, Instance\nfrom enable.component_editor import ComponentEditor\nfrom traitsui.api import Item, View\n\nimport numpy as np\n\nimport nose\nfrom _tools import store_exceptions_on_all_threads, assert...
[ [ "numpy.linspace", "numpy.arange", "numpy.ones", "numpy.meshgrid", "numpy.zeros" ], [ "scipy.special.jn", "numpy.linspace" ] ]
ph-u/CMEECourseWork_pmH
[ "8d52d4dcc3a643da7d55874e350c18f3bf377138" ]
[ "Week7/Code/LV2.py" ]
[ "#!/bin/env python3\n\n# Author: ph-u\n# Script: LV2.py\n# Desc: Consumer-Resource cycle plotting\n# Input: python3 LV2.py\n# Output: 1. two graphical outputs in `results` subdirectory; 2. final numbers terminal output\n# Arguments: 0\n# Date: Nov 2019\n\n\n\"\"\"Consumer-Resource cycle plotting\"\"\"\n\n__appname_...
[ [ "scipy.linspace", "matplotlib.pylab.grid", "matplotlib.pylab.legend", "matplotlib.pylab.text", "matplotlib.pylab.title", "scipy.integrate.odeint", "matplotlib.pylab.figure", "matplotlib.pylab.ylabel", "matplotlib.pylab.plot", "scipy.array", "matplotlib.pylab.xlabel" ]...
Zhangzhicheng001/Danim
[ "c45addc3d7679b7adb4a2cfd241c2247ce0a6669" ]
[ "Danim/BubbleChart/bubble_constants.py" ]
[ "# for SPECIFIC_COLORS only\nimport pandas as pd\n\nimport numpy as np\nfrom manimlib.constants import *\n\n\n#-----------data settings 输入数据设置------------#\n#************************************************#\n\nDATA_DIR = \"manim\\\\Danim\\\\DATA\"\nfile_name_list = [\"X.csv\",\"Y.csv\",\"R.csv\"]\nX_file_name = \...
[ [ "numpy.array" ] ]
FofanovLab/VaST
[ "72670bfc1fed6418eb9bbc7123d864a91fa63173" ]
[ "VaST/Amplicon_Filter.py" ]
[ "import itertools as it\nimport logging\nfrom collections import namedtuple\n\nimport numpy as np\nimport pandas as pd\n\nfrom Pattern import Patterns\nfrom utils import AMBIGUOUS_DICT\n\nAmplicon = namedtuple('Amplicon', ['start', 'stop', 'genome', 'site_ids'])\n\n\nclass AmpliconFilter:\n def __init__(\n ...
[ [ "numpy.unique", "pandas.DataFrame", "numpy.setdiff1d", "numpy.all", "numpy.any", "numpy.array", "numpy.sum" ] ]
microsoft/AR2
[ "c8df9379e0f7d50f9f52aa34982908c88b408a24" ]
[ "AR2/wiki/co_training_wiki_train.py" ]
[ "from os.path import join\nimport sys\n\nsys.path += ['../']\nimport argparse\nimport glob\nimport json\nimport logging\nimport os\nimport random\nimport numpy as np\nimport torch\n\nsys.path.append(os.getcwd())\nsys.path.append(os.path.abspath(os.path.dirname(os.getcwd())))\n# \nfrom torch.utils.data import DataL...
[ [ "torch.nn.functional.softmax", "torch.serialization.default_restore_location", "torch.no_grad", "torch.cuda.is_available", "torch.device", "torch.distributed.get_rank", "torch.nn.CrossEntropyLoss", "torch.distributed.init_process_group", "torch.utils.data.distributed.Distribute...
Berkeley-Data/hpt
[ "65bd3cedee83d43fdc8b57646dcd2e2642ddee30" ]
[ "src/utils/plot_basetrain_robust.py" ]
[ "\nimport glob\nimport shutil\nimport sys\nimport json\nimport pandas as pd\nimport argparse \nfrom matplotlib import pyplot as plt\nfrom matplotlib.ticker import NullFormatter # useful for `logit` scale\nimport seaborn as sns\nimport os \n\ndir_path = os.path.dirname(os.path.realpath(__file__))\n\ndef parse_args(...
[ [ "pandas.concat", "matplotlib.pyplot.axhline" ] ]
ankycheng/damages-calculator
[ "9ad958cd50911aef83ac92206950d9e29ab6e6a3" ]
[ "charts.py" ]
[ "import calculateTool.legaltechDataProcess as ltp\nimport jieba.analyse\nimport jieba\nimport pandas as pd\nimport numpy as np\nimport nltk\nfrom collections import Counter\nimport re\nimport seaborn as sns\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.font_manager import findfont, FontProper...
[ [ "matplotlib.font_manager.fontManager.ttflist.extend", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "matplotlib.use", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.font_manager.createF...
iver56/keras-retinanet
[ "83feca1aa49a8a75ed5d4a2ab43d8c18c6cce3f7" ]
[ "keras_retinanet/bin/evaluate.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\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 ...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
metataro/sc2_imitation_learning
[ "8dca03e9be92e2d8297a4bc34248939af5c7ec3b" ]
[ "tests/test_behaviour_cloning_learner.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\nfrom sc2_imitation_learning.behaviour_cloning.learner import compute_correct_predictions, compute_neg_log_probs\n\n\nclass Test(tf.test.TestCase):\n def test_compute_correct_predictions(self):\n targets = np.asarray([0, -1, 1, -1])\n predictions = np....
[ [ "numpy.asarray", "tensorflow.math.log_softmax" ] ]
bsaleil/lc
[ "ee7867fd2bdbbe88924300e10b14ea717ee6434b" ]
[ "tools/graphs.py" ]
[ "#!/usr/bin/env python3\n#!/usr/bin/python3\n#---------------------------------------------------------------------------\n#\n# Copyright (c) 2015, Baptiste Saleil. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the follo...
[ [ "matplotlib.backends.backend_pdf.PdfPages" ] ]
leomi7/flower-recognition
[ "f7fd167aa8000bb9c2ddd2f9dd1f2e120dff1fa8" ]
[ "extract_features.py" ]
[ "# filter warnings\nimport warnings\n\nwarnings.simplefilter(action=\"ignore\", category=FutureWarning)\n\n# keras imports\nfrom keras.applications.vgg16 import VGG16, preprocess_input\nfrom keras.applications.vgg19 import VGG19, preprocess_input\n\nfrom keras.applications.resnet50 import ResNet50, preprocess_input...
[ [ "numpy.array", "sklearn.preprocessing.LabelEncoder", "numpy.expand_dims" ] ]
omersan/LSTM_Nudging
[ "35c8f294708336a28f33b4be93a82d80f2f3d99c" ]
[ "Nudging/plotting_field.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Apr 14 19:17:22 2020\n\n@author: suraj\n\"\"\"\n\nimport numpy as np\nfrom numpy.random import seed\nseed(1)\nfrom scipy import integrate\nfrom scipy import linalg\nimport matplotlib.pyplot as plt \nimport time as tm\nimport matplotlib.ticker ...
[ [ "numpy.random.seed", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.cm.ScalarMappable" ] ]
gddickinson/VolumeSlider
[ "bdde0e6e18741f1b11481fe9ae7dba6c0f571acc" ]
[ "volumeSlider/tiffLoader.py" ]
[ "import numpy as np\nfrom qtpy import QtWidgets, QtCore, QtGui\nimport flika\nfrom flika import global_vars as g\nfrom flika.utils.io import tifffile\nfrom flika.process.file_ import get_permutation_tuple\nfrom flika.utils.misc import open_file_gui\nfrom distutils.version import StrictVersion\nfrom flika.window imp...
[ [ "numpy.transpose" ] ]
MacuXavier/S1_ML_Practices
[ "4cd29c5537c95cfd940e13e741db8d363c57ab1d" ]
[ "CIFAR10/train.py" ]
[ "import os\nimport os.path as osp\n# third-party packages\nimport pyprind\nimport glog as log\n# pytorch related packages\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.transforms as T\nimport torchvision.datasets as datasets\nimport argparse\n# Model Definition\nfrom mode...
[ [ "torch.nn.CrossEntropyLoss", "torch.load", "torch.manual_seed", "torch.no_grad", "torch.save" ] ]
ankeshanand/Rainbow
[ "cb89a0f2794381973daaa9b66cd8924111291b78" ]
[ "memory.py" ]
[ "from collections import namedtuple\nimport numpy as np\nimport torch\n\nTransition = namedtuple('Transition', ('timestep', 'state', 'action', 'reward', 'nonterminal'))\nblank_trans = Transition(0, torch.zeros(84, 84, dtype=torch.uint8), None, 0, False)\n\n\n# Segment tree data structure where parent node values ar...
[ [ "numpy.power", "torch.zeros", "torch.cat", "torch.tensor", "torch.stack", "numpy.random.uniform", "numpy.array", "numpy.zeros", "torch.device" ] ]
jni/useful-histories
[ "0c75003e4fa3a80d4bf7281314cdf6e363d3be56" ]
[ "climate-change-model-test.py" ]
[ "# IPython log file\n\n\nT = pd.read_csv('bundoora-temp.csv')\nT.head()\nT.rename(columns={'Mean maximum temperature (°C)':'Temperature'},\n inplace=True)\n \nT['Date'] = T['Year'] + (T['Month'] - 0.5) / 12\ndates = T['Date']\ntemps = T['Temperature']\ndef predicted_temperature(parameters, time):\n ...
[ [ "scipy.optimize.leastsq", "scipy.stats.chi2.sf" ] ]
Oktai15/NeMo
[ "5b6dd3850129898be47cf0d65587897ec45a5b59" ]
[ "nemo/collections/asr/models/ctc_models.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION. 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 re...
[ [ "torch.no_grad", "torch.cuda.is_available" ] ]
localmonkey/rosalind
[ "dceab11d4938c1325075988be091abd3a5d25824" ]
[ "algorythmic_heights/bf/bf.py" ]
[ "import queue\nimport numpy as np\n\n\nclass myGrph:\n def __init__(self, vertex_quant, edges_quant):\n self.V_quant = vertex_quant\n self.E_quant = edges_quant\n self.edges_list = np.zeros((edges_quant, 3), dtype=np.int64)\n #self.edge_list = []\n\n def fill_connections(self, file...
[ [ "numpy.zeros", "numpy.full" ] ]
Fieps1/p3-tennis
[ "29f3dab5810d7cd7f84120416a615956d266c256" ]
[ "deep_rl/component/envs.py" ]
[ "#######################################################################\n# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# Permission given to modify the code as long as you keep this #\n# declaration at the top #\n#######################...
[ [ "numpy.clip", "numpy.asarray", "numpy.full", "numpy.concatenate", "numpy.ones", "numpy.random.rand", "numpy.prod", "numpy.array" ] ]
YOHNGGG/Deep-Learning-based-Spectrum-Sensing
[ "e3b17ea30020db5ccf753497ce00a0fdf3ffa342" ]
[ "Python/SignalLoader_Test.py" ]
[ "import torch\r\nimport os, glob\r\nimport random\r\nimport csv\r\nfrom torch.utils.data import Dataset,DataLoader\r\nfrom scipy.io import loadmat\r\n\r\nclass LoadSignal(Dataset):\r\n\r\n def __init__(self,root):\r\n super(LoadSignal, self).__init__()\r\n\r\n self.root = root\r\n\r\n self.n...
[ [ "scipy.io.loadmat", "torch.utils.data.DataLoader", "torch.unsqueeze", "torch.tensor" ] ]
JungeAlexander/cocosco
[ "81ba561f6f16b43cfbd1b6d119e042bb640da23d" ]
[ "tests/ml/feature/test_glove.py" ]
[ "import numpy as np\n\nimport cocoscore.ml.feature.glove as glove\n\n\nclass TestClass(object):\n test_vec_file = 'tests/ml/feature/vectors.txt.gz'\n test_vocab_file = 'tests/ml/feature/vocab.txt.gz'\n\n def test_load_vector_array(self):\n w, w2i, i2w = glove.load_vector_array(self.test_vec_file, se...
[ [ "numpy.array" ] ]
SamanKhamesian/Music-Genre-Classification-of-Audio-Signals
[ "10b29b91738b25138cc9916ae174e4cd5027c759" ]
[ "Source/Classification.py" ]
[ "import joblib\nimport sklearn\n\nfrom Source.Utilities import *\nfrom config import Test, Model\n\nPATH = librosa.util.find_files(Test.DATA_PATH)\n\n\ndef main():\n songs = []\n\n # Load Test Files\n for p in PATH:\n song, sr = librosa.load(p, sr=SAMPLING_RATE, duration=5.0)\n songs.append(s...
[ [ "sklearn.preprocessing.MinMaxScaler" ] ]
eliadl/textdistance
[ "bbba2eb9660aa0b360ad54ef7aa5a8348d9a9924" ]
[ "textdistance/algorithms/edit_based.py" ]
[ "# built-in\nfrom collections import defaultdict\n\n# app\nfrom .base import Base as _Base, BaseSimilarity as _BaseSimilarity\n\n\ntry:\n # python3\n from itertools import zip_longest\nexcept ImportError:\n # python2\n from itertools import izip_longest as zip_longest\ntry:\n import numpy\nexcept Imp...
[ [ "numpy.arange", "numpy.zeros" ] ]
StanfordASL/sensitivity_torch
[ "0601c30c21f6d3acfb5dea9ae4f98a42d8101cab" ]
[ "sensitivity_torch/utils.py" ]
[ "##^# ops import and utils ######################################################\nimport os, pickle, time as time_module, pdb, math\nfrom pprint import pprint\nfrom collections import OrderedDict as odict\nfrom operator import itemgetter\n\nimport torch, numpy as np\nfrom torch.utils.tensorboard import SummaryWrit...
[ [ "torch.mean", "torch.norm", "torch.sum", "torch.std", "torch.utils.tensorboard.SummaryWriter", "numpy.array", "torch.as_tensor" ] ]
vdutell/wavelet_stim
[ "5a0026220a9d72365983cd66b796bb1a32f3d326" ]
[ "utils/getstim.py" ]
[ "import numpy as np\n\nimport utils.imtools as imtools\nimport utils.fouriertools as ftools\nimport utils.wavelettools as wtools\nimport utils.imwritetools as imwtools\nimport pathlib\n\ndef step_stim_img(width_px, height_px, loc=0.5, stepdn=False, rescale=True, orient=1, contrast=1):\n '''\n Make a step func...
[ [ "numpy.ones_like", "numpy.shape", "numpy.zeros", "numpy.ones" ] ]
kourtneyshort/healthcare
[ "7d3d4dc9deb3d31eab99035780ccb9a44f00b687" ]
[ "datathon/datathon_etl_pipelines/mimic_cxr/prepare_mimic_cxr.py" ]
[ "r\"\"\"Load the MIMIC CXR dataset onto GCP.\n\nThe raw MIMIC CXR dataset is originally hosted by Physionet as a collection of\ntar files which contain JPG images, and a gzip'd CSV file of labels.\n\nThe JPG images have paths of the form:\n(train|valid)/p([0-9]+)/s([0-9]+)/view([0-9]+)_(frontal|lateral|other)\\.jpg...
[ [ "tensorflow.io.gfile.GFile", "tensorflow.io.gfile.glob", "tensorflow.train.Features" ] ]
OscarPalominoC/linearRegression
[ "8b601b173bf4785f076aa9f2e4ab9acde738ad24" ]
[ "linearRegression.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n# Función para hallar b0 y b1\ndef estimate_b0_b1(x, y):\n n = np.size(x)\n \n # Obtenemos los promedios de X y de Y\n m_x, m_y = np.mean(x), np.mean(y)\n \n # Calculando la sumatoria de XY y sumatoria de X*Xprom\n sumatoria_XY = np.sum((x...
[ [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.plot", "numpy.size", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.sum", "matplotlib.pyplot.ylabel" ] ]
TimRepke/openTSNE
[ "22c306c3ec087e4b4be364431bc3626190a85c86" ]
[ "openTSNE/callbacks.py" ]
[ "import logging\nimport time\nimport warnings\nfrom functools import partial\n\nimport numpy as np\nfrom scipy.sparse import csr_matrix\n\nfrom openTSNE import kl_divergence\nfrom openTSNE.tsne import TSNEEmbedding\n\nlog = logging.getLogger(__name__)\n\n\nclass Callback:\n def optimization_about_to_start(self):...
[ [ "numpy.std", "numpy.array", "numpy.mean", "numpy.sum" ] ]
georgenemo/Paddledy
[ "cc2d4e869d2bc045bf30cd3494df7e9dd689f0c6" ]
[ "python/paddle/nn/layer/conv.py" ]
[ "# Copyright (c) 2020 PaddlePaddle 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 ...
[ [ "numpy.prod" ] ]
Kunind/building-controls-simulator
[ "7d3b74539233cfe5e2983f2f7554afd1bbbacbe9" ]
[ "src/python/BuildingControlsSimulator/DataClients/GCSDYDSource.py" ]
[ "# created by Tom Stesco tom.s@ecobee.com\n\nimport logging\n\nimport attr\nimport pandas as pd\nimport numpy as np\nimport gcsfs\n\nfrom BuildingControlsSimulator.DataClients.GCSDataSource import GCSDataSource\nfrom BuildingControlsSimulator.DataClients.DataSpec import DonateYourDataSpec\n\n\nlogger = logging.getL...
[ [ "pandas.read_csv", "pandas.to_datetime", "numpy.any" ] ]
ah4d1/anoapycore
[ "b530a7fd97e0f97659b3936733db8bc906efaa3e" ]
[ "src/anoapycore/data/__init__.py" ]
[ "from . import column\nfrom . import load\nfrom . import null\nfrom . import row\nfrom . import save\nfrom . import series\nfrom . import stat\nfrom . import value\n\nimport pandas as __pd\nfrom sklearn.preprocessing import MinMaxScaler as __minmax\nfrom sklearn.preprocessing import StandardScaler as __standard\nfr...
[ [ "pandas.merge", "pandas.concat", "pandas.DataFrame", "sklearn.preprocessing.StandardScaler", "sklearn.preprocessing.MinMaxScaler" ] ]
lwhluvdemo/PaddleDetection
[ "99c7e3a75a955b4a4cb038679c8f88e170bb3b44" ]
[ "ppdet/modeling/layers.py" ]
[ "# Copyright (c) 2020 PaddlePaddle 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 ...
[ [ "numpy.hstack", "numpy.meshgrid", "numpy.arange", "numpy.stack", "numpy.outer", "numpy.array" ] ]
foxlf823/NCRFpp
[ "bea99df2951b729fabb96ccdc36edc2272847d50" ]
[ "model/charbigru.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: Jie Yang\n# @Date: 2017-10-17 16:47:32\n# @Last Modified by: Jie Yang, Contact: jieynlp@gmail.com\n# @Last Modified time: 2018-10-18 11:12:13\nfrom __future__ import print_function\nimport torch\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import pack_padded_sequence,...
[ [ "torch.nn.Dropout", "numpy.sqrt", "torch.nn.GRU", "torch.from_numpy", "torch.nn.Embedding", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.utils.rnn.pad_packed_sequence", "torch.cuda.is_available", "numpy.random.uniform", "numpy.empty" ] ]
Manfred-Hyt/meshpy
[ "9381d91b259dff9fb2404cffe23f27f88ec0ccb4" ]
[ "meshpy/mesh_creation_functions/beam_fibers_in_rectangle.py" ]
[ "# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# MeshPy: A beam finite element input generator\n#\n# MIT License\n#\n# Copyright (c) 2021 Ivo Steinbrecher\n# Institute for Mathematics and Computer-Based Simulation\n# U...
[ [ "numpy.dot", "numpy.linalg.solve", "numpy.abs", "numpy.cos", "numpy.linalg.norm", "numpy.sin", "numpy.linalg.det", "numpy.max", "numpy.append", "numpy.array" ] ]
GeunYoung2/learn
[ "7e4c0e0ac0825d81cf8a2a5ce9aa00cd2e02fdd4" ]
[ "Data_Analysis.py" ]
[ "## 영상 처리 및 데이터 분석 툴\r\nfrom tkinter import *;\r\nimport os.path;\r\nimport math\r\nfrom tkinter.filedialog import *\r\nfrom tkinter.simpledialog import *\r\nimport struct;\r\nimport threading\r\nimport matplotlib.pyplot as plt\r\nimport xlwt\r\nimport xlsxwriter\r\nimport pymysql\r\nimport csv\r\nimport sqlite3\r\...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ] ]
devforfu/catalyst
[ "0ec665981135b264120cb5c4c04d56034f1c831c" ]
[ "examples/atari/src/atari_wrappers.py" ]
[ "from collections import deque\nimport numpy as np\nimport gym\nfrom gym import spaces\nimport cv2\n\ncv2.ocl.setUseOpenCL(False)\n\n\nclass TimeLimit(gym.Wrapper):\n def __init__(self, env, max_episode_steps=None):\n super().__init__(env)\n self._max_episode_steps = max_episode_steps\n self...
[ [ "numpy.expand_dims", "numpy.sign", "numpy.concatenate", "numpy.array", "numpy.zeros" ] ]
jiecaoyu/FBGEMM
[ "2c547924deafa1839483d31096de800078c35711" ]
[ "fbgemm_gpu/bench/bench_utils.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport itertools\nimport logging\nimport statistics\nimport time\nfrom typing import Callable, List, Op...
[ [ "torch.cuda.synchronize", "torch.cuda.current_device", "torch.load", "torch.zeros", "torch.cat", "torch.cuda.Event", "torch.nn.EmbeddingBag", "numpy.cumsum", "numpy.random.zipf", "numpy.ones", "torch.nn.Embedding", "torch.sort", "torch.cuda.is_available", "t...
anubhabPanda/TSAI-EVA5
[ "d16d83c796240632e120ba51cff2d10349ffee34" ]
[ "Week10/Picasso/models/model11.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom models.resnet import BasicBlock\n\n\nclass Residual_Block(nn.Module):\n def __init__(self, in_channels, out_channels, basic_block = None):\n super(Residual_Block, self).__init__()\n self.conv1 = nn.Sequential(\n ...
[ [ "torch.nn.functional.log_softmax", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
mimacom/whtobu-ml
[ "d17f1ea704d8c347de51aaa385de0e6f381a1f36" ]
[ "api.py" ]
[ "#!whtobu/bin/python\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport os\nimport tensorflow as tf\nimport time\nimport uuid\nfrom flask import Flask, jsonify, make_response, request, abort\nfrom werkzeug.utils import secu...
[ [ "tensorflow.Graph", "tensorflow.image.resize_bilinear", "tensorflow.import_graph_def", "tensorflow.read_file", "tensorflow.gfile.GFile", "numpy.squeeze", "tensorflow.cast", "tensorflow.image.decode_png", "tensorflow.expand_dims", "tensorflow.image.decode_bmp", "tensorfl...
233-puchi/mindspore
[ "e9d2684cdb7668eac48169feeff778eeffbfa70e" ]
[ "mindspore/explainer/_image_classification_runner.py" ]
[ "# Copyright 2020-2021 Huawei Technologies Co., Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applica...
[ [ "numpy.expand_dims", "numpy.sqrt", "numpy.isfinite", "scipy.stats.beta.interval", "numpy.uint8", "numpy.errstate", "numpy.array", "numpy.zeros" ] ]
yewon-lee/Crazyflie_New
[ "500f350f665fb5588a8b522e5894c710cfc51487" ]
[ "rotors_control/src/nodes/position_controller_node_ChihChun_flocking.py" ]
[ "#!/usr/bin/env python2\n\n\"\"\"\nROS interface for controlling up to four Cf2.0's and running the flocking algorithm.\n\nThis ROS node subscribes to the following topics:\n/crazyflie2_id/odometry\n\nThis ROS node publishes to the following topics:\n/crazyflie2_id/command/motor_speed\n/crazyflie2_id/goal\n\nWhere ...
[ [ "numpy.square", "numpy.asarray", "numpy.linalg.norm", "numpy.shape", "numpy.array" ] ]
ndalsanto/PDE-DNN
[ "1d4e612660e90546c6d97f4a6c8c1f498e5bfdf9" ]
[ "fem_data_generation.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jun 5 16:07:28 2019\n\n@author: Niccolo' Dal Santo\n@email : niccolo.dalsanto@epfl.ch\n\"\"\"\n\nimport random\nimport numpy as np\n\n# generate the coordinates randomly or in a tensorial way (if the mesh is structured and the fem dofs are or...
[ [ "numpy.zeros", "numpy.sort", "numpy.unique" ] ]
fabianegli/biopython
[ "132851bb572c0f6a22cde788d3a56e87ee1f48d2" ]
[ "Tests/test_seq.py" ]
[ "# This code is part of the Biopython distribution and governed by its\n# license. Please see the LICENSE file that should have been included\n# as part of this package.\n\n\"\"\"Tests for seq module.\"\"\"\n\nimport array\nimport copy\nimport unittest\nimport warnings\n\ntry:\n import numpy\nexcept ImportError...
[ [ "numpy.array", "numpy.intc" ] ]
baregawi/haystack
[ "f70d35279b9b35002012890399b5f20d6d35df8e" ]
[ "test/test_document_store.py" ]
[ "import numpy as np\nimport pandas as pd\nimport pytest\nimport json\nimport responses\nfrom responses import matchers\nfrom unittest.mock import Mock\nfrom elasticsearch import Elasticsearch\nfrom elasticsearch.exceptions import RequestError\n\nfrom conftest import (\n deepset_cloud_fixture,\n get_document_s...
[ [ "pandas.DataFrame", "numpy.testing.assert_array_equal", "numpy.random.randn", "numpy.testing.assert_raises", "numpy.random.rand", "numpy.testing.assert_array_almost_equal" ] ]
msheller/topologies
[ "c6457a677410fb028167f05b4e313dbffcab3d24" ]
[ "3D_UNet/model.py" ]
[ "#!/usr/bin/python\n\n# ----------------------------------------------------------------------------\n# Copyright 2018 Intel\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# ...
[ [ "tensorflow.reduce_sum", "tensorflow.log", "tensorflow.reduce_mean" ] ]
pauljaffe/task-dyva
[ "dbf778635cdb5f1d42149da82ca07ee3919296fa" ]
[ "task_dyva/taskdataset.py" ]
[ "\"\"\"Classes and utility functions for processing game data.\n\nEbbFlowGameData: Container for data from a single game.\nEbbFlowDataset: Subclass of PyTorch Dataset,\n container for data from multiple games.\nEbbFlowStats: Subclass of EbbFlowDataset,\n provides extra functionality for analysis.\n\"\"\"\nimp...
[ [ "numpy.expand_dims", "torch.load", "torch.cat", "numpy.squeeze", "numpy.cumsum", "pandas.DataFrame", "numpy.round", "numpy.concatenate", "scipy.stats.gaussian_kde", "scipy.stats.bernoulli.rvs", "numpy.mean", "torch.save", "matplotlib.pyplot.tight_layout", "n...
jihwanlee-alphago/aqt
[ "dfc0761f8db13b10174550979b0a3c8b32fd3d01", "dfc0761f8db13b10174550979b0a3c8b32fd3d01" ]
[ "aqt/jax_legacy/jax/compute_cost_utils_test.py", "aqt/jax_legacy/jax/wmt_mlperf/models_test.py" ]
[ "# Copyright 2022 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.testing.assert_array_equal" ], [ "numpy.array" ] ]
amathislab/Primer-MotionCapture
[ "ee595bb14ad89d5a6e2b412ce28962f5607cad77" ]
[ "Illustrating-Augmentations-FigurePipelineMouse.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nThis script uses Imgaug to display various augmentation methods\nfor a few labeled images of a mouse (Data in folder mouse_m7s3\nfrom Mathis, A., et al. DeepLabCut: markerless pose estimation of user-defined body parts with deep learning.\nNat Neurosci 21, 1...
[ [ "numpy.hstack", "numpy.shape", "numpy.isfinite" ] ]
Mishiba-Toshihiro/Self-Register
[ "ac9ce28c714db1d1086b3dba23a464d8f686cfd4" ]
[ "self-checkout.py" ]
[ "import argparse\nimport ntpath\nimport picamera\nimport pygame.mixer\nfrom datetime import datetime\nfrom yolo import YOLO\nfrom PIL import Image, ImageOps, ImageTk\nimport tkinter as tk\nfrom time import sleep\nfrom timeit import default_timer as timer\nimport pandas as pd\nimport os\nimport sys\nfrom contextlib ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
jesserobertson/uncover-ml
[ "22ca6361b25a119dd8fab1f3d50475df70b35170" ]
[ "preprocessing/raster_average.py" ]
[ "import warnings\nfrom subprocess import check_call\nimport shutil\nimport glob\nimport logging\nfrom os.path import abspath, join, basename, isdir, isfile\nimport click\nimport numpy as np\nfrom numpy.lib.stride_tricks import as_strided\nfrom scipy import ndimage\nfrom osgeo import gdal\nfrom uncoverml import mpio...
[ [ "numpy.isnan", "scipy.ndimage.uniform_filter", "numpy.lib.stride_tricks.as_strided", "numpy.zeros_like", "numpy.array_split", "numpy.empty" ] ]
Quansight-Labs/cudf
[ "d05de978f2d1f34b7629bd54ab9485df1f9949ef" ]
[ "python/cudf/cudf/tests/test_binops.py" ]
[ "# Copyright (c) 2018-2021, NVIDIA CORPORATION.\n\nfrom __future__ import division\n\nimport decimal\nimport operator\nimport random\nfrom itertools import product\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport cudf\nfrom cudf.core import Series\nfrom cudf.core.index import as_index\nfrom cudf....
[ [ "numpy.true_divide", "numpy.datetime_data", "numpy.random.random", "pandas.Series", "numpy.random.seed", "pandas.DateOffset", "numpy.random.choice", "numpy.isnan", "numpy.float16", "pandas.Index", "pandas.DataFrame", "numpy.dtype", "numpy.testing.assert_array_eq...
Ina299/prompt2slip
[ "b35489ff4fc4f5d724cfb74c75e5e128da553c70" ]
[ "prompt2slip/loss_transformers.py" ]
[ "from typing import Optional, Dict, Any, Union\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch import Tensor\nfrom torchtyping import TensorType\nimport transformers\n\nfrom .utils import make_forbit_indicates\n\nKeyValBatchType = Union[transformers.BatchEncoding, Dict[str, T...
[ [ "torch.mean", "torch.nn.CrossEntropyLoss", "torch.max", "torch.nn.functional.log_softmax", "torch.clamp", "torch.logical_not" ] ]
XC-Li/Deep_Learning_GWU
[ "2dfe0d39ce8f9d981cee545f489f9dde1ffdfa7c" ]
[ "Homework6/2_Tensor_Pytorch_Edited.py" ]
[ "import torch\n#----------------------------------------------------------------------------\ndtype = torch.float\nif torch.cuda.is_available():\n device = torch.device(\"cuda:0\")\nelse:\n device = torch.device(\"cpu\")\n#----------------------------------------------------------------------------\nBatch_siz...
[ [ "torch.device", "torch.randn", "torch.cuda.is_available" ] ]
mynameisvinn/scikit-network
[ "255e99b2f7d5ad8914a8fad3a89d7817764666e0" ]
[ "sknetwork/linalg/sparse_lowrank.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Apr 19 2019\n@author: Nathan de Lara <ndelara@enst.fr>\n\"\"\"\n\nfrom typing import Union, Tuple\n\nimport numpy as np\nfrom scipy import sparse\nfrom scipy.sparse.linalg import LinearOperator\n\n\nclass SparseLR(LinearOperator):\n \"\"\"Class...
[ [ "numpy.dtype", "scipy.sparse.csr_matrix", "numpy.ones" ] ]
DaikiOnodera/kaggle-hpa
[ "3e7888cadaa18403231136800bfd1ac324d6db66" ]
[ "swa.py" ]
[ "import os\nimport argparse\nimport pprint\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\nfrom datasets import get_dataloader\nfrom transforms import get_transform\nfrom models import get_model\nimport utils.config\nimport utils.swa as swa\nimport utils.checkpoint\n\n\ndef get_checkpoints(c...
[ [ "torch.no_grad" ] ]
1751200/Xlab-k8s-gpu
[ "b258f9610d2416a047f8f9545b1d6f66a7e88df3" ]
[ "MatMul/PyTorch&CuPy/pythonTest.py" ]
[ "import torch\r\nimport time\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport cupy as cp\r\n# torch.cuda.device_count()\r\n# torch.cuda.get_device_name(0)\r\n\r\n#计算cupy矩阵乘法以及其计算平均时间\r\n#shape:矩阵维度,shape*shape\r\n#times:计算次数,计算时间是取平均时间\r\ndef cupy_test(shape,times):\r\n sumT = 0\r\n for i in...
[ [ "matplotlib.pyplot.legend", "torch.mm", "torch.cuda.set_device", "numpy.einsum", "matplotlib.pyplot.plot", "numpy.random.rand", "torch.rand", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
ykawazura/calliope
[ "343b72a0930d70332172a5d87a579b0f8dcced66" ]
[ "diagnostics/MHD_COMP_ADIAB/energy_dot_avg.py" ]
[ "# -*- coding: utf-8 -*-\n\n#####################################################\n## main program for making plots from AstroGK data ##\n#####################################################\nimport numpy as np\nfrom scipy.integrate import simps, trapz\nfrom scipy import interpolate\n\nfrom numba import jit\n\n@ji...
[ [ "scipy.integrate.trapz", "numpy.loadtxt" ] ]
swdev1202/PointRCNN
[ "2557d670e80e813a8af4edf9f7ff7d2e9d94cfb0" ]
[ "lib/utils/object3d.py" ]
[ "import numpy as np\n\n\ndef cls_type_to_id(cls_type):\n type_to_id = {'Car': 1, 'Pedestrian': 2, 'Cyclist': 3, 'Van': 4}\n if cls_type not in type_to_id.keys():\n return -1\n return type_to_id[cls_type]\n\n\nclass Object3d(object):\n def __init__(self, line):\n label = line.strip().split(...
[ [ "numpy.dot", "numpy.clip", "numpy.linalg.norm", "numpy.cos", "numpy.sin", "numpy.floor", "numpy.zeros", "numpy.vstack" ] ]
asanoviskhak/Outtalent
[ "8a10b23335d8e9f080e5c39715b38bcc2916ff00" ]
[ "Leetcode/1420. Build Array Where You Can Find The Maximum Exactly K Comparisons/solution1.py" ]
[ "import numpy as np\n\n\nclass Solution:\n def numOfArrays(self, n: int, m: int, k: int) -> int:\n mod = 1e9 + 7\n dp = np.zeros((n, k + 1, m + 1))\n ps = np.zeros((n, k + 1, m + 1))\n for i in range(1, m + 1):\n dp[0, 1, i] = 1\n ps[0, 1, i] = ps[0, 1, i - 1] + ...
[ [ "numpy.zeros" ] ]
Matheus-IT/lang-python-related
[ "dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9" ]
[ "data_analysis/NumPy/03NumPy_estatistica.py" ]
[ "import numpy as np\r\n\r\n# Criando um array\r\nA = np.array([15, 23, 63, 94, 75])\r\n\r\n# Em estatística a média é o valor que aponta para onde mais se concentram os dados de uma distribuição.\r\nprint(np.mean(A))\r\n\r\n# O desvio padrão mostra o quanto de variação ou \"dispersão\" existe em \r\n# relação à méd...
[ [ "numpy.var", "numpy.std", "numpy.array", "numpy.mean" ] ]
mani-shailesh/lime
[ "3aa9ea9c30bffe73f1bffbe09fe70f6b8bd2c29c" ]
[ "lime/explanation.py" ]
[ "\"\"\"\nExplanation class, with visualization functions.\n\"\"\"\nfrom __future__ import unicode_literals\nfrom io import open\nimport os\nimport os.path\nimport json\nimport string\nimport numpy as np\n\nfrom .exceptions import LimeError\n\nfrom sklearn.utils import check_random_state\n\n\ndef id_generator(size=1...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.barh", "matplotlib.pyplot.yticks", "sklearn.utils.check_random_state", "matplotlib.pyplot.figure" ] ]
jagadeeshmeesala/data-processing-pipeline
[ "9a3ef1b650c1e5dd7f12a007ff598ba5f70bdb82" ]
[ "producer.py" ]
[ "#####################################################\n## PROGRAM TO IMPLEMENT KINESIS PRODUCER THAT FETCHES WEATHER INFORMATION\n## AND STREAMS THE DATA INTO KINESIS STREAM\n####################################################\n\n# necessary imports\nimport boto3\nimport datetime as dt\nimport pandas as pd\nimpor...
[ [ "pandas.DataFrame" ] ]
wondar-chan/akshare
[ "16eeed1c42bfd66533a0430c3f086890269fad90" ]
[ "akshare/economic/macro_usa.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\"\"\"\nDate: 2021/12/24 12:08\nDesc: 金十数据中心-经济指标-美国\nhttps://datacenter.jin10.com/economic\n\"\"\"\nimport json\nimport time\n\nimport pandas as pd\nfrom akshare.utils import demjson\nimport requests\n\nfrom akshare.economic.cons import (\n JS_USA_NON_FARM_URL,\n ...
[ [ "pandas.concat", "pandas.to_datetime", "pandas.to_numeric", "pandas.DataFrame" ] ]
VikrantKamble/lyaf_optdepth
[ "899048ab73e546513b3713b3818abfab3ce3ab05" ]
[ "lyaf_optdepth/utils.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import chi2\nfrom matplotlib.patches import Ellipse\nfrom scipy.special import erf\nfrom astroML.plotting.mcmc import convert_to_stdev as cts\nfrom scipy.optimize import curve_fit\n\n\ndef draw_ellipse(pos, cov, nsig=None, ax=None, label=\"temp\...
[ [ "numpy.diag", "matplotlib.pyplot.legend", "numpy.dot", "numpy.sqrt", "numpy.arctan2", "matplotlib.pyplot.axes", "matplotlib.pyplot.plot", "numpy.exp", "scipy.optimize.curve_fit", "matplotlib.pyplot.tight_layout", "numpy.arange", "numpy.linalg.det", "numpy.zeros"...