repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Raag079/Self-Driving-Car
[ "55900cba577d0d21caae9e8be445d19178f79805" ]
[ "Term03-PathPlanning-SemanticSegmentation-and-Systems/P3-Capstone-Project/ros/src/styx/bridge.py" ]
[ "\nimport rospy\n\nimport tf\nfrom geometry_msgs.msg import PoseStamped, Quaternion, TwistStamped\nfrom dbw_mkz_msgs.msg import SteeringReport, ThrottleCmd, BrakeCmd, SteeringCmd\nfrom std_msgs.msg import Float32 as Float\nfrom std_msgs.msg import Bool\nfrom sensor_msgs.msg import PointCloud2\nfrom sensor_msgs.msg ...
[ [ "numpy.asarray" ] ]
socratesone/Real-Time-Voice-Cloning
[ "4a4952f93973002e319eec4deb9a3e006d4bf384" ]
[ "encoder/audio.py" ]
[ "from scipy.ndimage.morphology import binary_dilation\nfrom encoder.params_data import *\nfrom pathlib import Path\nfrom typing import Optional, Union\nfrom warnings import warn\nimport numpy as np\nimport librosa\nimport struct\n\ntry:\n import webrtcvad\nexcept:\n warn(\"Unable to import 'webrtcvad'. This p...
[ [ "numpy.array", "numpy.zeros", "numpy.round", "numpy.ones", "numpy.mean", "numpy.cumsum", "numpy.repeat" ] ]
menis/abtools
[ "bfc7c6c508b174bb3b74d8f152156242ddd2ee77" ]
[ "abtools/_correct.py" ]
[ "#!/usr/bin/env python\n# filename: _correct.py\n\n\n\n###########################################################################\n#\n# Copyright (c) 2015 Bryan Briney. All rights reserved.\n#\n# @version: 1.0.0\n# @author: Bryan Briney\n# @license: MIT (http://opensource.org/licenses/MIT)\n#\n###################...
[ [ "numpy.bincount" ] ]
ryanirl/autodiff
[ "8408a992f065e1fa98923dc36474c746ddc4d096" ]
[ "autodiff/nn/functional/activation_functions.py" ]
[ "from autodiff.nn.utils import to_logits, clip_stable, stable_bce\nfrom autodiff.tensor import register\n\nimport numpy as np\n\n\n@register\nclass softmax:\n def forward(x):\n a = np.exp(x.value - np.max(x.value))\n\n return a / np.sum(a, axis = 1, keepdims = True)\n\n def backward(g, x, z):\n ...
[ [ "numpy.max", "numpy.sum", "numpy.einsum" ] ]
rudimeier/BrainStat
[ "a5ef474ffd70300ecf5fa464fff4a41e71f4b7a1" ]
[ "surfstat/tests/test_SurfStatInd2Coord.py" ]
[ "import sys\nsys.path.append(\"python/need_not_convert\")\nfrom SurfStatInd2Coord import *\nimport surfstat_wrap as sw\nimport numpy as np\nimport pytest\n\nsw.matlab_init_surfstat()\n\ndef dummy_test(A, B):\n\n try:\n # wrap matlab functions\n Wrapped_coord = sw.matlab_SurfStatInd2Coord(A, B)\n\n ...
[ [ "numpy.array", "numpy.random.choice", "numpy.random.rand", "numpy.ones", "numpy.allclose", "numpy.random.randint" ] ]
bhaskar2443053/forte
[ "95fabd94126d45c0db07cdcc197049ed1859d228" ]
[ "forte/models/srl/model.py" ]
[ "# Copyright 2019 The Forte 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 required...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.cat", "torch.arange", "torch.max", "torch.no_grad", "torch.softmax", "torch.ones", "torch.topk", "torch.clamp_min", "torch.sum" ] ]
souravsingh/yellowbrick
[ "a5941a6c47fbe5264f3622bc15276ba618bbe1d0" ]
[ "tests/test_classifier/conftest.py" ]
[ "# tests.test_classifier.conftest\n# Provides fixtures for the classification tests module.\n#\n# Author: Benjamin Bengfort <benjamin@bengfort.com>\n# Created: Fri Mar 23 18:07:00 2018 -0400\n#\n# ID: conftest.py [] benjamin@bengfort.com $\n\n\"\"\"\nProvides fixtures for the classification tests module.\n\"\"\"\n...
[ [ "sklearn.model_selection.train_test_split", "sklearn.datasets.make_classification" ] ]
ZJULiHongxin/HandPoseEstimationViaGNN
[ "3bf375fc5383c17b9ca4c4e16ebd4c4b06aadf5a" ]
[ "metrics.py" ]
[ "import math\nimport os\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.nn.parameter import Parameter\nfrom torch.utils.tensorboard import SummaryWriter\nimport numpy as np\n\nimport heat_map_utils\nfrom config_file import config\n\n# Check the availability of GPUs\nif torch.cuda.is_available():\n d...
[ [ "torch.device", "torch.cat", "torch.nn.MSELoss", "torch.cuda.get_device_name", "torch.ones", "torch.cuda.is_available", "torch.tensor", "torch.nn.functional.softmax", "torch.linalg.norm", "torch.mean", "numpy.linspace", "torch.utils.tensorboard.SummaryWriter", "...
baccuslab/pyret
[ "eae8980d3efd36e15432f0a5ca18b0986d79cf93" ]
[ "tests/test_filtertools.py" ]
[ "\"\"\"test_filtertools.py\nTest code for pyret's filtertools module.\n(C) 2016 The Baccus Lab.\n\"\"\"\n\nimport numpy as np\nimport pytest\n\nfrom pyret import filtertools as flt\nfrom pyret.stimulustools import slicestim\n\nimport utils\n\ndef test_ste():\n \"\"\"Test computing a spike-triggered ensemble.\"\"...
[ [ "numpy.fft.fft2", "numpy.exp", "numpy.fft.fft", "numpy.outer", "numpy.zeros_like", "numpy.eye", "numpy.unravel_index", "numpy.arange", "numpy.random.randint", "numpy.sqrt", "numpy.convolve", "numpy.array", "numpy.pad", "numpy.zeros", "numpy.random.randn"...
aniket03/fast_abs_rl
[ "8e97d2a24ea8c867c7a0ed181265db325ee0da1b" ]
[ "train_full_rl.py" ]
[ "\"\"\" full training (train rnn-ext + abs + RL) \"\"\"\nimport argparse\nimport json\nimport pickle as pkl\nimport os\nfrom os.path import join, exists\nfrom itertools import cycle\n\nfrom toolz.sandbox.core import unzip\nfrom cytoolz import identity\n\nimport torch\nfrom torch import optim\nfrom torch.optim.lr_sc...
[ [ "torch.cuda.is_available", "torch.optim.lr_scheduler.ReduceLROnPlateau" ] ]
scotthuang1989/object_detection_with_tensorflow
[ "fa8a6c256aa71cab7e2b647457ebbd74b0c30aae" ]
[ "detection_app/object_detection_tf_vectorization_thread.py" ]
[ "\"\"\"\nVectorization version.\n\n---------------------------\nuse Vectorization to speed up.\n\"\"\"\n\nimport os\nimport tensorflow as tf\nimport threading\nimport argparse\nimport logging\nimport time\nfrom queue import Queue\nimport queue\n\nimport numpy as np\nimport cv2\n\n\nfrom myutil import fps_measure\nf...
[ [ "tensorflow.Graph", "tensorflow.Session", "tensorflow.GraphDef", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "tensorflow.ConfigProto", "tensorflow.placeholder", "tensorflow.stack", "numpy.squeeze", "tensorflow.GPUOptions" ] ]
Camilu-png/happiness_model
[ "7d3a56bb0009a558ea057500a5e7d017daafe0ea" ]
[ "transform_load.py" ]
[ "import pandas as pd\nimport numpy as np\nimport re\n\n\nclass Load():\n def load_from_csv(self, path):\n return pd.read_csv(path)\n\n\nclass Transform:\n def merge_data(self, paths):\n dfs = [pd.read_csv(path) for path in paths]\n\n allowed_cols = ['score', 'economy', 'family', 'health',...
[ [ "pandas.read_csv" ] ]
RuiLin0212/BATMANN
[ "5c5cc3334090fc0442bfd2ffdd41bdcab88cbea2" ]
[ "BATMANN_MNIST/utils/mann.py" ]
[ "import torch.nn.functional as F\r\nimport torch\r\nimport os\r\nimport shutil\r\n\r\n\r\ndef save_checkpoint(state, save):\r\n if not os.path.exists(save):\r\n os.makedirs(save)\r\n filename = os.path.join(save, 'checkpoint.path.tar')\r\n torch.save(state, filename)\r\n\r\n\r\nclass KeyValueMemory(...
[ [ "torch.nn.functional.one_hot", "torch.stack", "torch.norm", "torch.save", "torch.squeeze", "torch.matmul", "torch.exp", "torch.sum" ] ]
Ragav-KS/GATE2014PHY-q29
[ "12bc6595966ba55abdda1e0cec52b196306bffdc" ]
[ "code/main.py" ]
[ "import sys\nfrom collections import deque\n\nimport matplotlib as mpl\nimport numpy as np\nfrom PyQt5 import QtCore, QtWidgets\n\nimport Runge_Kutta as Rk\nfrom ui import Ui\n\n# Constants\nrc0 = 0.6\nm = 1\na = 4.3\nt0 = 0\nt = t0\ndt = 0.025\ntmaxn = 200\nti = 0\n\nr0 = 1\nPr0 = 1\n\nr = r0\nPr = Pr0\n\nr_range ...
[ [ "numpy.linspace" ] ]
mwnewlin/afit_mlperf_training
[ "abdf362abe6a14a85e13b8b18afe7d40cc9e5430" ]
[ "rnn_translator/pytorch/seq2seq/models/decoder.py" ]
[ "import itertools\n\nimport torch\nimport torch.nn as nn\n\nfrom seq2seq.models.attention import BahdanauAttention\nimport seq2seq.data.config as config\n\n\nclass RecurrentAttention(nn.Module):\n\n def __init__(self, input_size, context_size, hidden_size, num_layers=1,\n bias=True, batch_first=F...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.LSTM", "torch.nn.ModuleList", "torch.nn.Embedding" ] ]
madisonmay/dm-haiku
[ "de95f6f83561edeb582d46b2e3bf135051792b91" ]
[ "haiku/_src/depthwise_conv.py" ]
[ "# Lint as: python3\n# Copyright 2020 DeepMind Technologies Limited. 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/LI...
[ [ "numpy.prod", "numpy.sqrt" ] ]
dhansmair/gym-hexario
[ "86ad8533c455954f21364392530874c87e1f622c" ]
[ "setup.py" ]
[ "from distutils.core import setup, Extension\nimport sys\nimport numpy\n\n# compile the c++ extension\n_sources = [\n 'player.cc',\n 'board.cc',\n 'game.cc',\n 'renderer.cc',\n 'controller.cc',\n 'utils.cc',\n 'py_module.cc'\n]\nsources = [\"src/src_cpp/\" + filename for filename in _sources]\n...
[ [ "numpy.get_include" ] ]
zhuoran-Cheng16/delphi-epidata
[ "e257f6ac7ef88fab39fbec90c5e9122e24151937" ]
[ "integrations/server/test_covidcast_endpoints.py" ]
[ "\"\"\"Integration tests for the custom `covidcast/*` endpoints.\"\"\"\n\n# standard library\nfrom typing import Iterable, Dict, Any\nimport unittest\nfrom io import StringIO\n\n# from typing import Optional\nfrom dataclasses import dataclass\n\n# third party\nimport mysql.connector\nimport requests\nimport pandas ...
[ [ "pandas.DataFrame" ] ]
SagarmathaTech/jad-intro-to-machine-learning
[ "21e729d5548b5742fd42dfa9fc6324354fa502de" ]
[ "naive_bayes/nb_author_id.py" ]
[ "#!/usr/bin/python\n\n\"\"\" \n This is the code to accompany the Lesson 1 (Naive Bayes) mini-project. \n\n Use a Naive Bayes Classifier to identify emails by their authors\n \n authors and labels:\n Sara has label 0\n Chris has label 1\n\"\"\"\n \nimport sys\nfrom time import time\nsys.path.ap...
[ [ "sklearn.naive_bayes.GaussianNB", "sklearn.metrics.accuracy_score" ] ]
MilesQLi/LV_groundhog
[ "68d01c90becbf31a487be18985defb0c95f2b522" ]
[ "groundhog/layers/rec_layers.py" ]
[ "\"\"\"\nRecurrent layers.\n\n\nTODO: write more documentation\n\"\"\"\n__docformat__ = 'restructedtext en'\n__authors__ = (\"Razvan Pascanu \"\n \"KyungHyun Cho \"\n \"Caglar Gulcehre \")\n__contact__ = \"Razvan Pascanu <r.pascanu@gmail>\"\n\nimport numpy\nimport copy\nimport theano\nim...
[ [ "numpy.sum" ] ]
danibachar/Kube-Load-Balancing
[ "8b9ea68ddbb46cc730a02ffe30cc68b3d65ca491" ]
[ "simulations/yml_to_df.py" ]
[ "import argparse\n\nimport pandas as pd\n\nfrom config_builder import build_config\nfrom utils.helpers import load_ymal\n\ndef app_dep_graph(yml):\n nodes = []\n source = []\n target = []\n print(yml)\n for svc_name, service in yml[\"services\"].items():\n print(service)\n nodes.append(...
[ [ "pandas.DataFrame" ] ]
mirca/tf-quant-finance
[ "8a040769820f5c9628aab9e662f6dbece1a5207d", "8a040769820f5c9628aab9e662f6dbece1a5207d" ]
[ "tf_quant_finance/math/optimizer/optimizer_test.py", "tf_quant_finance/experimental/models_v2/euler_sampling.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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.math.squared_difference", "numpy.array", "numpy.random.seed", "tensorflow.ones", "numpy.random.randn", "tensorflow.random.uniform", "tensorflow.constant", "tensorflow.reduce_sum", "tensorflow.test.main" ], [ "tensorflow.TensorArray", "tensorflow.convert_...
xu-weizhen/cleverhans
[ "b54cb0ac5edc7a3b632de137a7db0ff233e5eb2a" ]
[ "cleverhans_v3.1.0/cleverhans/attacks/noise.py" ]
[ "\"\"\"The Noise attack\n\n\"\"\"\nimport warnings\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom cleverhans.attacks.attack import Attack\n\n\nclass Noise(Attack):\n \"\"\"\n A weak attack that just picks a random point in the attacker's action space.\n When combined with an attack bundling functio...
[ [ "tensorflow.shape", "tensorflow.clip_by_value" ] ]
sam-sepi/Lite
[ "e0fbab294501d1a2832a4ebf07665271e7e328bc" ]
[ "text_processing.py" ]
[ "# modules\nimport string\nimport re\nimport json\n# https://www.nltk.org/\nimport nltk\nfrom nltk.corpus import stopwords # stopwords\nfrom nltk.stem.porter import PorterStemmer # porter stemming\nfrom nltk.stem import WordNetLemmatizer\n# collections\nfrom collections import Counter\n# Sentiment Analysis\nfrom va...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot" ] ]
lksrmp/paw_structure
[ "560a0a601a90114fd80f98096aa1f0e012121c69" ]
[ "src/structure_ion.py" ]
[ "\"\"\"\npaw_structure.structure_ion\n---------------------------\nAnalysis of ion complex output created by :mod:`.structure_fast`.\n\nFor usage in command line see :ref:`Usage_paw_structure_ion`.\n\nDependencies:\n :py:mod:`matplotlib`\n :py:mod:`numpy`\n :py:mod:`seaborn`\n :py:mod:`sys`\n :mod:`....
[ [ "matplotlib.pyplot.rcParams.update", "numpy.max", "matplotlib.pyplot.xlim", "matplotlib.pyplot.grid", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "nu...
talos-gis/rasterio
[ "7d90213ca0ef04625a17b27e9ef49c1367a53fc1" ]
[ "tests/test_warpedvrt.py" ]
[ "\"\"\"Tests for :py:class:`rasterio.warp.WarpedVRT`.\"\"\"\n\nfrom __future__ import division\nimport logging\n\nimport affine\nimport boto3\nimport numpy\nimport pytest\n\nimport rasterio\nfrom rasterio.crs import CRS\nfrom rasterio.enums import Resampling, MaskFlags\nfrom rasterio.errors import RasterioDeprecati...
[ [ "numpy.moveaxis" ] ]
JiaqiaoZhang/Near_accident_car_driving_control_RL
[ "33f199e0e8fc3936658b3631980a1be667be8477", "33f199e0e8fc3936658b3631980a1be667be8477" ]
[ "envs/scenario4.py", "envs/scenario3.py" ]
[ "import gym\nfrom gym.spaces import Box, Discrete\nfrom gym.utils import seeding\nimport numpy as np\n\nfrom .world import World\nfrom .agents import Car, Building, Pedestrian, Painting\nfrom .geometry import Point\nimport time\n\nclass Scenario4(gym.Env):\n\tdef __init__(self):\n\t\tself.seed(0) # just in case we ...
[ [ "numpy.array", "numpy.tan", "numpy.abs", "numpy.clip", "numpy.mod" ], [ "numpy.minimum", "numpy.array", "numpy.maximum", "numpy.clip" ] ]
busigushen/tf-faster-rcnn
[ "becca3a387c648037d97314a4a249294f74ac45f" ]
[ "lib/model/bbox_transform.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ impor...
[ [ "tensorflow.exp", "tensorflow.multiply", "tensorflow.minimum", "numpy.zeros", "numpy.log", "numpy.minimum", "tensorflow.subtract", "numpy.exp", "numpy.vstack", "tensorflow.stack", "tensorflow.add", "tensorflow.cast" ] ]
rmakerck37/N2D
[ "515b8c95d058029cfc5c496b28849c4421db37c1" ]
[ "N2D_CODE/checkmodel.py" ]
[ "import torch\nimport torch.nn as nn\nimport torchvision\nimport torch.backends.cudnn as cudnn\nimport torch.optim\nimport os\nimport sys\nimport argparse\nimport time\nimport dataloader\nimport model\nimport Myloss\nimport numpy as np\nfrom PIL import Image\nfrom torchvision import transforms\nfrom torchsummary im...
[ [ "torch.cuda.empty_cache" ] ]
dimiroul/BacktestFramePublic
[ "15c48c98e67cb32550d4bfca3ce40e2e0c84c67d" ]
[ "MovingAverage/MADataHandler.py" ]
[ "from DataHandler.DataHandler import DataHandler\nimport pandas\nfrom Event.EventQueue import EVENT_QUEUE\nfrom Event.Event import Event\nimport Information.Info as Info\n\n\n# DEFAULT_COLUMN为默认的读取数据文件的列\nDEFAULT_COLUMN = [\"Symbol\", \"Date\", \"Time\",\n \"Open\", \"High\", \"Low\", \"Close\", \"...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
ruiboshi/Tacotron-2
[ "ecb9ca6a970d4dfc6094d9d9cf71b6c5571a76aa" ]
[ "synthesise_from_graph.py" ]
[ "import argparse\nimport time\nimport sys\nimport os\n\nimport tensorflow as tf\nimport numpy as np\nimport librosa\nfrom hparams import hparams\nfrom tacotron.utils.text import text_to_sequence\nfrom wavenet_vocoder.synthesize import Synthesizer as WaveSynthesizer\nfrom wavenet_vocoder import util\n\ndef _get_conf...
[ [ "numpy.pad", "tensorflow.Graph", "tensorflow.GraphDef", "tensorflow.import_graph_def", "numpy.interp", "tensorflow.ConfigProto", "tensorflow.device" ] ]
renyuzhuo/VGCN-PyTorch
[ "367bf83ab8321cc0220e6b1328c1ed544e09584f" ]
[ "main.py" ]
[ "import os\nimport time\nimport argparse\nimport torch\nimport math\nimport numpy as np\nimport cv2\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as LS\nfrom torch.autograd import Variable\nfrom torchvision import models\nimport scipy.io as scio\nfrom scipy import stats\nimport torch.nn as nn\nfrom ...
[ [ "torch.cuda.manual_seed_all", "numpy.asarray", "numpy.random.seed", "scipy.stats.spearmanr", "scipy.stats.pearsonr", "scipy.io.savemat", "torch.manual_seed", "torch.cuda.empty_cache", "torch.utils.data.DataLoader" ] ]
anuragjoshi3519/invisibility-cloak-opencv
[ "50b98ec925e34d8866865bedcf92c3583c62bf56" ]
[ "invisibleCloak.py" ]
[ "import os\nimport cv2\nimport time\nimport argparse\nimport numpy as np\n\n\ndef useCloak(color,save,out):\n '''\n Python program to simulate invisibility cloak (using opencv library)\n '''\n\n cap = cv2.VideoCapture(0)\n if save:\n frame_width = int(cap.get(3))\n frame_height = int(ca...
[ [ "numpy.array", "numpy.ones" ] ]
anlewy/mt-dnn
[ "eeb6f01ce0630e61a52b8c9c6f7537cd34978e45" ]
[ "hnn/src/apps/hnn_model.py" ]
[ "#\n# Author: penhe@microsoft.com\n# Date: 04/25/2019\n#\n\"\"\" Winograd Schema Challenge model for common sense reasoning\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom concurrent.futures import ThreadPoolExecutor\n\nimport csv\nimpo...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.nn.Dropout", "torch.nn.LogSoftmax", "torch.zeros", "torch.isnan", "torch.max", "torch.gather", "torch.nn.functional.logsigmoid", "torch.matmul", "torch.tensor", "torch.isinf", "torch.ones_like", "torch.zeros_like", ...
ThomasMrY/ActivationFunctionDemo
[ "1f75c7964e354e7593e1fe54932877feb2961488" ]
[ "NN_models/CIFAR10_selu.py" ]
[ "from __future__ import print_function\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport torch as th\nimport torch.optim as optim\nimport torchvision\nimport torch\nfrom torchvision import datasets, transforms\nimport cv2\nimport numpy as np\nimport math\nimport NN...
[ [ "torch.nn.CrossEntropyLoss", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.no_grad" ] ]
jaladh-singhal/wsynphot
[ "052c357a5b6c9f350210db439d831bb4f64ef571" ]
[ "wsynphot/io/cache_filters.py" ]
[ "import os\nimport re\nimport numpy as np\nimport logging\n\n# tqdm.autonotebook automatically chooses between console & notebook\nfrom tqdm.autonotebook import tqdm\nfrom astropy.io.votable import parse_single_table\n\nfrom wsynphot.io.get_filter_data import (get_filter_index_in_batches,\n ...
[ [ "numpy.array", "numpy.array_equal", "numpy.setdiff1d" ] ]
OnerInce/nfl-rest_api
[ "8d66d68ae7f04476a1b9f509e69a9d0dc83bfcca" ]
[ "prediction/views.py" ]
[ "from django.shortcuts import render\nfrom rest_framework import status\nfrom rest_framework.decorators import api_view\nfrom rest_framework.response import Response\nfrom rest_framework.views import APIView\nfrom prediction.apps import PredictionConfig\nfrom django.http import JsonResponse\nfrom players.models imp...
[ [ "numpy.array", "pandas.Series" ] ]
montefiore-ai/averting-a-crisis-in-simulation-based-inference
[ "9dca4a508a19c514422a9b177d4fcf1dad6ea693" ]
[ "workflows/SNPE/slcp/pipeline.py" ]
[ "import argparse\nimport glob\nimport hypothesis as h\nimport hypothesis.workflow as w\nimport logging\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport papermill as pm\nimport shutil\n\nfrom hypothesis.workflow import shell\nfrom tqdm import tqdm\nfrom util import simulate, coverage_of_estima...
[ [ "numpy.save" ] ]
sjquant/trading_calendars
[ "9407809a4447da0bf8920f4100496c4d4834185b", "9407809a4447da0bf8920f4100496c4d4834185b" ]
[ "trading_calendars/exchange_calendar_xjse.py", "tests/test_xwar_calendar.py" ]
[ "#\n# Copyright 2019 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or...
[ [ "pandas.tseries.offsets.Day", "pandas.Timestamp", "pandas.tseries.holiday.Holiday", "pandas.tseries.holiday.Easter" ], [ "pandas.Timestamp" ] ]
anirudh161/tensorboard
[ "86f0bacb7dfe1b7565877bb25fc1a55f4ecaba17" ]
[ "tensorboard/plugins/hparams/backend_context_test.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.test.main" ] ]
mjedor/greedy-bandits
[ "5ca57a50c76e036c2f7fed167fe27a61225886a9", "5ca57a50c76e036c2f7fed167fe27a61225886a9" ]
[ "environment/MAB.py", "arm/Gaussian.py" ]
[ "import numpy as np\n\n\nclass Result:\n \"\"\" The Result class for analyzing the output of bandit experiments. \"\"\"\n\n def __init__(self, nb_arms, horizon):\n self.nb_arms = nb_arms\n self.choices = np.zeros(horizon, dtype=np.int)\n self.rewards = np.zeros(horizon)\n\n def store(s...
[ [ "numpy.zeros", "numpy.mean", "numpy.std", "numpy.arange", "numpy.cumsum" ], [ "scipy.stats.truncnorm" ] ]
djgagne/deepsky
[ "a01886b8b8bb58dbe1dc68670432c05ed72a2786" ]
[ "deepsky/metrics.py" ]
[ "import numpy as np\n\n\ndef brier_score(observations, forecasts):\n return np.mean((forecasts - observations) ** 2)\n\n\ndef brier_skill_score(observations, forecasts):\n bs_climo = brier_score(observations, observations.mean())\n bs = brier_score(observations, forecasts)\n return 1.0 - bs / bs_climo\n...
[ [ "numpy.count_nonzero", "numpy.zeros", "numpy.mean", "numpy.trapz" ] ]
chenrichard10/NeMo
[ "2d09af6f9fdd25b47eee407dd7afe328abcadee8" ]
[ "nemo/collections/asr/parts/utils/diarization_utils.py" ]
[ "# Copyright (c) 2021, 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...
[ [ "numpy.max", "numpy.array", "numpy.tile", "numpy.mean", "numpy.any", "numpy.where", "numpy.std", "numpy.argmax", "numpy.argsort", "numpy.vstack" ] ]
muellermax/nlp-disaster-app
[ "bd9af53cb7ae6b2064abdd4843d8d2556ccd523b" ]
[ "data/process_data.py" ]
[ "import sys\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\n\ndef load_data(messages_filepath, categories_filepath):\n \"\"\"\n A function to load raw data.\n :param messages_filepath: Filepath for CSV-file with messages\n :param categories_filepath: Filepath for CSV-file with categories\n...
[ [ "pandas.read_csv", "pandas.concat" ] ]
askainet/haystack
[ "00aa1f41d7c21273d8c312a3fad0b51ddd446672" ]
[ "haystack/modeling/data_handler/data_silo.py" ]
[ "from typing import TYPE_CHECKING, Optional, List, Tuple, Dict, Union\n\nimport hashlib\nimport json\nimport logging\nimport random\nfrom contextlib import ExitStack\nfrom functools import partial\nfrom itertools import groupby\nfrom pathlib import Path\nimport numpy as np\nfrom tqdm import tqdm\nimport torch\nimpo...
[ [ "torch.utils.data.ConcatDataset", "numpy.array", "numpy.delete", "torch.utils.data.sampler.RandomSampler", "torch.stack", "torch.multiprocessing.Pool", "numpy.sum", "torch.save", "torch.no_grad", "torch.multiprocessing.get_all_sharing_strategies", "numpy.split", "nu...
roxanneluo/NSVF
[ "4ec0fcce044178406a2d3de5c74be1cb01e6ee3a" ]
[ "fairnr/modules/encoder.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.distributed as dist\n\nimport numpy as np\nimport...
[ [ "torch.distributed.get_world_size", "torch.cat", "torch.stack", "torch.enable_grad", "torch.nn.Parameter", "torch.exp", "torch.sqrt", "torch.abs", "torch.distributed.is_initialized", "torch.tensor", "numpy.arange", "numpy.array", "torch.max", "torch.nn.funct...
wibbn/CS231n-Notes
[ "9e81188411ce6b1f6a8effd8cc51f17246d6d2dd" ]
[ "assignments/assignment1/cs231n/classifiers/linear_classifier.py" ]
[ "from __future__ import print_function\n\nfrom builtins import range\nfrom builtins import object\nimport numpy as np\nfrom cs231n.classifiers.linear_svm import *\nfrom cs231n.classifiers.softmax import *\nfrom past.builtins import xrange\n\n\nclass LinearClassifier(object):\n\n def __init__(self):\n self...
[ [ "numpy.max", "numpy.random.randn", "numpy.zeros" ] ]
snifflesnrumjum/IFCB_analysis
[ "46ce192eecbea1d61a865b963c47d3daef351d44" ]
[ "diatom_chain_corrections_counts.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Feb 17 2015\nThis script will grab the feature data from extracted feature files \nfor all images in an automated class file.\nCan bin data by category or leave each image separate.\nThis particular script was edited to use neural nets to estimate the \nnumber of cel...
[ [ "numpy.isnan", "pandas.DataFrame", "scipy.io.loadmat", "pandas.concat", "pandas.read_csv" ] ]
oranges0da/food101
[ "2a54f9d3da4de4d408183912947f25b016bd6d81" ]
[ "model/model.py" ]
[ "import torch\nimport torchvision\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler\nimport torch.nn as nn\nfrom torchsummary import summary\n\n# set device\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\n# base densenet model\nmodel = torchvision.models.resnet18(pre...
[ [ "torch.nn.Linear", "torch.cuda.is_available", "torch.optim.lr_scheduler.StepLR", "torch.nn.CrossEntropyLoss" ] ]
ArneBinder/transformers
[ "ddaafd78fb9c98d4f7b5009fb1998deff4c3d6f1", "ddaafd78fb9c98d4f7b5009fb1998deff4c3d6f1" ]
[ "src/transformers/models/mpnet/modeling_tf_mpnet.py", "src/transformers/benchmark/benchmark_tf.py" ]
[ "# coding=utf-8\n# Copyright 2018 The HuggingFace Inc. team, Microsoft Corporation.\n# Copyright (c) 2018, 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...
[ [ "tensorflow.keras.layers.Add", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.math.not_equal", "tensorflow.math.sqrt", "tensorflow.tile", "tensorflow.nn.softmax", "tensorflow.cast", "tensorflow.math.cumsum", "tensorflow.transpose", "tensorflow.math.abs", "te...
BBN-Q/Auspex
[ "e9763e1907546ad49210415a6b8c2f6d9999f31a" ]
[ "src/auspex/instruments/interface.py" ]
[ "import os\nimport pyvisa as visa\nimport numpy as np\nfrom auspex.log import logger\nfrom .prologix import PrologixSocketResource\n\nclass Interface(object):\n \"\"\"Currently just a dummy interface for testing.\"\"\"\n def __init__(self):\n super(Interface, self).__init__()\n def write(self, value...
[ [ "numpy.random.random" ] ]
cjgalvin/deepchem
[ "64993a129e7f0f78fed9500298b1828ac8a0757a" ]
[ "deepchem/metalearning/tests/test_maml_reload.py" ]
[ "\"\"\"Test that MAML models can be reloaded.\"\"\"\n\nimport deepchem as dc\nimport numpy as np\nimport tensorflow as tf\n\n\nclass SineLearner(dc.metalearning.MetaLearner):\n\n def __init__(self):\n self.batch_size = 10\n self.w1 = tf.Variable(np.random.normal(size=[1, 40], scale=1.0))\n self.w2 = tf.Va...
[ [ "numpy.random.normal", "numpy.sin", "numpy.zeros", "tensorflow.matmul", "numpy.random.uniform", "numpy.sqrt", "numpy.all", "numpy.random.random", "tensorflow.square" ] ]
riccardodv/rlberry
[ "8bb03772cda1e13c57de0e1da7bc7356a3014cfb", "8bb03772cda1e13c57de0e1da7bc7356a3014cfb" ]
[ "rlberry/manager/tests/test_shared_data.py", "rlberry/agents/torch/utils/models.py" ]
[ "import pytest\nimport numpy as np\nfrom rlberry.agents import Agent\nfrom rlberry.manager import AgentManager\n\n\nclass DummyAgent(Agent):\n def __init__(self, **kwargs):\n Agent.__init__(self, **kwargs)\n self.name = \"DummyAgent\"\n self.shared_data_id = id(self.thread_shared_data)\n\n ...
[ [ "numpy.arange" ], [ "torch.nn.Linear", "torch.zeros", "torch.distributions.Categorical", "torch.nn.ModuleList", "torch.nn.Softmax", "torch.nn.init.constant_", "torch.nn.init.xavier_uniform_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.transpose" ] ]
apd10/RzLinear
[ "535c3d0babd0575e5982bc7ce1cad3748f9a62c5" ]
[ "python/rz_linear/RzLinear.py" ]
[ "import torch\nfrom torch.nn.parameter import Parameter\n\nfrom .RzLinearFunction import RzLinearFunction\n\n\nclass RzLinear(torch.nn.Module):\n # XXX(Keren): triton int64 overflow bug\n #P = 2038074743\n P = 45007\n R = 8\n\n '''\n Args:\n P (int): The prime number used in the has...
[ [ "torch.manual_seed", "torch.randint", "torch.tensor", "torch.zeros" ] ]
sakrnference/data-to-text-hierarchical
[ "da88d2d4491266fccc39ac1cc1fbb56bd7bbc30c" ]
[ "onmt/utils/misc.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport torch\nimport random\nimport inspect\nfrom itertools import islice, repeat\nimport os\n\n\ndef split_corpus(path, shard_size, default=None):\n \"\"\"yield a `list` containing `shard_size` line of `path`,\n or repeatly generate `default` if `path` is None.\n \"\"\"\n if...
[ [ "torch.cuda.manual_seed", "torch.arange", "torch.clamp", "torch.manual_seed", "torch.matmul" ] ]
Quer-io/Quer.io
[ "381f4bf3fd505d35d0f10817322ff9072d453a18" ]
[ "querio/service/utils.py" ]
[ "import numpy as np\n\n\ndef get_frequency_count(data, values):\n \"\"\"Returns frequency count for user defined columns in the database\n\n :param data: (Pandas) DataFrame\n data from database\n :param values: list of strings\n columns that users wants frequency to be counted from\n :ret...
[ [ "numpy.array", "numpy.nonzero" ] ]
usnistgov/labbench
[ "dfa03860bd5e747604fcad7d092fb2ffe2d6c116" ]
[ "labbench/_rack.py" ]
[ "# This software was developed by employees of the National Institute of\n# Standards and Technology (NIST), an agency of the Federal Government.\n# Pursuant to title 17 United States Code Section 105, works of NIST employees\n# are not subject to copyright protection in the United States and are\n# considered to b...
[ [ "pandas.read_csv" ] ]
aliaksandr-klimovich/sandbox
[ "adab6b18f3d78a891c38609abc71b5d7a751919c" ]
[ "exercises/arduino_projects/font_generator.py" ]
[ "import numpy as np\nfrom PIL import Image\nfrom PIL import ImageDraw\nfrom PIL import ImageFont\n\nFONT_SIZE = 'MAX'\nFONT_PATH = '/Library/Fonts/Georgia Italic.ttf'\nDISPLAY_WIDTH, DISPLAY_HEIGHT = 128, 64\n\n\ndef char_to_pixels(text, path, font_size):\n font = ImageFont.truetype(path, font_size)\n w, h = ...
[ [ "numpy.where", "numpy.array", "numpy.asarray" ] ]
varma88/pinpoint
[ "921f753617d127e9d9a0ca4aceb2120da894107c" ]
[ "pinpoint/StoreReader.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\nCopyright 2015-2018 Jacob M. Graving <jgraving@gmail.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...
[ [ "numpy.max", "numpy.array", "numpy.stack" ] ]
kolvia/captum
[ "4b6280296dbc740df09afdc592b74e27e0b7ce88" ]
[ "captum/attr/_core/deep_lift.py" ]
[ "#!/usr/bin/env python3\nimport typing\nfrom typing import Optional, Tuple, Union, Any, List, Callable, cast\n\nimport warnings\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import Tensor\nfrom torch.nn import Module\nfrom torch.utils.hooks import RemovableHandle\n\nimport numpy ...
[ [ "torch.cat", "numpy.prod", "torch.no_grad", "torch.max" ] ]
CarlosOrtegaV/PU_Hellinger_Trees
[ "2e442450bc8595f1f104909e03834d0a3fe9ad11" ]
[ "ecsmodels/methodologies/cs_logit/cs_logit.py" ]
[ "from timeit import default_timer as timer\nimport numpy as np\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.model_selection import StratifiedKFold\nimport scipy.optimize\nfrom scipy.special import expit, xlog1py\nfrom experiments import experimental_design\nfrom performance_metrics import perf...
[ [ "numpy.sum", "numpy.log", "numpy.argmin" ] ]
lrgr/tcsm
[ "d87cc5a44b3fe972ac3b8aadcde20b8d368f8244" ]
[ "TCGA-data/src/clean_pole_mutations.py" ]
[ "import pandas as pd\n\nif __name__ == '__main__':\n pole_df = pd.read_csv(snakemake.input[0], sep=\"\\t\", index_col=0)\n mc_df = pd.read_csv(snakemake.input[1], sep=\"\\t\", index_col=0)\n samples = [s[0:12] for s in mc_df.index]\n # pole_exo_patients = set(pole_df.index)\n pole_exo_patients = pole...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
ueser/deepchem
[ "bc6494054f6d0c3e147489ac880143c4c0e5b90f" ]
[ "deepchem/models/tensorgraph/layers.py" ]
[ "# -*- coding: UTF-8 -*-\nimport random\nimport string\nfrom collections import Sequence\nfrom copy import deepcopy\n\nimport tensorflow as tf\nimport numpy as np\n\nfrom deepchem.models.tensorgraph import model_ops, initializations, regularizers, activations\nimport math\n\n\nclass Layer(object):\n layer_number_d...
[ [ "tensorflow.ones_like", "tensorflow.zeros_like", "tensorflow.stack", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.summary.histogram", "tensorflow.FIFOQueue", "tensorflow.Variable", "tensorflow.constant", "tensorflow.nn.dynamic_rnn", "tensorflow.less_equ...
ZZK-AJ/Datawhale-task
[ "c2a8fe5963ae64a6cb0413fb31b588f45202900b" ]
[ "Task6.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport warnings\nimport time\nimport seaborn as sns\nplt.style.use('ggplot')\nplt.rcParams['figure.figsize'] = 10,6\nwarnings.filterwarnings('ignore')\nplt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签\nplt.rc...
[ [ "sklearn.ensemble.RandomForestClassifier", "sklearn.metrics.precision_score", "sklearn.svm.SVC", "sklearn.metrics.accuracy_score", "sklearn.linear_model.LogisticRegression", "matplotlib.pyplot.style.use", "sklearn.tree.DecisionTreeClassifier", "sklearn.model_selection.train_test_sp...
liuqiaoping7/zed-examples
[ "3cef5cbb3f11a735a1319d28552cdc052b31a3d2" ]
[ "tutorials/tutorial 3 - depth sensing/python/depth_sensing.py" ]
[ "########################################################################\n#\n# Copyright (c) 2021, STEREOLABS.\n#\n# All rights reserved.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n# LIMITED TO, THE IMPLIED WARRA...
[ [ "numpy.isinf", "numpy.isnan" ] ]
papkov/CenterNet
[ "91fe229756881fe8f77697b73407e2337b6fc65e" ]
[ "src/tools/vis_pred.py" ]
[ "import pickle\nimport sys\n\nimport cv2\nimport numpy as np\nimport pycocotools.coco as coco\nfrom pycocotools.cocoeval import COCOeval\n\nIMG_PATH = \"../../data/coco/val2017/\"\nANN_PATH = \"../../data/coco/annotations/instances_val2017.json\"\nDEBUG = True\n\n\ndef _coco_box_to_bbox(box):\n bbox = np.array([...
[ [ "numpy.random.random", "numpy.array" ] ]
SarahWooller/Using_NetSurfP
[ "b74718e10118ee4c7be1e7a2b854dc7e08e52cc0" ]
[ "Using_NetSurfP/helper.py" ]
[ "import re\nimport pandas as pd\nimport json\nimport re\nimport sys\nimport subprocess\nimport os\n\ndef main():\n\n\taction = {'query': form_query}\n\targ = input('What would you like to do? query/total ')\n\taction[arg]()\n\t\n\ndef get_ENST_codes():\n\twith open('./data/ENST_codes.json', 'r') as file:\n\t\tretur...
[ [ "pandas.DataFrame", "pandas.to_numeric", "pandas.DataFrame.from_csv", "pandas.concat" ] ]
jkrueger1/nicos
[ "5f4ce66c312dedd78995f9d91e8a6e3c891b262b" ]
[ "nicos_mlz/sans1/devices/collimotor.py" ]
[ "# -*- coding: utf-8 -*-\n# *****************************************************************************\n# NICOS, the Networked Instrument Control System of the MLZ\n# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)\n#\n# This program is free software; you can redistribute it and/or modify it und...
[ [ "numpy.uint16", "numpy.uint32" ] ]
jnmclarty/pandas
[ "b7c32718ae987a46b69e11496c8d042af86be514" ]
[ "pandas/tseries/holiday.py" ]
[ "from pandas import DateOffset, DatetimeIndex, Series, Timestamp\nfrom pandas.compat import add_metaclass\nfrom datetime import datetime, timedelta\nfrom dateutil.relativedelta import MO, TU, WE, TH, FR, SA, SU\nfrom pandas.tseries.offsets import Easter, Day\n\n\ndef next_monday(dt):\n \"\"\"\n If holiday fal...
[ [ "pandas.DatetimeIndex", "pandas.tseries.offsets.Easter", "pandas.compat.add_metaclass", "pandas.DateOffset", "pandas.Timestamp", "pandas.Series", "pandas.tseries.offsets.Day" ] ]
berkbilir/point-cloud-processing
[ "161211ec8c3beebc07d3201ad1c1a24ea4bbdeb7" ]
[ "partialize.py" ]
[ "import numpy as np\nimport open3d as o3d\nimport os\nimport random\nimport glob\n\n\nnpy_files = glob.glob('*.npy')\n\nfor fname in npy_files:\n\tcloud = np.load(fname)\n\t#fname=\"a96226408895c2685e3c4d3bc6ac3be0.xyz.npy\"\n\tprint(fname)\n\tcnt = 0\n\t#for 10 random initial points\n\tfor i in range(2):\n\t\tinit...
[ [ "numpy.delete", "numpy.linalg.norm", "numpy.random.choice", "numpy.load", "numpy.save" ] ]
lugabrielbueno/beginner-projects
[ "21d382db5ebe649e0c9541d070d91da973e95f1e" ]
[ "random walk/random_walk_class.py" ]
[ "import random\nimport matplotlib.pyplot as plt\n\nclass RandomWalk():\n def __init__(self, numpoints,palette_choice):\n # inicia classe random walk\n self.numpoints = numpoints\n self.palette = palette_choice\n self.x_points = [0]\n self.y_points = [0]\n\n def direction(sel...
[ [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.show" ] ]
TeamTitanz/ClassVectorRepresentation
[ "7e4eadd90d0a93e60af26d9313eff06e8088f57b" ]
[ "test.py" ]
[ "import numpy as np\nimport pandas as pd\nimport cPickle\nimport random\nimport math\nfrom os import walk\n\ndef calculateInputs(vectorList):\n del vectorList[-1]\n del vectorList[0]\n X = np.array(vectorList)\n vectorCount = len(vectorList)\n \n\n avgInstanceVec = []\n for i in range(300):...
[ [ "numpy.array", "pandas.read_csv" ] ]
USITC-Gravity-Group/GME
[ "640e1cd6a571e6802a62b5fdcb00544f3b8c0b32" ]
[ "src/gme/estimate/SlimResults.py" ]
[ "# -*- coding: utf-8 -*-\n__Author__ = \"Saad Ahmad\"\n__Project__ = \"Gravity Code\"\n__Created__ = \"07/31/2018\"\n__all__ = ['SlimResults']\n\nfrom scipy import stats\nimport numpy as np\nfrom statsmodels.compat.python import lzip\n\n\n\nclass SlimResults(object):\n def __init__(self, glm_results=None):\n ...
[ [ "numpy.asarray" ] ]
ProctorU/tensorflow
[ "454f89ab3baacbac567d6bcceef4c743f23ce58b", "454f89ab3baacbac567d6bcceef4c743f23ce58b" ]
[ "tensorflow/python/data/ops/dataset_ops.py", "tensorflow/python/eager/forwardprop_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.gen_dataset_ops.map_dataset", "tensorflow.python.ops.array_ops.identity", "tensorflow.python.framework.smart_cond.smart_constant_value", "tensorflow.python.tf2.enabled", "tensorflow.python.ops.gen_dataset_ops.parallel_map_dataset", "tensorflow.python.ops.gen_dataset_...
dipanjanS/neural-structured-learning
[ "ce7fa85d87530f07dd29ad3750122dba60e060bd" ]
[ "research/gnn-survey/layers.py" ]
[ "# Copyright 2020 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.matmul", "tensorflow.ones_like", "tensorflow.transpose", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.LeakyReLU", "tensorflow.sparse.sparse_dense_matmul", "tensorflow.nn.softmax", "tensorflow.repeat",...
kjanoudi/Ax
[ "aa8a1406f08bd44d5ac2af4f7836015a434bc7ae" ]
[ "ax/service/ax_client.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom ax.core.objective import MultiObjective\nimport json\nimport logging\nimport warnings\nfrom typing impo...
[ [ "numpy.maximum.accumulate", "numpy.minimum.accumulate" ] ]
antoniomdk/practicas_mh_ugr
[ "e933224f8a94cf8f4c8d04a1a10b2d2f66bc8c3f" ]
[ "practica3/software/FUENTES/algorithms/evolutionary/strategies.py" ]
[ "import numpy as np\nimport random\nfrom deap import tools\nfrom ..local_search import local_search\n\n\ndef copy_individual(source, dest):\n \"\"\"\n Copy the content of an individial (value + fitness)\n \"\"\"\n dest[:] = source[:]\n dest.fitness = source.fitness\n\n\ndef elitism(population, offspr...
[ [ "numpy.array_equal" ] ]
NHPatterson/napari-imsmicrolink
[ "c5c86061b201305fe280cc2a237314bb1577efb3" ]
[ "napari_imsmicrolink/_tests/data_tests/test_microscopy_writer.py" ]
[ "import pytest\nfrom pathlib import Path\nimport numpy as np\nfrom tifffile import imwrite, imread, TiffFile\nfrom ome_types import from_xml\nimport SimpleITK as sitk\nfrom napari_imsmicrolink.data.tifffile_reader import TiffFileRegImage\nfrom napari_imsmicrolink.data.microscopy_writer import OmeTiffWriter\n\n\n@py...
[ [ "numpy.random.randint", "numpy.array_equal" ] ]
general-synthesis/rxnmapper
[ "11c48e1d27ee0c3011c775cbe9c53a9fa791adc8" ]
[ "rxnmapper/smiles_utils.py" ]
[ "\"\"\"Contains functions needed to process reaction SMILES and their tokens\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport logging\n\nimport re\nimport numpy as np\nfrom functools import partial\nfrom typing import *\nfrom rdkit import Chem\nfrom rdkit.Chem import...
[ [ "numpy.array", "scipy.linalg.block_diag" ] ]
Quantum-Software-Tools/dqva-and-circuit-cutting
[ "ad21493c6ea550651af8d16addf1cca1183612dc", "ad21493c6ea550651af8d16addf1cca1183612dc" ]
[ "cutqc/cutter.py", "cutqc/main.py" ]
[ "from qiskit.dagcircuit.dagcircuit import DAGCircuit\nfrom qiskit.converters import circuit_to_dag, dag_to_circuit\n# from gurobipy import *\nimport numpy as np\nimport math\nfrom qiskit import QuantumCircuit, QuantumRegister\n\nclass MIP_Model(object):\n def __init__(self, n_vertices, edges, vertex_ids, id_vert...
[ [ "numpy.array", "numpy.linspace" ], [ "numpy.array" ] ]
Seungwoo0326/WaveGrad2-1
[ "3b202201348449b89353f28bce1596ca7939a810" ]
[ "dataset.py" ]
[ "import json\nimport os\n\nimport librosa\nimport numpy as np\nfrom torch.utils.data import Dataset\n\nfrom text import text_to_sequence\nfrom utils.tools import pad_1D\n\n\nclass Dataset(Dataset):\n def __init__(\n self, filename, preprocess_config, train_config, sort=False, drop_last=False\n ):\n ...
[ [ "torch.utils.data.Dataset", "numpy.array", "numpy.load", "torch.cuda.is_available", "numpy.arange", "torch.utils.data.DataLoader", "numpy.argsort", "numpy.random.randint" ] ]
MiriamDeml/BatchOptimizedTraining
[ "6e6774a618ccc38c056959b431841364b3bfb8ca" ]
[ "files/plot_2D.py" ]
[ "\"\"\"\r\n 2D plotting funtions\r\n\"\"\"\r\n\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\nfrom matplotlib import pyplot as plt\r\nfrom matplotlib import cm\r\nimport h5py\r\nimport argparse\r\nimport numpy as np\r\nfrom os.path import exists\r\nimport seaborn as sns\r\n\r\n\r\n# Code by Li et al. (2018): http...
[ [ "numpy.divide", "numpy.max", "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.logspace", "numpy.min", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clabel", ...
T8T9/CINN
[ "8a1183a3a6186a91d9a1bb653f53925709bdc8e2" ]
[ "python/tests/test_efficientnet.py" ]
[ "#!/usr/bin/env python3\nimport paddle as paddle\nimport paddle.fluid as fluid\nfrom cinn.frontend import *\nfrom cinn import Target\nfrom cinn.framework import *\nimport unittest\nimport cinn\nfrom cinn import runtime\nfrom cinn import ir\nfrom cinn import lang\nfrom cinn.common import *\nimport numpy as np\nimpor...
[ [ "numpy.allclose", "numpy.abs", "numpy.random.random" ] ]
SIGKDD2021ANON/PaperCodeBandits
[ "bf1c3a6cf2de2dc81228bedb97c5aa3657cebebd" ]
[ "simulations_folder/simulation_analysis_scripts/checkpickle.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\n#matplotlib.use(\"gtk\")\nimport matplotlib as mpl\n\n#matplotlib.use('Qt5Agg')\nfrom table_functions import *\nimport pickle\nimport os\nimport numpy as np\nimport pandas as pd \nimport matplotlib.pyplot as plt \nimport sys\n#sys.path.insert()\n# print(data)\nimport numpy...
[ [ "matplotlib.use", "matplotlib.cm.ScalarMappable", "numpy.array", "numpy.sum", "pandas.DataFrame", "matplotlib.pyplot.close", "numpy.mean", "matplotlib.pyplot.subplots", "matplotlib.pyplot.rc", "numpy.random.uniform", "numpy.arange", "numpy.sqrt", "scipy.stats.t....
lienching/nasbench_keras
[ "1947df9f254880e725f8d6871f71d249ab7c6738" ]
[ "nasbench_keras/model_spec.py" ]
[ "# Copyright evgps\n\n# Licensed under the MIT license:\n\n# http://www.opensource.org/licenses/mit-license.php\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 restrict...
[ [ "numpy.sum", "numpy.array", "numpy.shape" ] ]
AbhilashMathews/PlasmaPINNs
[ "10a45723fbb49ccc66603e2875eee75b80ec09e3" ]
[ "PlasmaPINN_noise.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Apr 5 11:26:54 2021\r\n\r\n@author: mathewsa\r\n\"\"\"\r\n\r\nimport h5py\r\nimport numpy as np\r\n\r\nsave_directory = '/home/mathewsa/Plasma-PINN_manuscript_v0/noise/' #path to find files and save them\r\n\r\nN_outputs = 1 #number of predictions made by each P...
[ [ "tensorflow.exp", "tensorflow.matmul", "tensorflow.ones", "tensorflow.gradients", "numpy.where", "numpy.finfo", "tensorflow.global_variables_initializer", "tensorflow.set_random_seed", "numpy.concatenate", "tensorflow.concat", "tensorflow.train.Saver", "matplotlib.p...
laomagic/THUCNewsProject
[ "a193129257e03e928156be6bdcbf463e9441afa6" ]
[ "src/gen_label_id.py" ]
[ "import os\nimport pandas as pd\nimport json\n\n\ndef write_label_id(data_path, label_path):\n \"\"\"\n 标签映射为id\n :param data_path: 数据的路径\n :param label_path: label的路径\n :return: None\n \"\"\"\n data = pd.read_csv(data_path, sep='\\t').dropna()\n label = data['label'].unique()\n label2id ...
[ [ "pandas.read_csv" ] ]
mmi333/great_expectations
[ "27220336190039148ab91138cb2fd489d2159183" ]
[ "tests/data_context/test_data_context_datasource_non_sql_methods.py" ]
[ "import os\nimport shutil\nfrom typing import List, Union\n\nimport pandas as pd\nfrom ruamel.yaml import YAML\n\nfrom great_expectations.core.batch import Batch, BatchRequest\nfrom great_expectations.data_context.util import file_relative_path\nfrom tests.test_utils import create_files_in_directory\n\nyaml = YAML(...
[ [ "pandas.DataFrame" ] ]
comsaint/Data-Practice
[ "1121443bef901fc6c9ed9f7d3ac60a0885189753" ]
[ "titanic/sk_util.py" ]
[ "\"\"\"\nThis module stores often-used Sklearn utilities, for example column selector, categorical encoder, time extractor,\n etc.\nReusing this module is encouraged.\n\"\"\"\n\nimport pandas as pd\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.preprocessing import FunctionTransformer, LabelEncoder\nfrom...
[ [ "pandas.DataFrame", "sklearn.pipeline.make_pipeline", "pandas.concat" ] ]
krm58/PenaltyShot_Behavior
[ "2a52ff13af0d0661e5700cc36cd32c25809656bd" ]
[ "TrainHumanGoalie1LastShooterSwitch.py" ]
[ "import sys\nimport csv\nimport numpy as np\nimport gpflow\nimport os\nimport pandas as pd\nimport h5py\nfrom sklearn.model_selection import train_test_split\nimport tensorflow as tf\nfrom scipy.cluster.vq import kmeans\ntf.set_random_seed(1234)\nimport pickle\nimport argparse\nimport PKutils\n\ndef train_model(**k...
[ [ "tensorflow.set_random_seed", "tensorflow.zeros_initializer", "numpy.array", "tensorflow.summary.merge_all", "scipy.cluster.vq.kmeans", "numpy.random.seed", "tensorflow.gather", "sklearn.model_selection.train_test_split", "pandas.read_csv", "numpy.expand_dims" ] ]
cafeal/probability
[ "f968a32d601d29ec31a10568ccfe30263cf91ef2", "f968a32d601d29ec31a10568ccfe30263cf91ef2" ]
[ "tensorflow_probability/python/distributions/chi2.py", "tensorflow_probability/python/__init__.py" ]
[ "# Copyright 2018 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "tensorflow.compat.v2.math.xlogy", "tensorflow.compat.v2.control_dependencies", "tensorflow.compat.v2.TensorShape", "tensorflow.compat.v2.math.igamma", "tensorflow.compat.v2.shape", "tensorflow.compat.v2.ones", "tensorflow.compat.v2.math.log", "tensorflow.compat.v2.math.lgamma", ...
demonzyj56/compare_gan
[ "ac821a979ccb5ed46e0a441f87abc9bfd3c37417" ]
[ "compare_gan/src/image_similarity.py" ]
[ "# coding=utf-8\n# Copyright 2018 Google LLC & Hwalsuk Lee.\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 require...
[ [ "tensorflow.reshape", "tensorflow.control_dependencies", "tensorflow.tile", "tensorflow.nn.softmax", "tensorflow.identity", "tensorflow.cast", "tensorflow.nn.avg_pool", "tensorflow.shape", "tensorflow.concat", "tensorflow.shape_n", "tensorflow.constant", "tensorflow...
10XGenomics/napari
[ "2c7ce0ecbf66185b6984b1b36ebaa38672ab450b" ]
[ "napari/layers/shapes/_tests/test_shapes.py" ]
[ "from copy import copy\nfrom itertools import cycle, islice\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom napari._tests.utils import check_layer_world_data_extent\nfrom napari.layers import Shapes\nfrom napari.utils.colormaps.standardize_color import transform_color\n\n\ndef _make_cycled_propert...
[ [ "numpy.concatenate", "numpy.testing.assert_allclose", "numpy.array", "numpy.repeat", "numpy.empty", "numpy.add", "numpy.testing.assert_equal", "numpy.random.seed", "pandas.DataFrame", "numpy.random.uniform", "numpy.random.randint", "numpy.arange", "numpy.unique"...
markperri/FAIR
[ "997fb82f954a41196808ec74113207de38d4b295" ]
[ "fair/gas_cycle/fair1.py" ]
[ "from __future__ import division\n\nimport numpy as np\nfrom scipy.optimize import root\n\nfrom ..constants.general import ppm_gtc\n\n\"\"\"Carbon cycle function from FaIR v1.0.0.\"\"\"\n\ndef carbon_cycle(e0, c_acc0, temp, r0, rc, rt, iirf_max, time_scale_sf0, a, tau,\n iirf_h, carbon_boxes0, c_pi, c0, e1):\n ...
[ [ "scipy.optimize.root", "numpy.sum", "numpy.min", "numpy.exp" ] ]
prokolyvakis/hyperkg
[ "db0b8eee78424dde31f8f691b0c6dd07c376ce73" ]
[ "config/rsgd.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of the following repo: \n# https://github.com/facebookresearch/poincare-embeddings.\n#\n\nimport torch as th\nfrom tor...
[ [ "torch.sum" ] ]
yztxwd/cplate
[ "efda1166522af7855fe5db41f87baaad03156ff4" ]
[ "scripts/cplate_clusters_to_bed.py" ]
[ "\"\"\"Converts cplate clusters to a BED file.\"\"\"\nimport argparse\nimport os\nimport re\n\nimport pandas as pd\n\nCOLUMNS = ['chrom', 'start', 'end', 'name', 'score', 'strand']\n\n\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser.add_argument('--clusters', dest='clusters',\n ...
[ [ "pandas.DataFrame", "pandas.read_table", "pandas.read_csv" ] ]
KASCedric/PointNet
[ "51d494249cc5a308a94cd703f607e636f47ee9ac" ]
[ "src/dataloader.py" ]
[ "import torch\nfrom torch.utils import data\nfrom torch.utils.data.dataset import Dataset\nimport os\nfrom plyfile import PlyData\nimport numpy as np\nfrom utils import split\n\n\nclass SemanticKittiDataset(Dataset):\n def __init__(self, sequence, data_folder):\n super(SemanticKittiDataset, self).__init__...
[ [ "numpy.array", "torch.utils.data.random_split", "torch.from_numpy", "numpy.stack", "torch.utils.data.DataLoader" ] ]
sergevkim/koroba
[ "91d433f6bc7ecf47c62f7be4ddcdc8b38e5b27b7" ]
[ "koroba/utils/camera.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch import Tensor\n\nfrom koroba.utils import Box\n\n\nclass Camera:\n @staticmethod\n def check_boxes_in_camera_fov( #TODO projection on 8 points\n boxes: Tensor,\n camera: Tensor,\n ):\n center_3d ...
[ [ "torch.cat", "torch.stack", "torch.nn.functional.softmax", "torch.nn.functional.softmin" ] ]
20001LastOrder/Neural_Networks_Reliability_Analysis
[ "a56e1be84968569ef96912b32455d8aeb8d79fe9" ]
[ "Clevr/clevr-iep/scripts/preprocess_questions.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport sys\nimport os\nsys.path.insert(0, os.path.abspath('.'))\n\nimport argparse\n\nimport jso...
[ [ "numpy.asarray" ] ]
lgpdv/tools-artbio
[ "af48e9f6df2717ffd3731a974be1ec36e4eff779" ]
[ "tools/probecoverage/multicov.py" ]
[ "import argparse\n\nimport numpy\n\nimport pysam\n\n\ndef Parser():\n the_parser = argparse.ArgumentParser()\n the_parser.add_argument('-bams', '--bams', dest='bams', required=True,\n nargs='+', help='list of input BAM files')\n the_parser.add_argument('-bed', '--bed', dest='bed'...
[ [ "numpy.mean" ] ]