repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
koki0702/chainer0
[ "02a2a63fb1dc68d9f4bdc7b84c3fca66e4ba5df1" ]
[ "chainer0/datasets/_mnist_helper.py" ]
[ "import gzip\nimport struct\n\nimport numpy\nimport six\n\nfrom chainer0.datasets import download\nfrom chainer0.datasets import tuple_dataset\n\n\ndef make_npz(path, urls):\n x_url, y_url = urls\n x_path = download.cached_download(x_url)\n y_path = download.cached_download(y_url)\n \n with gzip.open...
[ [ "numpy.savez_compressed", "numpy.empty" ] ]
helloTC/ciftify
[ "ca6b83c8d40cd384de54269d7c62281552b91e21" ]
[ "tests/test_ciftify_clean_image.py" ]
[ "#!/usr/bin/env python3\nimport os\nimport unittest\nimport copy\nimport logging\nimport shutil\nimport random\nimport importlib\nimport pandas as pd\nimport json\n\nimport pytest\nfrom unittest.mock import patch\n\nfrom nibabel import Nifti1Image\nimport numpy as np\nimport nilearn.image\n\nimport ciftify.bin.cift...
[ [ "numpy.array", "pandas.DataFrame", "numpy.ones", "numpy.eye", "numpy.allclose" ] ]
bsegot/housing-search-Chicago
[ "d1a3029a4351d0db45c7f73f432d89ccdb469269" ]
[ "project/01__get_TraderJoe_data.py" ]
[ "import pandas as pd\nfrom arcgis.gis import GIS\nfrom arcgis.geocoding import geocode\n\n# Read data from CSV files\ncsv1_path = \"data_sets/illinois_ZIP.csv\"\n\n# Read in zipCode data\nprop_df = pd.read_csv(csv1_path)\nprop_df = pd.DataFrame(prop_df)\n\n# Only view zip codes in Cook County\nprop_df = prop_df[pro...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
maxcrous/magnify_motion
[ "70a3a61f67beacf249ba7023a4760c056be6c54a" ]
[ "utils.py" ]
[ "import matplotlib.pyplot as plt\nimport skvideo.io\n\n\ndef plot_slice(vid, output_path):\n \"\"\" Save a spatiotemporal slice of a video to disk. \"\"\"\n frames, height, width, channels = vid.shape\n patch_seq = vid[:, :, width//2, :]\n plt.imshow(patch_seq.swapaxes(0, 1))\n plt.savefig(output_pat...
[ [ "matplotlib.pyplot.savefig" ] ]
aymgal/hierArc
[ "a52cb6f2ad1d7a8cbd08c215ef7d5189fa329269" ]
[ "hierarc/Util/likelihood_util.py" ]
[ "import numpy as np\nfrom scipy.stats import truncnorm\n\n\ndef log_likelihood_cov(data, model, cov_error):\n \"\"\"\n log likelihood of the data given a model\n\n :param data: data vector\n :param model: model vector\n :param cov_error: inverse covariance matrix\n :return: log likelihood\n \"\...
[ [ "numpy.ones_like", "scipy.stats.truncnorm", "numpy.diag", "numpy.outer", "numpy.linalg.inv" ] ]
shovelingpig/SAFA
[ "35cd638ab299e58ba303bf64874287abdbcf9fd6" ]
[ "modules/util.py" ]
[ "import math\nfrom torch import nn\nimport torch.nn.functional as F\nimport torch\nimport torchvision.models as models\n\n\ndef kp2gaussian(kp, spatial_size, kp_variance):\n \"\"\"\n Transform a keypoint into gaussian like representation\n \"\"\"\n mean = kp['value']\n\n coordinate_grid = make_coordi...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Unfold", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.eye", "torch.nn.functional.pad", "torch.exp", "torch.sum", "torch.nn.AvgPool2d", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.functional.relu", "torc...
q1qgames/pixray
[ "8bd73869af7979068aa7ff8402f5b3ab2b791255" ]
[ "linedrawer.py" ]
[ "# this is derived from ClipDraw code\n# CLIPDraw: Exploring Text-to-Drawing Synthesis through Language-Image Encoders\n# Kevin Frans, L.B. Soros, Olaf Witkowski\n# https://arxiv.org/abs/2106.14843\n\nfrom DrawingInterface import DrawingInterface\n\nimport pydiffvg\nimport torch\nimport skimage\nimport skimage.io\n...
[ [ "torch.zeros", "torch.device", "numpy.uint8", "torch.no_grad", "torch.optim.Adam", "torch.cuda.is_available", "torch.tensor", "numpy.transpose", "numpy.clip" ] ]
HongYun0901/ESPnet
[ "44f78734034991fed4f42359f4d15f15504680bd", "44f78734034991fed4f42359f4d15f15504680bd" ]
[ "egs/grand_challenge/inference.py", "espnet/nets/pytorch_backend/e2e_asr_transformer_self_mix.py" ]
[ "import json\nimport matplotlib.pyplot as plt\nimport kaldiio\n\nroot = \"/home/nlp/ASR/espnet/egs/FSW\"\nwith open(root + \"/dump/test/deltafalse/data.json\", \"r\") as f:\n test_json = json.load(f)[\"utts\"]\n\nkey, info = list(test_json.items())[10]\nfbank = kaldiio.load_mat(info[\"input\"][0][\"feat\"])\n\n#...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.matshow" ], [ "torch.nonzero", "numpy.array", "torch.no_grad", "torch.nn.Module.__init__", "torch.from_numpy", "torch.tensor", "torch.jit.trace", "torch.as_tensor", "torch.topk" ] ]
BonexGu/Blik2D
[ "8e0592787e5c8e8a28682d0e1826b8223eae5983", "34bf5ed3d012838dac2a0a2e65aeb6e6093308ed" ]
[ "Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/compiler/tests/slice_ops_test.py", "Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/python/estimator/estimator_test.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.array_ops.placeholder", "tensorflow.python.platform.googletest.main", "tensorflow.python.ops.array_ops.slice", "tensorflow.python.ops.array_ops.strided_slice" ], [ "tensorflow.python.ops.variables.Variable", "tensorflow.python.training.training.get_global_step", ...
qihongl/demo-advantage-actor-critic
[ "00cfa770d872412da5a604f320d41dcfd30bc020" ]
[ "src/models/utils.py" ]
[ "import torch\n\n\ndef ortho_init(agent):\n for name, wts in agent.named_parameters():\n if 'weight' in name:\n torch.nn.init.orthogonal_(wts)\n elif 'bias' in name:\n torch.nn.init.constant_(wts, 0)\n\n\ndef softmax(z, beta):\n \"\"\"helper function, softmax with beta\n\n ...
[ [ "torch.nn.init.orthogonal_", "torch.squeeze", "torch.log2", "torch.nn.init.constant_" ] ]
jiayouwyhit/imodels
[ "2f3e3cd55b6ac1e6d0f21420bf9c4c29e4d39b06" ]
[ "tests/notebooks/imodels_demo.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,../tests/notebooks//py:percent\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.10.2\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name...
[ [ "sklearn.tree.plot_tree", "sklearn.metrics.r2_score", "sklearn.datasets.load_boston", "scipy.io.arff.loadarff", "numpy.argmax", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplot", "matplotlib.pyplot.title", "numpy.random.randn", "matplotlib.pyplot.hist", "skl...
m-hahn/fairseq
[ "8508699326640a6a7a83ed4de17ac986e6213bbe" ]
[ "estimateS3ensitivity_CoLA_Finetuned.py" ]
[ "import math\nimport sys\nimport torch\ntask = sys.argv[1]\n\nassert task == \"CoLA\"\n\ndef mean(values):\n return sum(values)/len(values)\n\nsensitivityHistogram = [0 for _ in range(40)]\n\n\ndef variance(values):\n values = values.exp()\n values = 2*values-1 # make probabilities rescale to [-1, 1]\n retu...
[ [ "torch.FloatTensor", "torch.stack", "scipy.optimize.linprog" ] ]
Sindy98/spc2
[ "5c82984ddbe2ef170f978c6273e7f3fbceb8a150" ]
[ "envs/GTAV/models/densenet.py" ]
[ "import sys\nfrom collections import OrderedDict\nfrom functools import partial\n\nimport torch.nn as nn\n\nfrom ..modules import ABN, GlobalAvgPool2d, DenseModule\nfrom ._util import try_index\n\n\nclass DenseNet(nn.Module):\n def __init__(self,\n structure,\n norm_act=ABN,\n ...
[ [ "torch.nn.Linear", "torch.nn.AvgPool2d", "torch.nn.Conv2d", "torch.nn.MaxPool2d" ] ]
roshea6/CarND-LaneLines
[ "ec4911a679ecd26fa9dcb954ae08c6a18bf17a09" ]
[ "lane_finder.py" ]
[ "import cv2\nimport math \nimport numpy as np\n\n\ndef grayscale(img):\n \"\"\"Applies the Grayscale transform\n This will return an image with only one color channel\n but NOTE: to see the returned image as grayscale\n (assuming your grayscaled image is called 'gray')\n you should call plt.imshow(gr...
[ [ "numpy.array", "numpy.zeros_like", "numpy.zeros" ] ]
duncangoudie/LaneATT
[ "263df500addf38e0912e3da7b4e878ca289391c3" ]
[ "viz_estimate_nolabel_dataset.py" ]
[ "\"\"\"\nGiven an unlabelled dataset (such as KITTI), visualise the result of images being run through the LaneATT model.\n\n\"\"\"\n\nimport argparse\n\nimport cv2\nimport torch\nimport random\nimport numpy as np\nfrom tqdm import tqdm, trange\n\nfrom lib.config import Config\n\nimport os\nimport sys\n\nPACKAGE_PA...
[ [ "torch.device", "torch.no_grad", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load" ] ]
sunny1401/pykeen
[ "ad449ecc753eb603670de67cfa5f49020c61db12" ]
[ "src/pykeen/nn/modules.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Stateful interaction functions.\"\"\"\n\nfrom __future__ import annotations\n\nimport logging\nimport math\nfrom abc import ABC, abstractmethod\nfrom typing import (\n Any, Callable, Generic, Mapping, MutableMapping, Optional, Sequence, Tuple, Union,\n cast,\n)\n\nimport torc...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.Tanh", "torch.is_tensor", "torch.nn.BatchNorm2d", "torch.nn.init.xavier_uniform_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.nn.init.calculate...
ryota-sugimoto/virome_scripts
[ "161f9a71f6a1ea78c7028a29d0422bac50b167f5" ]
[ "graph_clustering/cluster_stats.py" ]
[ "#!/usr/bin/env python3\n\nimport argparse\nparser = argparse.ArgumentParser()\nparser.add_argument('protospacers_bedfile',\n type=argparse.FileType('r'))\nparser.add_argument('cluster_file',\n type=argparse.FileType('r'))\nparser.add_argument('-t', '--min_co_occurance',\n ...
[ [ "numpy.max", "numpy.array", "scipy.sparse.find", "numpy.set_printoptions", "numpy.logical_and", "scipy.sparse.triu", "scipy.sparse.csr_matrix" ] ]
adamurban98/hottbox
[ "26580018ec6d38a1b08266c04ce4408c9e276130" ]
[ "hottbox/algorithms/decomposition/cpd.py" ]
[ "import functools\nimport warnings\nimport numpy as np\nfrom hottbox.utils.generation.basic import residual_tensor\nfrom hottbox.core.structures import Tensor, TensorCPD\nfrom hottbox.core.operations import khatri_rao, hadamard, sampled_khatri_rao\nfrom .base import Decomposition, svd\n\n\n# TODO: Need to add optio...
[ [ "numpy.array", "numpy.dot", "numpy.zeros", "numpy.sum", "numpy.linalg.pinv", "numpy.random.randn", "numpy.identity", "numpy.arange", "numpy.linalg.solve", "numpy.diag" ] ]
mehdidc/ramp-workflow
[ "68146005369b31c1c855c2372172d355440994a1" ]
[ "rampwf/utils/pretty_print.py" ]
[ "# coding: utf-8\n\"\"\"\nUtility methods to print the results in a terminal using term colors\n\"\"\"\nfrom __future__ import print_function\n\nimport numpy as np\nfrom pandas import option_context\nfrom colored import stylize, fg, attr\n\n# Dictionary of term colors used for printing to terminal\nfg_colors = {\n ...
[ [ "pandas.option_context", "numpy.array", "numpy.isin" ] ]
ebezzam/cvxpy
[ "38f76c938bf19eed7fb0a39e7fd2395c8fc42489" ]
[ "cvxpy/constraints/exponential.py" ]
[ "\"\"\"\nCopyright 2013 Steven Diamond\n\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to...
[ [ "numpy.prod" ] ]
astrojake/Eureka
[ "57cb0f1a576dfbbef9ba616b7a13a28c42efb876" ]
[ "eureka/S5_lightcurve_fitting/plots_s5.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport corner\nfrom scipy import stats\nfrom copy import deepcopy\n\nfrom .likelihood import computeRMS\nfrom .utils import COLORS\n\ndef plot_fit(lc, model, meta, fitter, isTitle=True):\n \"\"\"Plot the fitted model over the data. (Fig 5100)\n\n Parameter...
[ [ "scipy.stats.norm.pdf", "matplotlib.pyplot.xlim", "numpy.copy", "matplotlib.pyplot.xticks", "numpy.zeros_like", "matplotlib.pyplot.savefig", "numpy.arange", "numpy.isfinite", "matplotlib.pyplot.rcParams.update", "numpy.array", "numpy.percentile", "matplotlib.pyplot....
sunjiao123sun/transformers
[ "c60e0e1ee45f4bf1017736b146c51729f120bb83" ]
[ "src/transformers/models/blenderbot/convert_blenderbot_original_pytorch_checkpoint_to_pytorch.py" ]
[ "# coding=utf-8\n# Copyright 2020 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", "torch.load" ] ]
johndpope/StyleSegments
[ "f6f63df0806c0c90db31f51c64fefe299cdec36a" ]
[ "main.py" ]
[ "from config import images_paths, ims_config, combined_folder, overwrite, mask_blur_size\nfrom segmentation.segment_image import transfer_styles\nfrom style_transfer.style_transfer import StyleTransferModel\nimport cv2\nimport numpy as np\nfrom pathlib import Path\n\nif __name__ == \"__main__\":\n\n # Get all th...
[ [ "numpy.repeat", "numpy.expand_dims" ] ]
ourresearch/journalsdb
[ "169feb9be684eac59f3294dccdb319eb10fe1958" ]
[ "tests/test_ingest_open_access.py" ]
[ "import pandas as pd\nimport pytest\n\nfrom ingest.open_access import import_open_access\nfrom models.usage import OpenAccess\nfrom views import app\n\n\ntest_data = {\n \"issn_l\": [\"2291-5222\"],\n \"title\": [\"Tropical Parasitology\"],\n \"year\": [\"2010\"],\n \"num_dois\": [\"10\"],\n \"num_op...
[ [ "pandas.DataFrame" ] ]
rlturkiye/flying-cavalry
[ "a56c304afd970deaf762b0c6c90fb141106cbd81" ]
[ "rllib/airgym/envs/test.py" ]
[ "import airsim\nfrom airsim.types import YawMode\nimport numpy as np\nimport random\nfrom time import sleep\nimport math\n\ndrone = airsim.CarClient()\n\n#print(drone.getCarState().kinematics_estimated.position)\n#print(drone.simGetObjectPose(\"KargoArabasi\").position)\n#print(random.randint(0, 4))\ndef transform_...
[ [ "numpy.linspace" ] ]
LaudateCorpus1/llvm-project
[ "ff2e0f0c1112558b3f30d8afec7c9882c33c79e3" ]
[ "mlir/test/Integration/Dialect/SparseTensor/python/test_stress.py" ]
[ "# RUN: SUPPORT_LIB=%mlir_runner_utils_dir/libmlir_c_runner_utils%shlibext \\\n# RUN: %PYTHON %s | FileCheck %s\n\nimport ctypes\nimport errno\nimport itertools\nimport os\nimport sys\n\nfrom typing import List, Callable\n\nimport numpy as np\n\nfrom mlir import ir\nfrom mlir import runtime as rt\nfrom mlir.execu...
[ [ "numpy.allclose", "numpy.zeros" ] ]
preshmalinetpereira/lifting_events_to_3d_hpe
[ "2d7b196dc6ab85e10ae07466657304f324a64a37" ]
[ "scripts/dhp19/generate_DHP19/Python_Files/normalizeImage3Sigma.py" ]
[ "### File created by preshma\n\nimport numpy as np\nfrom statistics import variance as var\nimport math\ndef normalizeImage3Sigma(img):\n m, n = img.shape\n sum_img=np.sum(img)\n count_img=np.count_nonzero(img>0)\n mean_img = sum_img / count_img\n var_img=var(img[img>0])\n sig_img = np.sqrt(var_im...
[ [ "numpy.sum", "numpy.count_nonzero", "numpy.sqrt" ] ]
awesome-archive/sk-dist
[ "15cd2383f2927313c7cfb539ea9ca8909727b84a" ]
[ "skdist/tests/test_postprocessing.py" ]
[ "\"\"\"\nTest postprocessing \n\"\"\"\n\ntry:\n import numpy as np\n from sklearn.linear_model import LogisticRegression\n from skdist import postprocessing\n _import_error = None\nexcept Exception as e:\n _import_error = e\n\ndef test_import_postprocessing():\n assert _import_error == None\n\ndef...
[ [ "sklearn.linear_model.LogisticRegression", "numpy.array" ] ]
szghlm/smote_variants
[ "9066ddbd526b18bb273746c1b989e8e07a35abd2" ]
[ "examples/003_evaluation_one_dataset.py" ]
[ "\n# coding: utf-8\n\n# # Evaluation of oversamplers with a set of classifiers on one database\n# \n# In this notebook we give an example of optimizing oversamplers and classifiers for given dataset.\n\n# In[1]:\n\n\nimport os.path\n\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.tree import Deci...
[ [ "sklearn.neighbors.KNeighborsClassifier", "sklearn.tree.DecisionTreeClassifier" ] ]
mauriziokovacic/ACME
[ "2615b66dd4addfd5c03d9d91a24c7da414294308" ]
[ "ACME/math/linint.py" ]
[ "import torch\nfrom ..utility.istorch import *\n\n\ndef linint(A, B, t):\n \"\"\"\n Computes the linear interpolation between the two input at the specified parameter\n\n Parameters\n ----------\n A : Tensor\n the first input tensor\n B : Tensor\n the second input tensor\n t : flo...
[ [ "torch.lerp" ] ]
sandsturm/GamestonkTerminal
[ "1969ff3b251711099a448024ec71e5b4e50413f7" ]
[ "gamestonk_terminal/fundamental_analysis/market_watch_api.py" ]
[ "import argparse\nimport requests\nimport pandas as pd\nfrom bs4 import BeautifulSoup\nfrom gamestonk_terminal.helper_funcs import (\n get_user_agent,\n parse_known_args_and_warn,\n patch_pandas_text_adjustment,\n financials_colored_values,\n)\nfrom gamestonk_terminal import feature_flags as gtff\n\n\nd...
[ [ "pandas.set_option" ] ]
daisuke-fujita/monsaca-analytics_20181107
[ "5809e66874d76bd9f102e7694197bd849210fa3b" ]
[ "monasca_analytics/sml/logistic_regression.py" ]
[ "#!/usr/bin/env python\n\n# Copyright (c) 2016 FUJITSU LIMITED\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required...
[ [ "numpy.hsplit", "sklearn.linear_model.LogisticRegression", "numpy.array", "sklearn.metrics.classification_report" ] ]
pzelasko/k2
[ "2dbb3e09b152fcf98354c946baa271e5b57c8321" ]
[ "k2/python/tests/index_test.py" ]
[ "#!/usr/bin/env python3\n#\n# Copyright (c) 2020 Mobvoi Inc. (authors: Fangjun Kuang)\n# Xiaomi Corporation (authors: Haowen Qiu)\n#\n# See ../../../LICENSE for clarification regarding multiple authors\n\n# To run this single test, use\n#\n# ctest --verbose -R index_test_py\n\nimport ...
[ [ "torch.device", "torch.cuda.is_available", "torch.tensor" ] ]
penut85420/FinMind
[ "df2aa29d6fbf180d5a701bb2c207197e9324f857" ]
[ "Mining/Mind.py" ]
[ "\n\nimport pandas as pd\nimport numpy as np\nimport requests\nfrom FinMind.Data import Load\n\ndef MoveAverage(stock_price,days = 5,variable = 'close'):\n # variable = 'close'\n # days = 5\n return stock_price[variable].rolling(window = days).mean()\n \ndef RSV(stock_price,days = 9):\n sp = stock_pr...
[ [ "pandas.DataFrame", "numpy.unique" ] ]
olegaobini/dontGetFiredBot
[ "4421170337e9ffbc356e7c97db2cb3a70ce89c69" ]
[ "dgfbot/views.py" ]
[ "from dgfbot.device_facade import *\r\nfrom dgfbot.utils import similar_arr_in_list, checkImage, ImageDraw, Image\r\nimport numpy\r\n\r\n\"\"\"\r\nhiring process view\r\ndialog view\r\n\r\nCS 640x1520\r\n\"\"\"\r\n\r\nscreenPath = \"screenshots\\\\screenshot.png\"\r\n\r\n\r\nclass mainView:\r\n def __init__(self...
[ [ "numpy.array" ] ]
AgarwalVedika/snmn_cvpr
[ "494dbc36ae4938d4f16072c4d91e7fbdfd76723f" ]
[ "models_clevr_snmn/output_unit.py" ]
[ "import tensorflow as tf\nfrom tensorflow import convert_to_tensor as to_T, newaxis as ax\n\nfrom .config import cfg\nfrom util.cnn import fc_layer as fc, fc_elu_layer as fc_elu, conv_layer as conv\nimport ipdb\n\ndef build_output_unit_vqa(q_encoding, m_last, num_choices, apply_dropout,\n s...
[ [ "tensorflow.convert_to_tensor", "tensorflow.shape", "tensorflow.range", "tensorflow.concat", "tensorflow.argmax", "tensorflow.nn.l2_normalize", "tensorflow.reshape", "tensorflow.variable_scope", "tensorflow.zeros_like", "tensorflow.reduce_sum", "tensorflow.get_variable"...
Leo-VK/creme
[ "3b397d6aafdfad48dbb36813c90ed3fd1844fc30" ]
[ "creme/decomposition/test_.py" ]
[ "\"\"\"\nThe tests performed here confirm that the outputs of the online LDA are exactly the same as those of\nthe original with a batch_size of size 1. Coverage is 100%.\n\nReferences:\n 1. Jordan Boyd-Graber, Ke Zhai, Online Latent Dirichlet Allocation with Infinite Vocabulary.\n http://proceedings.mlr.pres...
[ [ "numpy.array", "numpy.array_equal" ] ]
Shathra/gradient-descent-demonstration
[ "0244a3602e7cbefb6c3b1905c3af5af5fd753022" ]
[ "gradient_descent_local_minima.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\n# Function to minmize\ndef f(x):\n\treturn 8 * (x-10) * np.sin(0.5*x-5) + 200\n\n# Derivative of the function\ndef fd(x):\n\treturn 4 * (x - 10) * np.cos(0.5*x - 5) + 8 * np.sin(0.5*x-5)\n\nx_min = -30\nx_max = 30\nx =...
[ [ "numpy.sin", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "numpy.cos", "matplotlib.pyplot.show", "numpy.linspace" ] ]
phil-hawkins/alpha-zero-general
[ "b218bd3f98740f917a98bbf2609a516fcfcef6fc", "b218bd3f98740f917a98bbf2609a516fcfcef6fc" ]
[ "hex/NNet.py", "min_mcts/hex_node.py" ]
[ "import os\nimport sys\nimport math\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom time import time\nfrom tqdm import tqdm\nfrom absl import logging\nsys.path.append('../../')\nfrom utils import dotdict, AverageMeter\nfrom NeuralNet import NeuralNet\nfrom .models.scale_cnn import CNNHex, Recur...
[ [ "numpy.array", "torch.no_grad", "torch.cuda.is_available", "torch.tensor", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.load", "torch.exp", "torch.sum" ], [ "numpy.copy", "numpy.array_equal", "numpy.random.choice" ] ]
cjweir/vectorizers
[ "6400af95e130cc692e13244ec5d696222b784606" ]
[ "vectorizers/ngram_vectorizer.py" ]
[ "import numpy as np\nimport numba\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.utils.validation import (\n check_is_fitted,\n)\n\nfrom collections import defaultdict\nimport scipy.linalg\nimport scipy.stats\nimport scipy.sparse\n\nfrom .utils import (\n flatten,\n validate_homo...
[ [ "numpy.iinfo", "numpy.array", "sklearn.utils.validation.check_is_fitted", "numpy.asarray" ] ]
brandonwillard/symbolic-pymc3
[ "13fa4a9f5b4639bc9dc63e4df71cde10aac4bb3b" ]
[ "tests/test_conjugates.py" ]
[ "import theano.tensor as tt\nimport numpy as np\n\nfrom theano.gof.opt import EquilibriumOptimizer\nfrom theano.gof.graph import inputs as tt_inputs\n\nfrom symbolic_pymc import MvNormalRV, observed\nfrom symbolic_pymc.opt import KanrenRelationSub, FunctionGraph\nfrom symbolic_pymc.utils import optimize_graph\nfrom...
[ [ "numpy.testing.assert_array_less", "numpy.testing.assert_raises", "numpy.diag" ] ]
MunskyGroup/rSNAPsim
[ "af3e496d5252e1d2e1da061277123233a5d609b4" ]
[ "build/lib/rsnapsim/SSA_Soln.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Dec 17 17:57:33 2020\n\n@author: willi\n\"\"\"\n\nfrom . import GenericMetaData\nGenericMetaData = GenericMetaData.GenericMetaData\nimport numpy as np\nimport json, codecs\nfrom json import encoder\n\nclass SSA_Soln():\n '''\n SSA container class\n\n holds i...
[ [ "numpy.array", "numpy.where", "numpy.loadtxt", "numpy.around", "numpy.fromstring", "numpy.atleast_2d" ] ]
Achronus/Udacity-DRL-Nanodegree-Projects
[ "a732d1bd779eda5a9daead33f472eb316e61da5e" ]
[ "p1_navigation/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n#-----------------------------------------------------------------------\n# Class Title: QNetwork \n#-----------------------------------------------------------------------\nclass QNetwork(nn.Module):\n \"\"\"\n Deep Q-Network architecture.\...
[ [ "torch.manual_seed", "torch.nn.Linear" ] ]
DataRescueBoulder/Nasa
[ "5029ef95e4ea6132a00ca9f5731197fdc1090d27" ]
[ "src/auto_cluster.py" ]
[ "#!/usr/bin/env python\n\"\"\"auto_parse scientific fixed-width blocks of data\"\"\"\n\nimport sys\nimport os\nimport codecs\nimport re\nimport json\nimport logging\nimport collections\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef chunkstring(string, length):\n \"A generator which return the string...
[ [ "numpy.array", "matplotlib.pyplot.acorr", "numpy.mean" ] ]
timgates42/ray
[ "032e8553c78d9f72db99be6f95621887a4d24d7f" ]
[ "ci/long_running_tests/workloads/actor_deaths.py" ]
[ "# This workload tests repeatedly killing actors and submitting tasks to them.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport sys\nimport time\n\nimport ray\nfrom ray.cluster_utils import Cluster\n\nnum_redis_shards = 1...
[ [ "numpy.random.rand" ] ]
Strabes/strappy
[ "f897e2635b8eb308341b87451a7e9839cddedc7e", "f897e2635b8eb308341b87451a7e9839cddedc7e" ]
[ "strappy/pipelines/base_pipeline.py", "strappy/utils/binners.py" ]
[ "\"\"\"\nBase pipeline constructs a pipeline of\ngeneric transformations for easy EDA\n\"\"\"\n\nfrom typing import Union\nimport numpy as np\nimport pandas as pd\n\nfrom feature_engine.imputation import (\n ArbitraryNumberImputer,\n AddMissingIndicator,\n CategoricalImputer\n)\n\nfrom feature_engine.encod...
[ [ "sklearn.compose.ColumnTransformer", "pandas.DataFrame", "pandas.merge", "pandas.concat" ], [ "numpy.concatenate", "numpy.quantile", "numpy.ceil", "numpy.isnan", "numpy.array", "numpy.round", "numpy.nanmin", "numpy.sign", "pandas.Categorical", "numpy.abs...
aidancgray/catkit
[ "c789f20a327faf91f5b34b6818670732eab24040", "c789f20a327faf91f5b34b6818670732eab24040" ]
[ "catkit/hardware/sbig/SbigCamera.py", "catkit/emulators/boston_dm.py" ]
[ "from catkit.catkit_types import MetaDataEntry\nfrom catkit.interfaces.Camera import Camera\nfrom catkit.config import CONFIG_INI\nfrom catkit.catkit_types import units, quantity\nimport catkit.util\nfrom astropy.io import fits\nimport numpy as np\nimport logging\nimport os\nimport requests\nimport sys\n\nimport ca...
[ [ "numpy.frombuffer" ], [ "numpy.round", "numpy.clip" ] ]
victorcampos7/edl
[ "ffdf23d4e102ca7d69a1408bafa267b0c7d8bfa0" ]
[ "agents/maze_agents/toy_maze/skill_discovery/edl.py" ]
[ "# Copyright (c) 2019, salesforce.com, inc.\n# All rights reserved.\n# SPDX-License-Identifier: MIT\n# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT\n\nimport os\nimport json\nimport torch\nimport torch.nn as nn\nfrom .base import StochasticAgent\nfrom agents.ma...
[ [ "torch.arange", "torch.log", "torch.no_grad", "torch.nn.Softmax" ] ]
arkottke/pygmm
[ "e3b37ea3f81ffb847e040292c6731e36627ac9aa" ]
[ "pygmm/atkinson_boore_2006.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Atkinson and Boore (2006, :cite:`atkinson06`) model.\"\"\"\nimport numpy as np\n\nfrom . import model\n\n__author__ = \"Albert Kottke\"\n\n\nclass AtkinsonBoore2006(model.GroundMotionModel):\n \"\"\"Atkinson and Boore (2006, :cite:`atkinson06`) model.\n\n Developed for the East...
[ [ "numpy.ones_like", "numpy.log", "numpy.minimum", "numpy.interp", "numpy.arange", "numpy.log10", "numpy.maximum" ] ]
TAViT2022/TAViT
[ "6ea42150c57af0e0618675565440df85121cf50a" ]
[ "server_main.py" ]
[ "import argparse\n\nimport torch\nfrom omegaconf import OmegaConf\nimport src.server.app as app\nfrom src.server.client_manager import TAViTClientManager\nfrom src.server.tavit_server import TAViTServer\nfrom src.server.strategy import CustomStrategy, FedAvg, Strategy\nfrom src.server.torch_model.transformer.transf...
[ [ "torch.cuda.is_available" ] ]
petercwill/temp
[ "5988f169744b50e138c9e764c93e6606f9906dd7" ]
[ "es_rnn/data_loading.py" ]
[ "import numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nimport pandas as pd\n\n\ndef read_file(file_location):\n series = []\n ids = []\n with open(file_location, 'r') as file:\n data = file.read().split(\"\\n\")\n\n for i in range(1, len(data) - 1):\n # for i in range(1, len(...
[ [ "numpy.array", "torch.tensor", "torch.from_numpy", "pandas.get_dummies" ] ]
DanielDimanov/tpu
[ "883065e163e4f7745a60aa726b426cdca35d38aa" ]
[ "models/official/detection/executor/tpu_executor.py" ]
[ "# Copyright 2019 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.Summary", "tensorflow.contrib.tpu.TPUConfig", "tensorflow.Graph", "numpy.mean", "tensorflow.gfile.MakeDirs", "tensorflow.Summary.Value", "tensorflow.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.contrib.tpu.RunConfig", "tensorflow.Session.reset", "te...
khoppa/cryptotrade
[ "ee932b1cda5578ddcad60caf930f46cf86b132b6" ]
[ "trade/utils/timeseriessplit.py" ]
[ "from sklearn.model_selection import TimeSeriesSplit\nfrom sklearn.utils import indexable\nfrom sklearn.utils.validation import _num_samples\nimport numpy as np\n \nclass TimeSeriesSplitCustom(TimeSeriesSplit):\n \"\"\"Time Series cross-validator\n Provides train/test indices to split time series data samples...
[ [ "numpy.arange", "sklearn.utils.indexable", "sklearn.utils.validation._num_samples" ] ]
ArtezGDA/MappingTheCity-Maps
[ "a29377af7878907d30b4199d0859f007ba08b5e6" ]
[ "Kimberley ter Heerdt/Poster/Visual-1:2/visualisatie1-birthjan1.py" ]
[ "import matplotlib.pyplot as plt\nimport json\n\n\n\ndef visual_file(file_name , life_color, death_color):\n with open(file_name, 'r') as f:\n data = json.load(f)\n for d in data:\n cur_biths = d['birth']\n date = d['date'].split(' ')\n date = int(date[1])\n ...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
maheshkkumar/adacrowd
[ "c171fdb3674908fb06d5838fcba12c90b78bdbe4" ]
[ "adacrowd/trainer_baselines.py" ]
[ "import numpy as np\nimport torch\nfrom torch import optim\nfrom torch.autograd import Variable\nfrom torch.optim.lr_scheduler import StepLR\n\nfrom config.baselines import cfg\nfrom misc.utils import (AverageMeter, Timer, logger, print_summary,\n update_model, vis_results)\nfrom models.cc_ba...
[ [ "torch.optim.lr_scheduler.StepLR", "torch.autograd.Variable", "numpy.sum", "torch.no_grad", "numpy.sqrt", "torch.load" ] ]
joeddav/datasets
[ "115d65db3f68f92be79063a4333552eccfc0df68" ]
[ "src/datasets/fingerprint.py" ]
[ "import json\nimport os\nfrom copy import deepcopy\nfrom dataclasses import asdict\nfrom functools import wraps\nfrom typing import TYPE_CHECKING\n\nimport numpy as np\nimport pyarrow as pa\nimport xxhash\n\nfrom .info import DatasetInfo\nfrom .utils.py_utils import dumps\n\n\nif TYPE_CHECKING:\n from .arrow_dat...
[ [ "numpy.random.default_rng" ] ]
junjungoal/robosuite
[ "14a9a8672bb14145dd4586a0c0080e1d0d3ff74e", "14a9a8672bb14145dd4586a0c0080e1d0d3ff74e" ]
[ "robosuite/wrappers/data_collection_wrapper.py", "robosuite/models/objects/xml_objects.py" ]
[ "\"\"\"\nThis file implements a wrapper for saving simulation states to disk.\nThis data collection wrapper is useful for collecting demonstrations.\n\"\"\"\n\nimport os\nimport time\nimport numpy as np\n\nfrom robosuite.wrappers import Wrapper\nfrom robosuite.utils.mjcf_utils import save_sim_model\n\n\nclass DataC...
[ [ "numpy.array" ], [ "numpy.array" ] ]
gbaychev/pandas
[ "04893a954b91574279c402e8730a4b5fae2ae9e1" ]
[ "pandas/core/arrays/categorical.py" ]
[ "import operator\nfrom shutil import get_terminal_size\nimport textwrap\nfrom typing import Type, Union, cast\nfrom warnings import warn\n\nimport numpy as np\n\nfrom pandas._config import get_option\n\nfrom pandas._libs import algos as libalgos, hashtable as htable, lib\nfrom pandas.compat.numpy import function as...
[ [ "numpy.array_equal", "pandas.core.algorithms.factorize", "pandas.core.accessor.delegate_names", "pandas.CategoricalIndex", "pandas.core.algorithms._get_data_algo", "pandas.core.dtypes.dtypes.CategoricalDtype", "pandas.core.reshape.concat.concat", "pandas.core.construction.extract_a...
IliaBahmutov/ArtML
[ "e44bdf03428c3984a76f556417bf47d90793dc2d" ]
[ "Code/Build/Models/DAISY/Training/SVMTraining.py" ]
[ "import numpy #for numpy storage\nimport os #to find files\nimport time #for time to complete\nfrom sklearn import svm\nimport pickle\nstart = time.time()\nfrom sklearn.calibration import CalibratedClassifierCV\nfrom statistics import mean\n\n#Import Training Data & Labels\nodata = numpy.load(\"Data/20ImpTrainingDa...
[ [ "numpy.load", "sklearn.calibration.CalibratedClassifierCV", "sklearn.svm.LinearSVC" ] ]
Felipetoledo4815/DNNV
[ "b94147d7dec8e7b50943e616e57c7a1a2b8ed517" ]
[ "dnnv/verifiers/eran/utils.py" ]
[ "import numpy as np\nimport tensorflow.compat.v1 as tf\n\nfrom typing import List, Type\n\nfrom dnnv.nn.layers import Convolutional, FullyConnected, InputLayer, Layer\nfrom dnnv.verifiers.common import HyperRectangle, VerifierTranslatorError\n\nfrom .layers import conv_as_tf\n\n\ndef as_tf(\n layers: List[Layer]...
[ [ "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.reshape", "numpy.product", "numpy.asarray", "tensorflow.compat.v1.nn.sigmoid", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.nn.relu", "tensorflow.compat.v1.nn.tanh" ] ]
yuhchenlin/pecos
[ "0085d92b09a83a0d81b67ce2b2e0b4b51d163992" ]
[ "test/pecos/xmc/xlinear/test_xlinear.py" ]
[ "# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance\n# with the License. A copy of the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"lic...
[ [ "scipy.sparse.csc_matrix", "numpy.random.normal", "scipy.sparse.save_npz", "numpy.eye" ] ]
prutskov/Bodo-examples
[ "7c96e89f3ac9062eb598b99da2729718007b8e4d" ]
[ "examples/intraday_mean.py" ]
[ "\"\"\"\nIntraday example to demonstrate Pandas functionality.\n\n Usage:\n mpiexec -n [cores] python intraday_mean.py --file [file] --maxDays [max_num_days]\n\n# adapted from:\n# http://www.pythonforfinance.net/2017/02/20/intraday-stock-mean-reversion-trading-backtest-in-python/\nSee data generation script i...
[ [ "pandas.DataFrame", "numpy.zeros" ] ]
meguia/acousticfield
[ "4028aab25ae62ea9018868c57ee44b3e4c51ff85" ]
[ "src/acousticfield/process.py" ]
[ "import numpy as np\nfrom scipy import signal\nfrom scipy.io import wavfile\nfrom scipy.interpolate import interp1d\nfrom scipy.fft import next_fast_len, rfft, irfft, fft, ifft\nfrom numpy.fft.helper import fftfreq\n\ndef ir_extract(rec,fileinv,fileout='ir_out',loopback=None,dur=None,fs=48000):\n '''\n extrae...
[ [ "scipy.signal.sosfreqz", "numpy.argmin", "scipy.fft.rfft", "numpy.load", "numpy.mean", "scipy.signal.bilinear_zpk", "scipy.fft.ifft", "scipy.fft.fft", "numpy.max", "numpy.empty", "numpy.angle", "scipy.signal.freqs", "scipy.signal.zpk2tf", "numpy.fft.helper.f...
wwwennie/miu_maps
[ "f73398e731c1973b052c444afa0912ec48e335b3" ]
[ "fillplots/inequalities.py" ]
[ "import numpy\n\nfrom .core import Configurable\nfrom .boundaries import (\n BaseBoundary, YFunctionBoundary, XConstBoundary, to_boundary)\n\n\nclass BaseInequality(Configurable):\n\n def __init__(self, baseconfig, data, less=False, domain=None):\n super(BaseInequality, self).__init__(baseconfig)\n ...
[ [ "numpy.ones_like" ] ]
SamuelAmrich/SpearPy
[ "7011644a9bf440d082bf12425b1ee146567304ec" ]
[ "lib_analyza.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# Analyza knižnica na prácu so signalom pre Kopija_Finder_6.0\n\nimport numpy as np\n# from scipy import signal\n\n\ndef info():\n print(\"Analyza knižnica na prácu so signalom pre Kopija_Finder_6.0 \")\n\n \n# Znormovanie všetkých dát \n \ndef norm(zaznam):\n ...
[ [ "numpy.divide", "numpy.round", "numpy.sum", "numpy.roll", "numpy.abs" ] ]
schenkd/webdev-project
[ "8b2ae4396d5f3f059692021b07fe74394408dfea" ]
[ "data_import.py" ]
[ "# ~*~ encoding: utf-8 ~*~\nfrom pymongo import MongoClient\nfrom pandas import read_csv\nfrom datetime import date\n\n\nmongodb = MongoClient('192.168.178.82', 9999)\ndb = mongodb['dev']\ndrug_collection = db['drug']\n\ndrugs = read_csv('~/Dokumente/bfarm_lieferenpass_meldung.csv', delimiter=';', encoding='iso8859...
[ [ "pandas.read_csv" ] ]
gustawlippa/QFA
[ "7f1f8bd0d2c9cb9aeeeb924b2f002c9e849523be" ]
[ "QFA/test/gqfa_test.py" ]
[ "import unittest\nfrom QFA import GQFA\nimport numpy as np\nfrom math import sqrt\n\n\nclass GQFATest(unittest.TestCase):\n\n def test_example(self):\n # example is the same as in GQFA.example()\n alphabet = 'a'\n\n a_matrix = np.array([[1 / 2, 1 / 2, sqrt(1 / 2), 0],\n ...
[ [ "numpy.array" ] ]
ManuelMBaumann/pymor
[ "9ad226a0a46c7ba30a18bdab27b8bbbfe8f83a31" ]
[ "src/pymor/operators/fv.py" ]
[ "# This file is part of the pyMOR project (http://www.pymor.org).\n# Copyright 2013-2019 pyMOR developers and contributors. All rights reserved.\n# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)\n\n\"\"\" This module provides some operators for finite volume discretizations.\"\"\"\n\nim...
[ [ "numpy.concatenate", "scipy.sparse.coo_matrix", "numpy.array", "numpy.linalg.norm", "numpy.ones_like", "numpy.zeros_like", "numpy.minimum", "numpy.sum", "scipy.sparse.csc_matrix", "numpy.tile", "numpy.greater_equal", "numpy.less_equal", "numpy.einsum", "nump...
ToxaIvchenko/AWS-JPL-OSR-Challenge-1
[ "6acb5603d7300ac500fea98df6fcff08a386e0dd" ]
[ "simulation_ws/src/rl-agent/markov/environments/mars_env.py" ]
[ "from __future__ import print_function\n\nimport time\nimport boto3\nimport gym\nimport numpy as np\nfrom gym import spaces\nimport PIL\nfrom PIL import Image\nimport os\nimport random\nimport math\nimport sys\nimport rospy\nfrom nav_msgs.msg import Odometry\nfrom geometry_msgs.msg import Twist, Pose, Quaternion\nf...
[ [ "numpy.array", "numpy.isnan", "numpy.interp", "numpy.arange", "numpy.amin", "numpy.linspace" ] ]
cacsphysics/PlasmaPy
[ "fbf7f2654e27f14fe696048773c9cae3b377ca3a" ]
[ "plasmapy/particles/ionization_state.py" ]
[ "\"\"\"\nObjects for storing ionization state data for a single element or for\na single ionization level.\n\"\"\"\n__all__ = [\"IonizationState\", \"State\"]\n\nimport astropy.units as u\nimport collections\nimport numpy as np\nimport warnings\n\nfrom numbers import Integral, Real\nfrom typing import List, Optiona...
[ [ "numpy.full", "numpy.array", "numpy.isclose", "numpy.isnan", "numpy.sum", "numpy.min", "numpy.real", "numpy.any", "numpy.allclose", "numpy.arange", "numpy.isfinite", "numpy.all" ] ]
jw787/-
[ "bb4dc73fc8a3ffb8fc507b8e10a00dd6b2ca3250" ]
[ "My_data.py" ]
[ "import numpy as np\nimport cv2\nimport torch\nfrom torchvision import transforms\nfrom torch.utils.data import Dataset\nfrom PIL import Image, ImageDraw\nimport os\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ntrain_boarder = 112\n\n\nclass FaceLandmarksDataset(Dataset):\n def __init__(self, data_fil...
[ [ "numpy.min", "numpy.mean", "pandas.concat", "numpy.random.random", "pandas.read_csv", "matplotlib.pyplot.imshow", "numpy.concatenate", "numpy.max", "pandas.DataFrame", "numpy.random.randint", "torch.utils.data.DataLoader", "numpy.array", "numpy.matmul", "num...
gstoica27/object_relation_transformer
[ "dc41a88c3e2c01677347edfd3fb5479181388ff8" ]
[ "models/CaptionModel.py" ]
[ "# This file contains ShowAttendTell and AllImg model\n\n# ShowAttendTell is from Show, Attend and Tell: Neural Image Caption Generation with Visual Attention\n# https://arxiv.org/abs/1502.03044\n\n# AllImg is a model where\n# img feature is concatenated with word embedding at every time step as the input of lstm\n...
[ [ "torch.zeros", "torch.stack", "torch.unbind", "torch.FloatTensor", "torch.LongTensor", "torch.sort" ] ]
johnny161/Text-Clustering
[ "d3eb7cebfb7679d10070e5ba20096631c92bb673" ]
[ "Kmeans/kmeans_cluster.py" ]
[ "# -*- coding: utf8 -*-\n\nimport os, sys\nfrom sklearn.cluster import KMeans\nfrom sklearn import feature_extraction\nfrom sklearn.feature_extraction.text import TfidfTransformer\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.metrics import silhouette_score\nfrom sklearn.manifold import...
[ [ "matplotlib.pyplot.grid", "sklearn.cluster.KMeans", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "sklearn.manifold.TSNE", "matplotlib.pyplot.figure", "matplotlib.pyplot.yticks", "matplotlib.pyplot.savefig", "sklearn.metrics.silhouette_sco...
filipkro/mmpose
[ "b4b6eda3fe3c2470ab0e44936f4bf7f82db6d3e4", "b4b6eda3fe3c2470ab0e44936f4bf7f82db6d3e4" ]
[ "mmpose/models/keypoint_heads/top_down_simple_head.py", "demo/top_down_detection00.py" ]
[ "import torch.nn as nn\nfrom mmcv.cnn import (build_conv_layer, build_upsample_layer, constant_init,\n normal_init)\n\nfrom ..registry import HEADS\n\n\n@HEADS.register_module()\nclass TopDownSimpleHead(nn.Module):\n \"\"\"Top-down model head of simple baseline paper ref: Bin Xiao. ``Simple\...
[ [ "torch.nn.Sequential", "torch.nn.Identity", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ], [ "numpy.array", "numpy.save", "numpy.shape", "numpy.zeros" ] ]
asafmanor/SampleNet
[ "b55e2b336d54db31a2d689abede2c3d049275d97" ]
[ "classification/models/pointnet_cls.py" ]
[ "from __future__ import print_function\nimport tensorflow as tf\nimport numpy as np\nimport math\nimport sys\nimport os\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.join(BASE_DIR, \"../utils\"))\nimport tf_util\nfrom transform_nets import input_transfo...
[ [ "tensorflow.zeros", "tensorflow.expand_dims", "tensorflow.summary.scalar", "tensorflow.Graph", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.nn.l2_loss", "tensorflow.transpose", "numpy.eye", "tensorflow.variable_scope", "tensorflow.constant", "tensorflow.pl...
ArtyDev57/face_recon
[ "c0a79b3fe41e0db37cb13ce54e17bef8f8dbf685" ]
[ "core/face_processing.py" ]
[ "import cv2\nimport numpy as np\nimport math\nfrom database import list_know_people_by_id, insert_people_access\nfrom os import path, getcwd, mkdir\nfrom datetime import datetime\nimport core.face_detection as fd\nimport face_recognition as fr\n\nclass faceproc:\n\n def __init__(self, resize_frame=4, camera_id=N...
[ [ "numpy.argmin" ] ]
Heyjuke58/frcnn-wind-turbine-detection
[ "29311020188d3a26c8935cae710bd2c5013653ab" ]
[ "keras_frcnn/pascal_voc.py" ]
[ "# -*- coding: utf-8 -*-\r\nimport os\r\nimport pickle\r\nimport numpy as np\r\nimport xml.etree.ElementTree as ET\r\n\r\nclass pascal_voc_util(object):\r\n def __init__(self, devkit_path):\r\n self.classes = ('__background__', # always index 0\r\n 'aeroplane', 'bicycle', 'bird', ...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.sum", "numpy.mean", "numpy.where", "numpy.finfo", "numpy.arange", "numpy.argmax", "numpy.argsort", "numpy.cumsum", "numpy.maximum" ] ]
CharlesPikachu/pydrawing
[ "be95378a5667ea345f2a3760f8814dff255ebe15" ]
[ "pydrawing/modules/beautifiers/oilpainting/oilpainting.py" ]
[ "'''\nFunction:\n 照片油画化\nAuthor:\n Charles\n微信公众号:\n Charles的皮卡丘\n'''\nimport cv2\nimport random\nimport numpy as np\nfrom scipy import ndimage\nfrom ..base import BaseBeautifier\n\n\n'''照片油画化'''\nclass OilpaintingBeautifier(BaseBeautifier):\n def __init__(self, brush_width=5, palette=0, edge_operator='...
[ [ "numpy.square", "scipy.ndimage.convolve", "numpy.array", "numpy.arctan2" ] ]
pupil-labs/pupil-invisible-lsl-relay
[ "68f31b5408479d5324e69063e67e517c6354b31d" ]
[ "examples/linear_time_model.py" ]
[ "# imports for the full pipeline\nimport numpy as np\nimport pandas as pd\nimport pyxdf\nfrom sklearn import linear_model\n\n# import xdf data\n# define the name of the stream of interest\nstream_name = 'pupil_invisible_Event'\n\n# load xdf data\npath_to_recording = './lsl_recordings/recorded_xdf_file.xdf'\ndata, h...
[ [ "pandas.DataFrame", "pandas.read_csv", "sklearn.linear_model.LinearRegression", "numpy.intersect1d" ] ]
boschresearch/highway-env
[ "19770b9e2a4a4e740b1aec6680d14d36fd4da3c2", "19770b9e2a4a4e740b1aec6680d14d36fd4da3c2" ]
[ "highway_env/envs/common/action.py", "highway_env/vehicle/controller.py" ]
[ "import functools\nfrom itertools import product\nfrom typing import TYPE_CHECKING, Optional, Union, Tuple, Callable\nfrom gym import spaces\nimport numpy as np\n\nfrom highway_env import utils\nfrom highway_env.utils import Vector\nfrom highway_env.vehicle.dynamics import BicycleVehicle\nfrom highway_env.vehicle.k...
[ [ "numpy.array", "numpy.linspace", "numpy.zeros", "numpy.clip" ], [ "numpy.array", "numpy.round", "numpy.tan", "numpy.clip", "numpy.linspace" ] ]
cfangmeier/matplotboard
[ "a6e2c638f611c0cc9206ac18dd0ea827f367dc3a" ]
[ "examples/example_02.py" ]
[ "from itertools import product\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotboard as mpb\n\n\n@mpb.decl_fig\ndef cool_fig(func, scale, color=\"b\"):\n xs = np.linspace(-scale, scale, 100)\n f = {\n \"sin\": lambda xs: np.sin(xs),\n \"tan\": lambda xs: np.tan(xs),\n ...
[ [ "numpy.sin", "matplotlib.pyplot.plot", "numpy.tan", "numpy.exp", "numpy.linspace" ] ]
awesome-archive/OAG
[ "551a237e8aa1fd6642b6c89f0fdb545104c09712" ]
[ "core/hash/hash.py" ]
[ "from os.path import join\nimport os\nimport numpy as np\nimport time\nfrom collections import defaultdict as dd\n\nfrom core.hash.title2vec import Title2Vec\nfrom core.utils import feature_utils\nfrom core.utils import data_utils\nfrom core.utils import eval_utils\nfrom core.utils import settings\n\nimport logging...
[ [ "numpy.where", "numpy.random.normal", "numpy.dot", "numpy.zeros" ] ]
zyw19980410/avm
[ "a00e9ac09a5ca394eb18b4f55fc9adeeb2c0f1ec" ]
[ "nnunet/preprocessing/sanity_checks.py" ]
[ "# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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# ...
[ [ "numpy.array", "numpy.isclose", "numpy.ediff1d", "numpy.unique" ] ]
dannygoldstein/kowalski
[ "db955f85f8e2737534c40266a7ca500c96cef80d" ]
[ "tools/fetch_ztf_matchfiles.py" ]
[ "import argparse\nfrom bs4 import BeautifulSoup\nimport multiprocessing as mp\nfrom multiprocessing.pool import ThreadPool\nimport os\nimport pandas as pd\nimport pathlib\nimport requests\nimport subprocess\nfrom tqdm.auto import tqdm\n\n\nfrom utils import load_config\n\n\n''' load config and secrets '''\n# config...
[ [ "pandas.DataFrame.from_records", "pandas.read_csv" ] ]
wangkua1/Glow-PyTorch
[ "efec083a4bb0cee971868f49b80a17276ef2cab0" ]
[ "plot_utils.py" ]
[ "\"\"\"Plotting utilities.\n\"\"\"\nimport os\nimport csv\nimport ipdb\nimport argparse\nfrom collections import defaultdict\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as mtick\n\nimport seaborn as sns\nsns.set(style='white')\n\n\ndef load_epoch_log(exp_dir):\n epoch_dict = ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "matplotlib.pyplot.yticks", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pypl...
JBX028/gpt2
[ "875a97b11e35a6d8b5de8023b071b0fb5a3776d2" ]
[ "inst/python/gpt2/interactive_conditional_examples.py" ]
[ "#!/usr/bin/env python3\n\nimport fire\nimport json\nimport os\nimport numpy as np\nimport tensorflow as tf\n\nimport model, sample, encoder\n\ndef interact_model(\n model_name='124M',\n seed=None,\n nsamples=1,\n batch_size=1,\n length=None,\n temperature=1,\n top_k=0,\n top_p=1,\n model...
[ [ "tensorflow.set_random_seed", "numpy.random.seed", "tensorflow.Graph", "tensorflow.train.Saver", "tensorflow.placeholder" ] ]
afedyukova/libact
[ "947f92d42690bfae758180e8809ccd5252e656df" ]
[ "libact/query_strategies/tests/utils.py" ]
[ "\"\"\"This module includes some functions to be reused in query strategy testing.\n\"\"\"\n\nimport numpy as np\n\n\ndef run_qs(trn_ds, qs, truth, quota):\n \"\"\"Run query strategy on specified dataset and return quering sequence.\n\n Parameters\n ----------\n trn_ds : Dataset object\n The data...
[ [ "numpy.array" ] ]
QianWanghhu/pyapprox
[ "14754f987868de827a968d07486e733cde4276bf", "14754f987868de827a968d07486e733cde4276bf" ]
[ "pyapprox/tests/test_indexing.py", "pyapprox/tests/test_approximate.py" ]
[ "import unittest\nfrom pyapprox.indexing import *\nfrom functools import partial\nfrom scipy.special import binom\n\n\nclass TestIndexing(unittest.TestCase):\n def test_nchoosek(self):\n assert nchoosek(3, 2) == binom(3, 2)\n \n def test_compute_hyperbolic_indices(self):\n num_vars = 3\n ...
[ [ "scipy.special.binom" ], [ "numpy.random.normal", "numpy.linalg.norm", "sklearn.gaussian_process.kernels.Matern", "scipy.stats.uniform", "numpy.random.seed", "numpy.random.permutation", "numpy.min", "numpy.allclose", "numpy.random.uniform", "numpy.sqrt", "numpy....
w2naf/digital_rf
[ "482608dcc5608b9d9a0aacf77e75f83edbec1f0e" ]
[ "python/examples/beacon/beacon_record.py" ]
[ "#!python\n# ----------------------------------------------------------------------------\n# Copyright (c) 2017 Massachusetts Institute of Technology (MIT)\n# All rights reserved.\n#\n# Distributed under the terms of the BSD 3-clause license.\n#\n# The full license is in the LICENSE file, distributed with this soft...
[ [ "numpy.array", "numpy.rad2deg", "numpy.argmax", "numpy.float" ] ]
flavell-lab/pytorch-3dunet
[ "f6b6c13cb0bb6194e95976b0245b76aaa9e9a496" ]
[ "tests/test_trainer.py" ]
[ "import os\nfrom tempfile import NamedTemporaryFile\n\nimport h5py\nimport numpy as np\nimport torch\n\nfrom pytorch3dunet.datasets.utils import get_train_loaders\nfrom pytorch3dunet.train import _create_optimizer, _create_lr_scheduler\nfrom pytorch3dunet.unet3d.losses import get_loss_criterion\nfrom pytorch3dunet....
[ [ "numpy.random.randint", "torch.cuda.is_available", "numpy.random.rand" ] ]
a5372935/Oct_resnet18
[ "9e835634151398bb6704c251807d28b21fde5b86" ]
[ "Resnet_models/res50.py" ]
[ "import numpy as np\r\nimport warnings\r\n\r\nfrom tensorflow.keras.layers import Input, Conv2D, BatchNormalization, Activation, ZeroPadding2D, AveragePooling2D, MaxPooling2D, GlobalAveragePooling2D, GlobalMaxPooling2D\r\nfrom tensorflow.keras.layers import Dense\r\nfrom tensorflow.keras.layers import add, Flatten\...
[ [ "tensorflow.keras.backend.is_keras_tensor", "tensorflow.keras.layers.add", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.AveragePooling2D", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Activation", "tensorflow.keras.backend.image_data_format", "tensorflow...
jennyabr/faster-rcnn.pytorch
[ "90639b26e9bcdbca0b3da140448913b5c41182e0" ]
[ "lib/model/feature_extractors/resnet_feature_extractor_duo.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\n\nimport torch.nn as nn\nfrom torchvision.models import resnet101\nfrom torchvision.models.resnet import resnet50, resnet152\n\nfrom model.feature_extractors.feature_extractor_duo import FeatureExtractorDuo\nfrom model.utils.net_utils import ...
[ [ "torch.nn.Sequential" ] ]
tensorflow123/python_tutorial
[ "0226237010127594b7e8a8b8fc3ed9fbd1c7bab2" ]
[ "mnist/restore.py" ]
[ "import tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\nmnist = input_data.read_data_sets(\"MNIST_data\", one_hot=True)\n\nsaved_model_dir='./model'\nindex=1\n\nsignature_key = 'test_signature'\ninput_key_x = 'input_x'\ninput_key_y = 'input_y'\ninput_key_keep_prob = 'keep_prob'\noutput...
[ [ "tensorflow.argmax", "tensorflow.Session", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "tensorflow.saved_model.loader.load", "tensorflow.cast" ] ]
ZephyrChenzf/mindspore
[ "4276050f2494cfbf8682560a1647576f859991e8", "8f191847cf71e12715ced96bc3575914f980127a", "4276050f2494cfbf8682560a1647576f859991e8" ]
[ "tests/ut/python/parallel/test_linear.py", "tests/ut/python/ops/test_tensor_slice.py", "tests/st/ops/ascend/test_tbe_ops/test_batchnorm_grad.py" ]
[ "# Copyright 2019 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 applicable l...
[ [ "numpy.ones" ], [ "numpy.array", "numpy.zeros", "numpy.ones", "numpy.arange", "numpy.random.randint" ], [ "numpy.random.randn" ] ]
wangkenpu/rsrgan
[ "0efafbdb4008becd3a81650ca0237c660e976d4a" ]
[ "models/res_lstm_l.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright 2017 Ke Wang\n\n\"\"\"Build the LSTM neural networks.\nThis module provides an example of definiting compute graph with tensorflow.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_funct...
[ [ "tensorflow.contrib.layers.xavier_initializer", "tensorflow.nn.dynamic_rnn", "tensorflow.variable_scope", "tensorflow.zeros_initializer" ] ]
sunggukcha/deeplabs
[ "59e292e6777d1e53ed7716b7afd3c3489d57f61a" ]
[ "modeling/ibn.py" ]
[ "import torch\nimport torch.nn as nn\nimport math\n\nclass IBN(nn.Module):\n\tdef __init__(self, planes, bn):\n\t\tsuper(IBN, self).__init__()\n\t\thalf1\t\t= int(planes/2)\n\t\tself.half\t= half1\n\t\thalf2\t\t= planes - half1\n\t\tself.IN\t\t= nn.InstanceNorm2d(half1, affine=True)\n\t\tself.BN\t\t= bn(half2)\n\td...
[ [ "torch.split", "torch.cat", "torch.nn.InstanceNorm2d" ] ]
scarletstudio/transithealth
[ "408e6c1a063e46edb95040c26db93c2ff93c6d33" ]
[ "pipeline/transform/cta_train_stops.py" ]
[ "import argparse\nimport json\nimport pandas as pd\nfrom shapely.geometry import shape, Polygon, MultiPolygon, Point\nfrom timeit import default_timer as timer\n\n\ncli = argparse.ArgumentParser(description=\"Transform CTA L Train stop data.\")\ncli.add_argument(\"--input_file\", help=\"File path to read CTA L Trai...
[ [ "pandas.read_csv" ] ]
simenvg/cloud_detection_framework
[ "97db2eb2cf3da91aa64ae90bf404adbd4744578b", "97db2eb2cf3da91aa64ae90bf404adbd4744578b" ]
[ "yolo/test_yolo.py", "resources/plot_precision_recall.py" ]
[ "# Instead just add darknet.py to somewhere in your python path\n# OK actually that might not be a great idea, idk, work in progress\n# Use at your own risk. or don't, i don't care\n\nimport xml.etree.ElementTree as ET\nimport os\nimport cv2\nimport sqlite3 as db\nimport argparse\nimport matplotlib as mpl\nif os.en...
[ [ "matplotlib.use", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel" ], [ "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.xlim", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot...
gogulnie/numpy
[ "485b099cd4b82d65dc38cb2b28c7119f003c76c4" ]
[ "numpy/linalg/tests/test_linalg.py" ]
[ "\"\"\" Test functions for linalg module\n\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\nimport os\nimport sys\nimport itertools\nimport traceback\nimport warnings\n\nimport numpy as np\nfrom numpy import array, single, double, csingle, cdouble, dot, identity\nfrom numpy import multip...
[ [ "numpy.testing.assert_allclose", "numpy.dot", "numpy.linalg.linalg._multi_dot_matrix_chain_order", "numpy.random.rand", "numpy.lib.stride_tricks.as_strided", "numpy.exp", "numpy.linalg.qr", "numpy.testing.suppress_warnings", "numpy.linalg.lstsq", "numpy.random.random", ...
wyz2368/open_spiel_egta
[ "6bcb3d4d863e7d89283029dd860412c3ef1731dd" ]
[ "open_spiel/python/algorithms/psro_variations/nash_solver/general_nash_solver.py" ]
[ "# Copyright 2019 DeepMind Technologies Ltd. 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 r...
[ [ "numpy.array", "numpy.zeros", "numpy.sum", "numpy.shape", "numpy.eye", "numpy.isfinite" ] ]