repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
konstantinklemmer/gpytorch | [
"f1d947b340a188c398b6c6e610b6a839c61aa298",
"f1d947b340a188c398b6c6e610b6a839c61aa298",
"f1d947b340a188c398b6c6e610b6a839c61aa298"
] | [
"gpytorch/kernels/grid_kernel.py",
"gpytorch/lazy/non_lazy_tensor.py",
"gpytorch/kernels/cosine_kernel.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport torch\nfrom .kernel import Kernel\nfrom ..lazy import ToeplitzLazyTensor, KroneckerProductLazyTensor\nfrom .. import settings\n\n\nclass GridKernel(Kerne... | [
[
"torch.equal"
],
[
"torch.is_tensor",
"torch.matmul",
"torch.arange"
],
[
"torch.zeros"
]
] |
jaakjensen/PythonDSP | [
"d4f5850a5379c14d531e6f9c6d43e03f53fb888d"
] | [
"graphing/30_fftAnimationPhase.py"
] | [
"# Use this animation to show that the\n# bin reaches its peak when the input\n# signal reaches the bin frequency.\n# When you're between bin frequencies,\n# the energy spills between adjacent bins\n# and the amplitude of the two adjacent\n# bins is lower.\nfrom scipy.fft import fft, fftfreq\nimport numpy as np\nfr... | [
[
"scipy.signal.hann",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.cos",
"matplotlib.pyplot.show",
"numpy.linspace",
"scipy.fft.fft"
]
] |
mateoKutnjak/PointCNN | [
"bfbc2cad7e250b7a3635a0ed56d7d0c1b8df25ea"
] | [
"pointcnn.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport math\nimport pointfly as pf\nimport tensorflow as tf\n\n\ndef xconv(pts, fts, qrs, tag, N, K, D, P, C, C_pts_fts, is_training, with_X_transformation, depth_multiplier,\n sorting_method=... | [
[
"tensorflow.shape",
"tensorflow.range",
"tensorflow.concat",
"tensorflow.expand_dims",
"tensorflow.gather_nd",
"tensorflow.subtract",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.squeeze",
"tensorflow.slice"
]
] |
alevieux/xsar | [
"21b6c7528f736d9a9d6e96c023efd02cb3ff39b3"
] | [
"src/xsar/sentinel1_xml_mappings.py"
] | [
"\"\"\"\nxpath mapping from xml file, with convertion functions\n\"\"\"\n\nfrom datetime import datetime\nimport numpy as np\nfrom scipy.interpolate import RectBivariateSpline, interp1d\nfrom shapely.geometry import box\nimport pandas as pd\nimport xarray as xr\nimport warnings\nimport geopandas as gpd\nfrom shapel... | [
[
"numpy.array",
"scipy.interpolate.interp1d",
"scipy.interpolate.RectBivariateSpline",
"pandas.DataFrame",
"numpy.ones",
"numpy.diff",
"pandas.Categorical",
"numpy.arange",
"pandas.concat",
"numpy.fromstring",
"numpy.datetime64"
]
] |
yuezuegu/nni | [
"281e16a8c5acbc7ef4a7d1a03aefd3c75a7bfe9a"
] | [
"nni/compression/pytorch/utils/counter.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nimport functools\nfrom collections import Counter\nfrom prettytable import PrettyTable\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import PackedSequence\nfrom nni.compression.pytorch.compressor import PrunerModuleWrapp... | [
[
"torch.zeros",
"torch.prod",
"torch.max",
"torch.is_tensor",
"torch.no_grad",
"torch.Tensor"
]
] |
woerns/agents | [
"deac4af6a94fb490cbe51e2df061e26f089d34f5",
"deac4af6a94fb490cbe51e2df061e26f089d34f5"
] | [
"tf_agents/experimental/distributed/reverb_variable_container_test.py",
"tf_agents/experimental/examples/ppo/train_eval_lib.py"
] | [
"# coding=utf-8\n# Copyright 2020 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ... | [
[
"tensorflow.compat.v2.distribute.OneDeviceStrategy",
"tensorflow.compat.v2.distribute.MirroredStrategy",
"numpy.array",
"tensorflow.compat.v2.constant",
"tensorflow.compat.v2.TensorSpec",
"tensorflow.compat.v2.Variable",
"tensorflow.compat.v2.nest.flatten",
"tensorflow.compat.v2.di... |
morgangiraud/openai-rl | [
"96935fcd59baa8eb3699b17bfd7f16904a015f96"
] | [
"hpsearch/utils.py"
] | [
"import os, json\nimport tensorflow as tf \nimport numpy as np\n\ndef get_stats(result_dir, tag_names):\n\n eventFile = [f for f in os.listdir(result_dir) if os.path.isfile(os.path.join(result_dir, f)) and 'events' in f][0]\n stats = { key: [] for key in tag_names }\n try:\n for events in tf.train.s... | [
[
"numpy.mean"
]
] |
meelgroup/manthan | [
"00b3426a4eca33fb16ea04b39d18e2bcb81bfe2b"
] | [
"src/generateSamples.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n'''\nCopyright (C) 2021 Priyanka Golia, Subhajit Roy, and Kuldeep Meel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restrictio... | [
[
"numpy.array",
"numpy.count_nonzero",
"numpy.delete",
"numpy.reshape",
"numpy.where"
]
] |
yang69can/pyngl | [
"78a7040ce9de4b7a442b0c3b5faecccab2f01426"
] | [
"examples/cn12p.py"
] | [
"#\n# File:\n# cn12p.py\n#\n# Synopsis:\n# Draws a color filled contour map over Africa.\n#\n# Category:\n# Contours over maps\n#\n# Author:\n# Fred Clare (based on examples of Dave Kennison and Mary Haley).\n#\n# Date of initial publication: \n# September, 2004\n# \n# Descriptio... | [
[
"numpy.array"
]
] |
georgeamccarthy/acoustic-data-science | [
"62a974a8f52ffffa93c4468cc974916997cabff0"
] | [
"acoustic_data_science/plotting/transient_durations.py"
] | [
"import pandas as pd\nimport datetime\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\nimport logging\n\nfrom acoustic_data_science import config, helpers\n\ndurations_stats_txt_path = os.path.join(\n config.project_dir,\n \"figures/transient_durations\",\n \"durations_stats.txt\",\n)\n\n\n... | [
[
"numpy.concatenate",
"numpy.histogram",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"matplotlib.pyplot.bar",
"pandas.read_feather"
]
] |
iosonobert/zutils | [
"02fe9b2c1d1596bf98ee9db2134402517d4a3732"
] | [
"zutils/xrwrap.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jul 30 15:17:42 2018\n\n@author: 20270917\n\"\"\"\n#%%\n\nimport matplotlib.pyplot as plt\nimport pandas\nimport numpy as np\nimport xarray as xr\nfrom matplotlib.dates import num2date, date2num\nimport matplotlib\nimport datetime\nimport os \nimport pdb\n\nfrom zuti... | [
[
"numpy.isnan",
"numpy.sum",
"numpy.logical_and",
"numpy.diff",
"numpy.where",
"numpy.arange",
"numpy.timedelta64",
"numpy.all"
]
] |
joeycw/tashares | [
"b7b2c6e6055563cfdf83657ea3b08690234c1132"
] | [
"tashares/stockhist.py"
] | [
"# -*- coding: utf-8 -*-\nimport yfinance as yf\nimport pandas as pd\nfrom datetime import datetime\nfrom pathlib import Path\nimport logging\nfrom tashares.cfg import config\n\nlogging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s',\n level=logging.INFO,\n datefmt=... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.notnull",
"pandas.concat"
]
] |
Rodrigo-A-Pereira/pykeen | [
"76c5acb707faa524b5951b0d1d85ab1afe806462"
] | [
"src/pykeen/nn/modules.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Stateful interaction functions.\"\"\"\n\nfrom __future__ import annotations\n\nimport itertools as itt\nimport logging\nimport math\nfrom abc import ABC, abstractmethod\nfrom typing import Any, Callable, Generic, Mapping, MutableMapping, Optional, Sequence, Set, Tuple, Union, cast\... | [
[
"torch.nn.Linear",
"torch.get_default_dtype",
"torch.nn.Dropout",
"torch.zeros",
"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",
"t... |
leoyanzhizhang/CSC_411 | [
"4092e13c4f5a728da89a2d6d933454ea48c2a1d7"
] | [
"assignment_3/q1.py"
] | [
"'''\nQuestion 1 Skeleton Code\n\n\n'''\n\nimport sklearn\nimport numpy as np\nfrom sklearn.datasets import fetch_20newsgroups\nfrom sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer\nfrom sklearn.naive_bayes import BernoulliNB\n\nfrom sklearn.linear_model import LogisticRegression\nfrom sklea... | [
[
"sklearn.datasets.fetch_20newsgroups",
"numpy.round",
"numpy.sum",
"sklearn.neural_network.MLPClassifier",
"sklearn.linear_model.LogisticRegression",
"sklearn.linear_model.SGDClassifier",
"sklearn.naive_bayes.BernoulliNB",
"sklearn.feature_extraction.text.CountVectorizer",
"skl... |
jeah-z/IFP-RNN | [
"83cb3f0f75907227d682e8980b335b17db2c2ab1"
] | [
"AIFP/test.py"
] | [
"# %%\nfrom __future__ import print_function\nimport pickle\nimport numpy as np\nimport pandas as pd\nfrom bitarray import bitarray\ntry:\n # Open Babel >= 3.0\n from openbabel import openbabel as ob\nexcept ImportError:\n import openbabel as ob\nimport sys\nimport os\nimport argparse\nfrom time import tim... | [
[
"pandas.DataFrame.from_dict",
"pandas.DataFrame"
]
] |
starxliu/faster-rcnn.pytorch | [
"6572adb56c90c38dc5b0199c5ee13e54a001a801"
] | [
"lib/model/rpn/proposal_layer.py"
] | [
"# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Sean Bell\n# --------------------------------------------------------\n# -------------------------------------------... | [
[
"numpy.array",
"torch.cat",
"numpy.arange",
"numpy.meshgrid",
"torch.sort"
]
] |
Jurph/image-super-resolution | [
"50e20c62e1a8af512f63094df44cbeeb01a18b72"
] | [
"ISR/models/rrdn.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras.initializers import RandomUniform\nfrom tensorflow.keras.layers import concatenate, Input, Activation, Add, Conv2D, Lambda\nfrom tensorflow.keras.models import Model\n\nfrom ISR.models.imagemodel import ImageModel\n\nWEIGHTS_URLS = {\n 'gans': {\n 'arch_para... | [
[
"tensorflow.keras.layers.Add",
"tensorflow.keras.utils.get_file",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.initializers.RandomUniform... |
594zyc/alfworld | [
"704922821fb0a2ff92dfc3f3a5033ba498cb3932"
] | [
"agents/eval/evaluate_vision_dagger.py"
] | [
"import copy\nimport numpy as np\nimport torch\n\nimport os\nimport sys\nsys.path.insert(0, os.environ['ALFRED_ROOT'])\nfrom agents.utils.misc import extract_admissible_commands\n\n\ndef evaluate_vision_dagger(env, agent, num_games, debug=False):\n env.seed(42)\n agent.eval()\n episode_no = 0\n res_poin... | [
[
"torch.cat",
"numpy.array",
"numpy.sum",
"torch.no_grad",
"numpy.mean"
]
] |
machinelearning147/PyTorchCV | [
"141c0d2dfe50a3a5699ec0e0e3441e608bf51eb7"
] | [
"utils/layers/pose/proposal_layer.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# Author: Donny You(donnyyou@163.com)\n# Make proposals that each consists of all possible keypoints.\n\n\nimport math\nimport numpy as np\nimport torch\nfrom scipy.spatial.distance import cosine\nfrom scipy.ndimage.filters import gaussian_filter\nfrom torch.autograd ... | [
[
"numpy.array",
"numpy.delete",
"numpy.zeros",
"scipy.ndimage.filters.gaussian_filter",
"numpy.nonzero",
"scipy.spatial.distance.cosine",
"numpy.vstack"
]
] |
hushaohan/aqua | [
"8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d",
"8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d"
] | [
"qiskit/chemistry/algorithms/minimum_eigen_solvers/vqe_adapt.py",
"test/optimization/test_knapsack.py"
] | [
"# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE... | [
[
"numpy.asarray",
"numpy.abs"
],
[
"numpy.testing.assert_array_equal",
"numpy.testing.assert_equal"
]
] |
GOALCLEOPATRA/MLM | [
"331fd42f8f1f16ad990e66f9f0f873a824f8f849"
] | [
"models/model.py"
] | [
"import torch\nimport torch.nn as nn\nfrom args import get_parser\n\n# read parser\nparser = get_parser()\nargs = parser.parse_args()\n\nclass Norm(nn.Module):\n def forward(self, input, p=2, dim=1, eps=1e-12):\n return input / input.norm(p, dim, keepdim=True).clamp(min=eps).expand_as(input)\n\nclass Lstm... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.LSTM",
"torch.nn.Conv1d",
"torch.nn.Tanh",
"torch.nn.ReLU",
"torch.nn.Flatten"
]
] |
ranchlin/Feature-Selection | [
"42523625187e59866eb827f6bc84e31f9272995c"
] | [
"example/titanic/Select.py"
] | [
"from sklearn.linear_model import LogisticRegression\nfrom MLFeatureSelection import sequence_selection as ss\nfrom sklearn.metrics import log_loss\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import KFold\n\ndef prepareData():\n df = pd.read_csv('clean_train.csv')\n Title = list(np.... | [
[
"numpy.mean",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.KFold",
"pandas.read_csv",
"numpy.unique"
]
] |
david-haber/tensorflow | [
"d2f49a097b245ec8fd2a6cb36825faebb75fcc47"
] | [
"tensorflow/python/keras/engine/training_arrays.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.keras.engine.training_utils.OutputsAggregator",
"tensorflow.python.keras.backend.symbolic_learning_phase",
"tensorflow.python.keras.engine.training_distributed._copy_weights_to_distributed_model",
"tensorflow.python.keras.backend.is_sparse",
"tensorflow.python.eager.context.... |
abedkhooli/transformers | [
"7988edc031e30c6324ee0fa3759a813c10278c5f"
] | [
"src/transformers/models/dpr/modeling_tf_dpr.py"
] | [
"# coding=utf-8\n# Copyright 2018 DPR Authors, The Hugging Face 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# Unle... | [
[
"tensorflow.zeros",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.squeeze",
"tensorflow.split"
]
] |
GitHK/osparc-services-forked | [
"a8ab08ff7c32de8f1abde015c1515e8cf61426c0"
] | [
"services/dy-dash/cc-rabbit-1d/src/cc-rabbit-1d/cc-rabbit-1d.py"
] | [
"# -*- coding: utf-8 -*-\n# pylint: disable=dangerous-default-value\n# pylint: disable=global-statement\n\nimport asyncio\nimport logging\nimport os\nimport sys\nimport json\nfrom pathlib import Path\n\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom flask import Flask, Bl... | [
[
"numpy.hstack",
"numpy.array",
"numpy.ones",
"pandas.read_csv"
]
] |
Tohoun/ML-INRIA | [
"9eb67c53173218b5cd3061712c827c6a663e425a"
] | [
"python_scripts/linear_models_ex_01.py"
] | [
"# %% [markdown]\n# # 📝 Exercise M4.01\n#\n# The aim of this exercise is two-fold:\n#\n# * understand the parametrization of a linear model;\n# * quantify the fitting accuracy of a set of such models.\n#\n# We will reuse part of the code of the course to:\n#\n# * load data;\n# * create the function representing a ... | [
[
"pandas.read_csv"
]
] |
hbjornoy/SNE-vs-T-SNE | [
"0297d824f2167799aaf04ccc85aff3c66d36392e"
] | [
"plot_mnist.py"
] | [
"\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport helpers as HL\n\nSMALL_SIZE = 15\nMEDIUM_SIZE = 25\nBIGGER_SIZE = 30\n\nplt.rc('font', size=SMALL_SIZE) # controls default text sizes\nplt.rc('axes', titlesize=SMALL_SIZE) # fontsize of the axes title\nplt.rc('axes', ... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show"
]
] |
haoqi/emotions_as_primitives_towards_behavior_understanding | [
"5d82bb0265e585da1cd0144bb93b28dc5cb0e710"
] | [
"src/TASK_train_E-BP_Emo2beh_seq_model/TASK_couple_sequence_model_without_pretrain/Model_class_sequence_couple.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jan 10 16:00:42 2019\n\n@author: haoqi\n\"\"\"\n\n\nimport torch\nimport torch.nn as nn\nimport pdb\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n# the model is based on CMU emotion\n# Base_1D_NN_fixed_seq_len_1... | [
[
"torch.zeros",
"torch.nn.GRU",
"torch.nn.Conv1d",
"torch.unsqueeze",
"torch.nn.ReLU",
"torch.cuda.is_available",
"torch.nn.AdaptiveMaxPool1d"
]
] |
AstroSheppard/WFC3-analysis | [
"dfcea9584ec77abda26506ca4230ca351e8d5542"
] | [
"LATE/wl_preprocess/preprocess_whitelight.py"
] | [
"import configparser\nimport os\nimport sys\nimport time\n\nimport glob\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom astropy.io import fits\n\nimport marg_mcmc as wl\nimport batman\n# Set path to read in get_limb.py from bin_analysis\nsys.path.insert(0, '../bin_analysis')\nimport ... | [
[
"numpy.ones_like",
"numpy.ma.sum",
"matplotlib.pyplot.errorbar",
"pandas.concat",
"pandas.read_csv",
"pandas.read_table",
"numpy.zeros_like",
"pandas.DataFrame",
"numpy.arange",
"numpy.sqrt",
"numpy.append",
"numpy.ma.append",
"numpy.vstack",
"numpy.array",
... |
fbobee/Alpenglow | [
"5f956511017c1bee72390aaecd964c04d8ad4b45"
] | [
"python/test_alpenglow/utils/test_ThreadedParameterSearch.py"
] | [
"import alpenglow as prs\nimport alpenglow.experiments\nimport alpenglow.evaluation\nimport pandas as pd\nimport math\nimport unittest\nfrom alpenglow.utils import ParameterSearch, ThreadedParameterSearch\n\n\nclass TestThreadedParameterSearch(unittest.TestCase):\n def test_runMultiple(self):\n data = pd.... | [
[
"pandas.read_csv"
]
] |
itsmesatwik/deep-learning | [
"6802bacd3235c8a681c286de0e8963b83dc724e5"
] | [
"Residual Network/resnet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data as data\nimport torch.nn.functional as F\n\nimport torchvision.datasets as datasets\nimport torchvision\nimport torchvision.transforms as transforms\n\nfrom torch.autograd import Variable\n\nimport math\nimport os\nimport tim... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.max",
"torch.nn.BatchNorm2d",
"torch.autograd.Variable",
"numpy.mean",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.nn.Dropout2d",
"tor... |
xguse/crunchers | [
"6cc275d7bf9994dfd712d5208bfd51570c198f5e"
] | [
"src/crunchers/plotting.py"
] | [
"#!/usr/bin/env python\n\"\"\"Provide streamlined plotting functions.\"\"\"\n\n# Imports\nimport pandas as pd\nimport numpy as np\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom munch import Munch, munchify\n\n\n# Metadata\n__author__ = \"Gus Dunn\"\n__email__ = \"w.gus.dunn@gmail.com\"\n\n\n# Fun... | [
[
"matplotlib.pyplot.axhline",
"pandas.DataFrame",
"matplotlib.pyplot.tight_layout",
"pandas.concat",
"pandas.Series"
]
] |
ilionx/qlabs-limitlessgaming | [
"b2e985a4556cc0e2f34fe6bb02205f623e899bc1"
] | [
"src/Microphone/recording/audio_functions.py"
] | [
"\"\"\"A set of functions which are useful for working with sound\"\"\"\nimport numpy as np\nimport soundfile as sf\nimport pickle\nimport matplotlib.pyplot as plt\nimport sounddevice as sd\n\n\ndef tone_generater(duration, sample_rate, freq):\n \"\"\"\n generate a single clear tone\n\n Parameters\n ---... | [
[
"matplotlib.pyplot.show",
"numpy.sin",
"numpy.linalg.norm",
"numpy.ceil"
]
] |
jacquerie/italian-hand-gestures | [
"ea45b257c1f943a10aabb9ed50ab6b4fce365f20"
] | [
"predict.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom collections import Counter, deque\n\nimport cv2 as cv\nfrom sklearn.utils._joblib import load\n\nRECTANGLE_COLOR = (69, 53, 220)\nTEXT_COLOR = (41, 37, 33)\n\nNUMBER_OF_ROIS = 29\n\nQ_KEY = ord('q')\nW_KEY = ord('w')\nE_KEY = ord('e')\nESC_KEY = 27\n\n\ndef putText(frame, text):\n ... | [
[
"sklearn.utils._joblib.load"
]
] |
jorgeperezg/wavespectra-1 | [
"ad7d737edf05ae801d5d6e79199f704eb092d95e"
] | [
"wavespectra/core/swan.py"
] | [
"\"\"\"Read and write swan spectra files\"\"\"\nimport os\nimport re\nimport gzip\nimport datetime\nimport pandas as pd\nimport numpy as np\n\nfrom wavespectra.core.attributes import attrs\nfrom wavespectra.core.utils import to_nautical\n\nE2V = 1025 * 9.81\n\n\nclass SwanSpecFile(object):\n \"\"\"Read spectra i... | [
[
"numpy.array",
"numpy.isnan",
"numpy.savetxt",
"numpy.argsort",
"pandas.read_csv",
"numpy.unique"
]
] |
dunjin/DataAnalysisInAction | [
"449e9fe961365d07052c16355d86f1a5f4748d7d"
] | [
"33/demo2.py"
] | [
"# -*- coding: utf-8 -*-\n# 用 PageRank 挖掘希拉里邮件中的重要任务关系\nimport matplotlib\n\nmatplotlib.use('Qt4Agg')\nimport pandas as pd\nimport networkx as nx\nimport numpy as np\nfrom collections import defaultdict\nimport matplotlib.pyplot as plt\n\n# 数据加载\nemails = pd.read_csv(\"./input/Emails.csv\")\n# 读取别名文件\nfile = pd.rea... | [
[
"matplotlib.use",
"matplotlib.pyplot.show",
"pandas.read_csv",
"numpy.sqrt"
]
] |
zysophia/Artsy_DS_Web_API | [
"e125b56077524525ac92b03ddb1630df2565f3f3"
] | [
"visualization.py"
] | [
"import pandas as pd\nimport plotly.express as px\nimport plotly.graph_objects as go\n\nfrom datetime import datetime, timedelta\nfrom database import fetch_all_wea_as_df, fetch_all_dis_as_df\nfrom plotly.subplots import make_subplots\nfrom sklearn.ensemble import RandomForestRegressor\nfrom prediction import kde a... | [
[
"numpy.exp"
]
] |
Jovian-Dsouza/sahayak_bot | [
"3565e910218e73e95ed8ce9b9d92dfcbe537894e"
] | [
"perception/scripts/objDetection.py"
] | [
"#!/usr/bin/env python\n\n'''\nThis script starts an object detection service which uses the filtered pcl data \nto detect and recognize the object\n'''\n\n\nfrom pcl_helper import *\nfrom transform_helper import Transformer\nfrom image_helper import ImagePub\nimport pcl\n\nimport rospy\nfrom sensor_msgs.msg import... | [
[
"numpy.max",
"numpy.array",
"numpy.matmul",
"numpy.min",
"numpy.mean",
"numpy.asscalar"
]
] |
david-fisher/320-F19-Track-I | [
"cddff29ad9f79a794928eb29d44bc9f53f46f3fd"
] | [
"OrchardWatch-ML/prediction/keras_model.py"
] | [
"from keras import applications\nimport keras\nimport numpy as np\nfrom keras.preprocessing.image import load_img\nfrom keras.preprocessing.image import img_to_array\nimport matplotlib.pyplot as plt\nfrom keras.applications.imagenet_utils import decode_predictions\nimport os\nfrom keras.models import model_from_jso... | [
[
"numpy.expand_dims"
]
] |
dalbamont/PyBaMM | [
"23b29273806f514e3725c67c30d25cc50b57a4f4"
] | [
"tests/unit/test_simulation.py"
] | [
"import pybamm\nimport numpy as np\nimport pandas as pd\nimport os\nimport unittest\n\n\nclass TestSimulation(unittest.TestCase):\n def test_basic_ops(self):\n\n model = pybamm.lithium_ion.SPM()\n sim = pybamm.Simulation(model)\n\n self.assertEqual(model.__class__, sim._model_class)\n\n ... | [
[
"numpy.array",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.testing.assert_array_almost_equal",
"numpy.linspace"
]
] |
314dev/pi | [
"0e65adf329b00b0d0f73346734df2c06eec05ddd"
] | [
"pytorch_lightning/core/optimizer.py"
] | [
"# Copyright The PyTorch Lightning 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 required by applicable law... | [
[
"torch.zeros"
]
] |
Ekram49/Ekram-lambdata-13 | [
"d058f09e66bdfc9b922a5c059670c039468bd723"
] | [
"assignment_1_1/convert_name_test.py"
] | [
"import unittest\nimport pandas\nfrom assignment_1_1.function_1_1 import convert_names\n\nclass Test(unittest.TestCase):\n def test_function(self):\n test_df = pandas.DataFrame({\"abbrev\": [\"CT\", \"CO\", \"CA\", \"TX\"]})\n self.assertEqual(test_df.columns.tolist(), [\"abbrev\"])\n\nif __name__ ... | [
[
"pandas.DataFrame"
]
] |
MartinPlantinga/TomatoNet | [
"52f3f993665865d1e74b24c43bf4a722c470eac1"
] | [
"lib/fast_rcnn/bbox_transform.py"
] | [
"# --------------------------------------------------------\r\n# Fast R-CNN\r\n# Copyright (c) 2015 Microsoft\r\n# Licensed under The MIT License [see LICENSE for details]\r\n# Written by Ross Girshick\r\n# --------------------------------------------------------\r\n\r\nimport numpy as np\r\n\r\ndef bbox_transform(... | [
[
"numpy.zeros",
"numpy.log",
"numpy.minimum",
"numpy.exp",
"numpy.vstack"
]
] |
avirupsinha10/Face-Mask-Detection | [
"80581febe9cd21054e4c972be5238fe975cb1ef6"
] | [
"detect_mask_video.py"
] | [
"# USAGE\r\n# python detect_mask_video.py\r\n\r\n# import the necessary packages\r\nfrom tensorflow.keras.applications.mobilenet_v2 import preprocess_input\r\nfrom tensorflow.keras.preprocessing.image import img_to_array\r\nfrom tensorflow.keras.models import load_model\r\nfrom imutils.video import VideoStream\r\ni... | [
[
"tensorflow.keras.models.load_model",
"numpy.array",
"tensorflow.keras.preprocessing.image.img_to_array",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input"
]
] |
Gruntrexpewrus/TrajectoryFor-and-DPP | [
"f6553f4f5d01dfd67dd1c0caa363d886de660737"
] | [
"DPPsampling2.py"
] | [
"import argparse\nimport baselineUtils\nimport torch\nimport torch.utils.data\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport os\nimport time\nfrom transformer.batch import subsequent_mask\nfrom torch.optim import Adam,SGD,RMSprop,Adagrad\nfrom transformer.noam_opt import NoamOpt\nimport numpy as np... | [
[
"numpy.dot",
"sklearn.metrics.pairwise.rbf_kernel",
"torch.ones",
"torch.multinomial",
"torch.cuda.is_available",
"torch.load",
"torch.reshape",
"numpy.divide",
"numpy.concatenate",
"numpy.random.normal",
"numpy.linalg.norm",
"scipy.io.savemat",
"numpy.prod",
... |
alexelthomas/corner.py | [
"9e018682d149b470428e76125678cdc61ad0d1b1"
] | [
"corner/corner.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function, absolute_import\n\nimport logging\nimport numpy as np\nimport matplotlib.pyplot as pl\nfrom matplotlib.ticker import MaxNLocator, NullLocator\nfrom matplotlib.colors import LinearSegmentedColormap, colorConverter\nfrom matplotlib.ticker import Scala... | [
[
"numpy.where",
"numpy.sort",
"numpy.cumsum",
"matplotlib.colors.LinearSegmentedColormap.from_list",
"numpy.max",
"matplotlib.ticker.MaxNLocator",
"numpy.interp",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.append",
"matplotlib.pyplot.gca",
"numpy.atleast_2d... |
qwfy/pyqtgraph | [
"55f3863e4afd0a641d440facd286d95390cc672a"
] | [
"pyqtgraph/widgets/GraphicsView.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nGraphicsView.py - Extension of QGraphicsView\nCopyright 2010 Luke Campagnola\nDistributed under MIT/X11 license. See license.txt for more infomation.\n\"\"\"\n\nfrom ..Qt import QtCore, QtGui, QT_LIB\n\ntry:\n from ..Qt import QtOpenGL\n HAVE_OPENGL = True\nexcept ImportEr... | [
[
"numpy.clip"
]
] |
jonasspinner/weighted-f-free-edge-editing | [
"5db2590615db7ef6a05d2187a54fc09edd201ada"
] | [
"scripts/pace_to_graph.py"
] | [
"#!/usr/bin/python3\nfrom argparse import ArgumentParser\n\nfrom pathlib import Path\nimport numpy as np\n\n\ndef convert_pace_to_input_format(input_path: Path) -> str:\n with input_path.open() as input_file:\n lines = input_file.readlines()\n\n p_str, problem, n, m = lines[0].split()\n assert p_str... | [
[
"numpy.ones"
]
] |
SunnyMarkLiu/Kaggle_Invasive_Species_Monitoring | [
"a103d4d4811c7b359f07e34aeb69fa7637adae35"
] | [
"result/result_average.py"
] | [
"#!/usr/local/miniconda2/bin/python\n# _*_ coding: utf-8 _*_\n\n\"\"\"\n@author: MarkLiu\n@time : 17-7-28 下午4:26\n\"\"\"\nimport os\nimport sys\n\nmodule_path = os.path.abspath(os.path.join('..'))\nsys.path.append(module_path)\n\nimport pandas as pd\nfrom conf.configure import Configure\n\nresult_files = os.listdi... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
pqian11/fragment-completion | [
"f8fab2e3c9531b13891df15c0970e3d2bf9c419d"
] | [
"src/gibbs_complete.py"
] | [
"import math\nimport time\nimport numpy as np\nimport torch\nfrom transformers import BertTokenizer, BertModel, BertConfig, BertForMaskedLM\nfrom transformers import GPT2Tokenizer, GPT2LMHeadModel\nimport random\nfrom nltk.tokenize.treebank import TreebankWordDetokenizer\nfrom InfillingModels import RerankingLM\nfr... | [
[
"numpy.random.choice",
"torch.arange",
"numpy.random.seed",
"torch.no_grad",
"torch.manual_seed",
"torch.distributions.categorical.Categorical",
"torch.cuda.is_available",
"torch.tensor",
"torch.load",
"numpy.random.random",
"torch.argmax",
"numpy.mod"
]
] |
sthagen/serge-sans-paille-pythran | [
"fe41dcd069404a75ff56b537b7ac87a0e3c04dc2"
] | [
"pythran/conversion.py"
] | [
"\"\"\" This module provides way to convert a Python value into an ast. \"\"\"\n\nimport gast as ast\nimport numpy as np\nimport numbers\n\n\n# Maximum length of folded sequences\n# Containers larger than this are not unfolded to limit code size growth\nMAX_LEN = 2 ** 8\n\n\nclass ConversionError(Exception):\n\n ... | [
[
"numpy.iinfo"
]
] |
surojitnath/ga-learner-dsmp-repo | [
"2fffa94e8106b10faad269f8d4f7f6a3c9ddff8b"
] | [
"Human-Activity-Recognition-with-Smartphones/code.py"
] | [
"# --------------\nimport pandas as pd\nfrom collections import Counter\n\n# Load dataset\ndata = pd.read_csv(path)\nprint(data.isnull().sum())\ndata.describe()\n\n\n# --------------\nimport seaborn as sns\nfrom matplotlib import pyplot as plt\nsns.set_style(style='darkgrid')\n\n# Store the label values \n\nlabel =... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.feature_selection.SelectFromModel",
"pandas.DataFrame",
"sklearn.model_selection.GridSearchCV",
"sklearn.svm.SVC",
"sklearn.metrics.precision_recall_fscore_support",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.train_test... |
lancopku/LexicalAT | [
"cafd53224834f844833f8b92be1fc727e7b3412d"
] | [
"bert/src/gene_new_sentence.py"
] | [
"import numpy as np\nimport random\nfrom nltk.corpus import wordnet as wn\nimport tensorflow as tf\nflags = tf.app.flags\nFLAGS = flags.FLAGS\nflags.DEFINE_string('action', '', '')\n\ndef get_word(vocab=None, action = None, this_word=None):\n if FLAGS.action == 'no_up' and action == 2:\n return vocab.word... | [
[
"numpy.array",
"numpy.argmax"
]
] |
mitkof6/BTKCore | [
"d4c03aa9e354be16265d0efe0815c09b35abc642"
] | [
"Testing/Python/ForcePlatformTypesTest.py"
] | [
"import btk\nimport unittest\nimport numpy\n\nclass ForcePlatformTypesTest(unittest.TestCase):\n def test_ForcePlatformType1(self):\n pf = btk.btkForcePlatformType1()\n self.assertEqual(pf.GetType(), 1)\n self.assertEqual(numpy.all(pf.GetOrigin() == numpy.zeros((3,1))), True)\n self.a... | [
[
"numpy.array",
"numpy.ones",
"numpy.zeros",
"numpy.eye"
]
] |
Renmusxd/RSwarm | [
"cdee7bf71f6d0cc30d19ca787ab43f835c87c6c3"
] | [
"tfbrain.py"
] | [
"from brain import Brain, ToyBrain\nimport tensorflow as tf\nfrom bot import Bot\nimport numpy\nimport os\n\n\nclass TFBrain(Brain):\n DUALCOPYFREQ = 1000\n\n SESS = None\n WRITER = None\n MERGER = None\n SESS_HOLDERS = 0\n\n # https://stats.stackexchange.com/questions/200006/q-learning-with-neura... | [
[
"tensorflow.matmul",
"tensorflow.nn.softmax",
"tensorflow.one_hot",
"tensorflow.global_variables_initializer",
"tensorflow.random_normal",
"tensorflow.argmax",
"tensorflow.Variable",
"tensorflow.train.Saver",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
... |
aldiamond/extreme-value-analysis | [
"b46487a2e51a687bc07b758ab8edf60b3e1772ef"
] | [
"extremevaluemethod/independentstorms.py"
] | [
"# Copyright (c) 2017 Arup Pty. Ltd.\n# Distributed under the terms of the MIT License.\n\n\"\"\"Methods for Independent storms.\n\"\"\"\n\nimport numpy as np\n\nfrom .utils import least_squares\n\ndef peaks_over_threshold(max_storm_gusts, no_years, min_threshold=None, max_threshold=None):\n \"\"\"Build a functi... | [
[
"numpy.linspace"
]
] |
Carus11/python-swat | [
"b0721d30f5bc6b9083f8bdc4b025d16939ae901a"
] | [
"swat/tests/cas/test_connection.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n#\n# Copyright SAS Institute\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# U... | [
[
"pandas.io.parsers.read_csv",
"pandas.DataFrame",
"pandas.read_csv"
]
] |
PacktPublishing/-Mobile-Deep-Learning-Projects | [
"1983104e76e096cd1201b5543276a807e0867ad6"
] | [
"Chapter8/chess/src/chess_zero/agent/player_chess.py"
] | [
"from collections import defaultdict\nfrom concurrent.futures import ThreadPoolExecutor\nfrom logging import getLogger\nfrom threading import Lock\n\nimport chess\nimport numpy as np\n\nfrom chess_zero.config import Config\nfrom chess_zero.env.chess_env import ChessEnv, Winner\n\n#from chess_zero.play_game.uci impo... | [
[
"numpy.max",
"numpy.random.dirichlet",
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"numpy.argmax",
"numpy.power",
"numpy.sqrt"
]
] |
hsiaoyi0504/statsmodels | [
"905a208540383ec40a76c04dc5fde43fe45a258f"
] | [
"statsmodels/stats/tests/test_multi.py"
] | [
"'''Tests for multipletests and fdr pvalue corrections\n\nAuthor : Josef Perktold\n\n\n['b', 's', 'sh', 'hs', 'h', 'fdr_i', 'fdr_n', 'fdr_tsbh']\nare tested against R:multtest\n\n'hommel' is tested against R stats p_adjust (not available in multtest\n\n'fdr_gbs', 'fdr_2sbky' I did not find them in R, currently test... | [
[
"numpy.concatenate",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.full",
"scipy.stats.distributions.norm.pdf",
"numpy.testing.assert_equal",
"numpy.testing.assert_almost_equal",
"numpy.exp",
"scipy.stats.distributions.norm.ppf",
"numpy.argsort",
"numpy.sqrt",
... |
MadsJensen/agency_connectivity | [
"b45adbc133573de1ebdcff0edb17e43f1691c577"
] | [
"phase_predictive_analysis.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn import ensemble\nfrom sklearn.utils import shuffle\nfrom sklearn.metrics import mean_squared_error\nfrom sklearn.cross_validation import (ShuffleSplit, cross_val_score,\n train_test_split)\... | [
[
"sklearn.ensemble.GradientBoostingRegressor",
"numpy.zeros",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"sklearn.grid_search.GridSearchCV",
"numpy.arange",
"matplotli... |
DarkElement75/dennis | [
"411153b374c48a1e268dd0adffc5d9e5dc84c2c8"
] | [
"dennis5/src/costs.py"
] | [
"import tensorflow as tf\n\nclass cross_entropy(object):\n\n @staticmethod\n def evaluate(a, y, regularization_term):\n #We use tf.max(a, 1e-10) to make sure we only clip if we risk doing log(0), thus avoiding NaN problems\n return tf.reduce_mean(-tf.reduce_sum(y * tf.log(tf.maximum(a, 1e-10)), ... | [
[
"tensorflow.maximum"
]
] |
matthewwardrop/python-parampy | [
"d21ff0f19665f3487078b52667c2caff82c16b1c"
] | [
"tests.py"
] | [
"from __future__ import print_function\n\nimport timeit\nimport cProfile as profile\nimport math\nimport numpy as np\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\nfrom parampy import Parameters,SIUnitDispenser,Quantity,SIQuantity,Unit, UnitDispenser, Units, errors\n\n###################### UNIT TESTS #... | [
[
"numpy.radians",
"numpy.array",
"numpy.cos"
]
] |
devhima/beeBrain | [
"21dfc44f63d82b853f5524d8448781f12cc5989e"
] | [
"samples/nn_samples/save_restore_model_sample.py"
] | [
"'''\nbeeBrain - An Artificial Intelligence & Machine Learning library\nby Dev. Ibrahim Said Elsharawy (www.devhima.tk)\n'''\n\n''''\nMIT License\n\nCopyright (c) 2019 Ibrahim Said Elsharawy\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentatio... | [
[
"numpy.random.normal",
"numpy.random.seed",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"numpy.linspace"
]
] |
Chaojidahoufeng/SGroup_RL | [
"df765ace54383982a0c71bfa8ee39a7a8b914545",
"df765ace54383982a0c71bfa8ee39a7a8b914545"
] | [
"onpolicy/envs/highway/highway_env/interval.py",
"onpolicy/scripts/plot/plot_popart_subplot.py"
] | [
"import itertools\nfrom typing import Tuple, Union, List, Callable\n\nimport numpy as np\nfrom numpy.linalg import LinAlgError\n\nfrom onpolicy.envs.highway.highway_env.road.lane import AbstractLane\nfrom onpolicy.envs.highway.highway_env.types import Vector, Matrix, Interval\n\n\ndef intervals_product(a: Interval,... | [
[
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.minimum",
"numpy.linalg.inv",
"numpy.eye",
"numpy.isreal",
"numpy.amax",
"numpy.linalg.eig",
"numpy.amin",
"numpy.diag",
"numpy.flip",
"numpy.maximum"
],
[
"numpy.array",
"numpy.median",
"matplotl... |
ryanstudebaker/IndeedScraper | [
"e8c613d05fffa168bf1f300c2c646c616f443ddf"
] | [
"IndeedScraper.py"
] | [
"import os.path\nfrom nltk.tokenize import word_tokenize\nfrom nltk.corpus import stopwords\nimport string\nfrom lxml import etree\nimport lxml.html\nimport requests\nimport json\nimport pandas as pd\nfrom nltk import tokenize\nfrom operator import itemgetter\nimport math\nimport nltk\nfrom random import randint\nf... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
kaayy/josydipa | [
"2e185548892c8fbf0529a12404497ea2e978697d"
] | [
"src/trainer.py"
] | [
"#!/usr/bin/env python\n\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport sys\n\nimport time\nimport numpy as np\n\nimport gflags as flags\n\nfrom rst_evaluation import const2rst, evaltrees, compare_disc_constituency\nfrom tree import Tree\n\nsys.setrecursionlimit(20000)\nFLAGS = fl... | [
[
"numpy.random.seed",
"numpy.random.random",
"numpy.random.shuffle"
]
] |
lahwran/dotfiles | [
"30792abedb5b8c96667650548650efabfb1b63fa"
] | [
"packages/at/at/__init__.py"
] | [
"#!/usr/bin/env python\n# python 2 only, adjust path (or port, I'd love you) as needed\n# run @ --help for (a little) more information\n# MIT licensed.\n\"\"\"\\\nprimarily a python eval command. auto-formats the result of your expression:\n(> indicates the line contains user input)\n\n > $ @ '1'\n 1\n > $ @ '... | [
[
"tensorflow.InteractiveSession"
]
] |
karst87/ml | [
"e201aaad2da22b07c89f41aefd9d2bf8102a67a1"
] | [
"01_openlibs/tensorflow/02_tfgirls/TensorFlow-and-DeepLearning-Tutorial-master/Season1/10-11/dp.py"
] | [
"# 为了 Python2 玩家们\nfrom __future__ import print_function, division\n\n# 第三方\nimport tensorflow as tf\nfrom sklearn.metrics import confusion_matrix\nimport numpy as np\n\n# 我们自己\nimport load\n\ntrain_samples, train_labels = load._train_samples, load._train_labels\ntest_samples, test_labels = load._test_samples, loa... | [
[
"sklearn.metrics.confusion_matrix",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.matmul",
"tensorflow.merge_all_summaries",
"tensorflow.histogram_summary",
"tensorflow.reshape",
"tensorflow.nn.softmax",
"tensorflow.train.GradientDescentOptimizer",
"numpy.add.r... |
XingguangZhang/ConvLSTM | [
"3b33f511211b6e87d12bd475e5bef4b084d179a7"
] | [
"extract_flow.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Apr 19 17:30:52 2019\r\nreference: https://blog.csdn.net/qq_32799915/article/details/85704240 \r\n@author: Xingguang Zhang\r\n\"\"\"\r\nimport os\r\nimport numpy as np\r\nimport cv2\r\n\r\ndef cal_for_frames(video_path):\r\n cap = cv2.VideoCapture(video_path)\... | [
[
"numpy.round"
]
] |
KshitijAggarwal/FRB | [
"3f732c6fa4fc79a5cfe69daf3cd88b51e6fb402b"
] | [
"frb/surveys/psrcat.py"
] | [
"\"\"\" PSRCat survey \"\"\"\n\nimport pdb\n\nimport numpy as np\n\nfrom astropy.table import Table\nfrom astropy.coordinates import SkyCoord\nfrom astropy import units\n\ntry:\n from pulsars import io as pio\nexcept ImportError:\n print(\"Warning: You need FRB/pulsars installed to use PSRCat\")\n\nfrom frb.... | [
[
"numpy.any"
]
] |
pagodag/steptest | [
"eb125fadb0911cce2a5e1af9b979e1391dbd8097"
] | [
"run_sample.py"
] | [
"# Copyright Yi-Si.Lu (luyisi1982@gmail.com)\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 by applicable law... | [
[
"pandas.ExcelFile"
]
] |
ELanning/SPIKERR | [
"24861efb5408b7dd0d7a691f02762ff2bbe5ef0f"
] | [
"tests/test_encode.py"
] | [
"import unittest\nimport torch as t\nfrom SPIKERR.encode import poisson_encode\n\narbitrary_seed = 333\nt.manual_seed(arbitrary_seed)\nt.backends.cudnn.deterministic = True\nt.backends.cudnn.benchmark = False\n\n\nclass TestEncode(unittest.TestCase):\n def test_poisson_encode(self):\n example = t.empty(3,... | [
[
"torch.manual_seed",
"torch.cat",
"torch.empty",
"torch.abs"
]
] |
mjsottile/pastoralscape | [
"e2ec11d0931b10824edcdef8bd4aa7beb4dee024"
] | [
"scripts/reporter.py"
] | [
"###########################################################################\n# MIT License\n#\n# Copyright (c) 2020 Matthew Sottile\n#\n# Permission is hereby granted, free of charge, to any person\n# obtaining a copy of this software and associated documentation files\n# (the \"Software\"), to deal in the Softwar... | [
[
"numpy.reshape",
"numpy.zeros",
"numpy.sum",
"numpy.mean",
"numpy.std",
"numpy.cumsum"
]
] |
SupratimH/learning-data-science | [
"005f2f87b01b36b53179d1c1641b8a6c876358e1"
] | [
"machine-learning/test_logisticRegression.py"
] | [
"\"\"\"\nCreated on Tue Sep 15 2018\n@author: Supratim Haldar\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom scipy import optimize\nfrom scipy.optimize import fmin_bfgs\nimport matplotlib.pyplot as pyplot\nimport logisticRegression\nimport time\nimport imageio\n\n# Load training data\ndef loadTrainingData... | [
[
"numpy.max",
"numpy.dot",
"numpy.zeros",
"numpy.set_printoptions",
"numpy.argmax",
"pandas.read_csv",
"scipy.optimize.minimize"
]
] |
renzokuken/ibis | [
"b82d327ebd0478c4ccdf2c9a40ee13ff50ed57b2"
] | [
"ibis/tests/all/test_temporal.py"
] | [
"import warnings\n\nimport numpy as np\nimport pandas as pd\nimport pandas.util.testing as tm\nimport pytest\nfrom pytest import param\n\nimport ibis\nimport ibis.expr.datatypes as dt\nfrom ibis.backends.pandas.execution.temporal import day_name\nfrom ibis.tests.backends import (\n BigQuery,\n Clickhouse,\n ... | [
[
"pandas.to_datetime",
"pandas.Timedelta",
"pandas.util.testing.assert_series_equal",
"pandas.Timestamp",
"pandas.Series",
"pandas.offsets.DateOffset"
]
] |
myousefi2016/slepc4py | [
"39e13c807a2ebe51b161d83ce62f8d0cddda4de0"
] | [
"demo/ex7.py"
] | [
"# ------------------------------------------------------------------------\n# Solve 1-D PDE\n# -u'' = lambda*u\n# on [0,1] subject to\n# u(0)=0, u'(1)=u(1)*lambda*kappa/(kappa-lambda)\n# ------------------------------------------------------------------------\n\nimport sys, slepc4py\nslep... | [
[
"numpy.sin",
"numpy.sqrt"
]
] |
indylab/xdo | [
"1ddd92aa56ba10fa468396de8f8824c83ba9d0ba",
"1ddd92aa56ba10fa468396de8f8824c83ba9d0ba"
] | [
"grl/envs/loss_game_alpha_multi_agent_env.py",
"grl/rl_apps/psro/poker_utils.py"
] | [
"import math\nfrom math import pi\nimport numpy as np\nfrom gym.spaces import Box, Discrete\nfrom ray.rllib.utils import merge_dicts\nfrom ray.rllib.env.multi_agent_env import MultiAgentEnv\n\n\ndef direction_to_coord(direction):\n \"\"\"takes x \\in [0,1), returns 2d coords on unit circle\"\"\"\n return tupl... | [
[
"numpy.array",
"numpy.asarray"
],
[
"numpy.max",
"numpy.zeros_like",
"numpy.isclose",
"numpy.isnan",
"numpy.asarray",
"numpy.zeros",
"numpy.copy",
"numpy.ones"
]
] |
TonkaTel/GPRPy | [
"7ccb4a4a62ca61a55b0afc42f14c04990024328f"
] | [
"gprpy/toolbox/splash.py"
] | [
"import gprpy.gprpy as gp\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.path as mpath\nimport matplotlib.patches as mpatches\nimport matplotlib.lines as mlines\nimport os\nimport matplotlib.image as im\nfrom scipy import signal\n\ndef showSplash(a,dir_path,widfac,highfac,fontfac):\n '''... | [
[
"matplotlib.lines.Line2D",
"matplotlib.path.Path",
"numpy.array",
"matplotlib.patches.PathPatch",
"scipy.signal.ricker",
"matplotlib.image.imread",
"matplotlib.patches.Ellipse",
"numpy.linspace"
]
] |
seansaito/Faster-LIME | [
"68cd0900858d9e087cf27ac67b1bf31d2fd02a36"
] | [
"faster_lime/explainers/base_tabular_explainer.py"
] | [
"\"\"\"\nBase class of the tabular explainer\n\"\"\"\n\nfrom abc import ABC, abstractmethod\n\nimport numpy as np\nfrom sklearn.preprocessing import StandardScaler\n\nfrom faster_lime.utils import dict_disc_to_bin\n\n\nclass BaseTabularExplainer(ABC):\n\n\n def __init__(self, training_data, feature_names=None,\n... | [
[
"numpy.bincount",
"numpy.percentile",
"sklearn.preprocessing.StandardScaler"
]
] |
panda5162/test | [
"963ee32b01b9d29a8ec7ef1d098e59352d51cb68"
] | [
"net/ssd_net.py"
] | [
"# Copyright 2018 Changan Wang\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to... | [
[
"tensorflow.zeros_initializer",
"tensorflow.multiply",
"tensorflow.nn.relu",
"tensorflow.glorot_uniform_initializer",
"tensorflow.maximum",
"tensorflow.TensorShape",
"tensorflow.Variable",
"tensorflow.reshape",
"tensorflow.variable_scope",
"tensorflow.name_scope",
"tens... |
guguguzi/Paddle | [
"482e5b6cd10171a54b5470cf288fce314d65480a"
] | [
"python/paddle/fluid/dygraph/varbase_patch_methods.py"
] | [
"# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.prod"
]
] |
Balandat/linear_operator | [
"34c1bc6a0bf4010d54243a4503fb24b9c3201b95"
] | [
"test/operators/test_added_diag_linear_operator.py"
] | [
"#!/usr/bin/env python3\n\nfrom __future__ import annotations\n\nimport unittest\n\nimport torch\n\nfrom linear_operator.operators import (\n AddedDiagLinearOperator,\n DenseLinearOperator,\n DiagLinearOperator,\n RootLinearOperator,\n)\nfrom linear_operator.test.linear_operator_test_case import LinearO... | [
[
"torch.diag_embed",
"torch.norm",
"torch.random.manual_seed",
"torch.tensor",
"torch.diag",
"torch.randn"
]
] |
puruBHU/SSD300_with_keras | [
"2aa9fa0b58bc1508d7d9c361b4ffb0f8af901ee9"
] | [
"train.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Aug 1 16:04:54 2019\n\n@author: Purnendu Mishra\n\"\"\"\n\nimport tensorflow as tf\n\n\nfrom keras.backend.tensorflow_backend import set_session\n##********************************************************\n## For GPU\n#\nconfig = tf.ConfigPro... | [
[
"tensorflow.ConfigProto",
"numpy.array",
"tensorflow.Session"
]
] |
sleepy-owl/pyPESTO | [
"a34608de9ad0a274afb6fb89ebc022aff5baf4c0"
] | [
"test/base/test_history.py"
] | [
"\"\"\"\nThis is for testing the pypesto.History.\n\"\"\"\n\nimport numpy as np\nimport pytest\nimport unittest\nimport tempfile\nfrom typing import Sequence\n\nimport pypesto\nfrom pypesto.objective.util import sres_to_schi2, res_to_chi2\nfrom pypesto import CsvHistory, HistoryOptions, MemoryHistory, ObjectiveBase... | [
[
"numpy.isnan",
"numpy.isclose",
"numpy.ones",
"numpy.random.randn",
"numpy.allclose",
"numpy.isfinite",
"numpy.all"
]
] |
usc-sail/FedML | [
"43b7ed38243b23afaf31ffb829e0566bf03db227",
"43b7ed38243b23afaf31ffb829e0566bf03db227"
] | [
"fedml_api/model/TILES/baseline_models.py",
"fedml_experiments/distributed/fedavg/main_fedavg.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@author: Tiantian\n\"\"\"\nfrom re import T\nimport pandas as pd\nimport torch\nimport torch.nn as nn\nimport math\nfrom torch.autograd import Variable\nfrom torch.nn import functional as F\nimport pdb\nimport logging\nfrom torch.nn.modules import dropout\ni... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Conv1d",
"torch.nn.init.xavier_uniform",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"torch.nn.MaxPool1d"
],
[
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.manual_seed_all"
]
] |
ADNRs/PyQR | [
"b8a1af6f16ce67bf3d963fedddbc24afe41a63d3"
] | [
"Tables/TableQuery.py"
] | [
"import numpy as np\n\nclass __TableQuery:\n def __init__(self):\n read_file = lambda file_name: np.genfromtxt(file_name, dtype=str, delimiter=',', skip_header=1)\n self.character_capacity = read_file('./tables/CharacterCapacity.txt')\n self.codeword_info = read_file('./tables/CodewordInfo.t... | [
[
"numpy.genfromtxt"
]
] |
anastasia-zhukova/ANEA | [
"9bfd61cbcc0b7999a9e94373fd7844952347587d"
] | [
"evaluation/voting_dataset_construction.py"
] | [
"import pandas as pd\nimport json\nimport re\nimport numpy as np\nimport pickle\nfrom config import *\n\n\ndef count_datasets(date: str):\n if date not in os.listdir(EXCEL_PATH):\n raise(\"No folder \" + date + \" in the \" + EXCEL_PATH + \". No eval results calculated.\")\n\n # get res json\n f = N... | [
[
"pandas.DataFrame",
"numpy.mean",
"numpy.sum",
"numpy.unique"
]
] |
jiangyangby/DM2C | [
"72230ba6ba03d0233df3d3ea242fac61657122f2"
] | [
"code/model.py"
] | [
"# python3 train.py --lr_g 1e-4 --lr_d 5e-5 --gan_type wasserstein --n_epochs 250 --weight_decay 1e-4 --lamda3 0.5 --lamda1 1\n# python3 train.py --lr_g 1e-4 --lr_d 5e-5 --gan_type wasserstein --n_epochs 250 --weight_decay 0 --lamda3 0.5 --lamda1 1 --lr_c 5e-4\nfrom __future__ import print_function, absolute_import... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.optim.RMSprop",
"torch.nn.Sequential",
"torch.nn.functional.l1_loss",
"torch.save",
"torch.nn.LeakyReLU",
"torch.optim.Adam",
"torch.no_grad",
"torch.ones",
"torch.nn.functional.mse_loss",
"torch.nn.BatchNorm... |
jzhao23/Adversarially-Learned-Anomaly-Detection | [
"d01ce7fb15265d36de7550c92dbacbbb071fb9d2"
] | [
"data/cifar10.py"
] | [
"# CIFAR10 Downloader\n\nimport logging\nimport pickle\nimport math\nimport os\nimport errno\nimport tarfile\nimport shutil\nimport numpy as np\nimport urllib3\nfrom sklearn.model_selection import train_test_split\nfrom utils.adapt_data import adapt_labels_outlier_task\n\nlogger = logging.getLogger(__name__)\n\ndef... | [
[
"numpy.concatenate",
"numpy.array",
"sklearn.model_selection.train_test_split"
]
] |
alainjungo/reliability-challenges-uncertainty | [
"21e86f6e2a5d2520b5767dce48bbcf2b11773788"
] | [
"bin-dl/isic_test_aleatoric.py"
] | [
"import os\nimport argparse\nimport logging\n\nimport torch.nn.functional as F\nimport numpy as np\nimport pymia.data.assembler as assembler\nimport SimpleITK as sitk\n\nimport common.trainloop.data as data\nimport common.evalutation.eval as ev\nimport common.trainloop.steps as step\nimport common.trainloop.context... | [
[
"numpy.argmax",
"torch.nn.functional.softmax"
]
] |
joker-eph/mlir-npcomp | [
"91fc83d2e78fcbc05ac24876790b82ad68189e68"
] | [
"frontends/pytorch/python/torch_mlir_utils/codegen/aten_ops.py"
] | [
"# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n# See https://llvm.org/LICENSE.txt for license information.\n# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n\"\"\"Populates an op registry for ATen ops.\n\nTypically callers will import and use the 'populate' function t... | [
[
"torch.Size",
"torch.tensor"
]
] |
Honghe/wenet | [
"4421790bec3778df591816d69f0449930a9be321"
] | [
"wenet/transformer/encoder.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Copyright 2019 Mobvoi Inc. All Rights Reserved.\n# Author: di.wu@mobvoi.com (DI WU)\n\"\"\"Encoder definition.\"\"\"\nfrom typing import Tuple, List, Optional\n\nimport torch\nfrom typeguard import check_argument_types\n\nfrom wenet.transformer.attention import ... | [
[
"torch.cat",
"torch.nn.LayerNorm"
]
] |
ritchie46/clickstream | [
"79c669d0636521db2697e5fa583628d1920cc6c1"
] | [
"sequence/test/test_utils.py"
] | [
"from torch.utils.data import DataLoader\nfrom sequence.data.datasets import brown\nfrom sequence.data.utils import DatasetInference, Tokens, Language\nfrom sequence.test import language, words, dataset, paths\nimport pytest\nimport numpy as np\nimport random\n\n\ndef test_dataset_torch_compatible(dataset):\n dl... | [
[
"numpy.random.seed",
"numpy.random.rand",
"torch.utils.data.DataLoader",
"numpy.random.shuffle"
]
] |
cindyxinyiwang/multiDDS | [
"7ceab0b5e4ae8a71a94ed6cc95cc98ec2bf90994"
] | [
"train.py"
] | [
"#!/usr/bin/env python3 -u\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\"\"\"\nTrain a new model on one or across multiple GPUs.\n\"\"\"\n\nimport collections\nimport math\nimpor... | [
[
"numpy.random.seed",
"torch.multiprocessing.spawn",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.cuda.is_available"
]
] |
arteagac/pymlogit | [
"ba41c54f14ae4a2b03b744785a3cae3623dc07cb",
"ba41c54f14ae4a2b03b744785a3cae3623dc07cb"
] | [
"tests/estimations.py",
"examples/benchmark/many_draws_benchmark.py"
] | [
"import numpy as np\nimport pandas as pd\nimport sys\nsys.path.append(\".\") # Path of xlogit library root folder.\n\nfrom xlogit import MixedLogit, MultinomialLogit\n\n\nprint(\"\"\"\n**EXPECTED:\nMultinomialLogit\nconvergence=True LL=-4958.6491193376105 electricity\nconvergence=True LL=-1311.9796171079972 fishin... | [
[
"pandas.read_csv"
],
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.rcParams.update",
"matplotlib.pyplot.ylabel"... |
kumarjay/DVC_pract02 | [
"ed7c7cee8e20f776633916b532bb7224d0abf8e0"
] | [
"src/evaluate/evaluate.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn.metrics import confusion_matrix, f1_score\nfrom sklearn.base import BaseEstimator\nfrom typing import Text, Tuple\n\n\ndef evaluate(df= pd.DataFrame, target_column= Text, clf= BaseEstimator) -> Tuple[float, np.ndarray]:\n y_test = df.loc[:, 'target'].values.... | [
[
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.f1_score"
]
] |
skojaku/core-periphery-detection | [
"5d590bdcb445133ae79771994c3d3c9820e59644"
] | [
"cpnet/Surprise.py"
] | [
"import numba\nimport numpy as np\nimport scipy as sp\n\nfrom . import utils\nfrom .CPAlgorithm import CPAlgorithm\n\n\nclass Surprise(CPAlgorithm):\n \"\"\"Core-periphery detection by Surprise.\n\n J. van Lidth de Jeude, G. Caldarelli, T. Squartini. Detecting Core-Periphery Structures by Surprise. EPL, 125, ... | [
[
"numpy.random.rand",
"numpy.random.choice",
"numpy.log",
"numpy.zeros",
"numpy.minimum",
"numpy.sum",
"numpy.nonzero",
"numpy.multiply",
"numpy.argsort"
]
] |
witheunjin/dlrm | [
"4d4fb9c0968e26646d5a13bbb525415c92d2929a"
] | [
"dlrm_s_pytorch.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#\n# Description: an implementation of a deep learning recommendation model (DLRM)\n# The model input consists of dense and sparse fea... | [
[
"torch.cat",
"torch.nn.ParameterList",
"torch.nn.EmbeddingBag",
"torch.nn.ModuleList",
"numpy.set_printoptions",
"torch.nn.parallel.scatter_gather.scatter",
"torch.ones",
"torch._ops.ops.quantized.embedding_bag_byte_prepack",
"torch.set_printoptions",
"torch.cuda.is_availab... |
manijhariya/SpokenDigitRecognizer | [
"254b4aa7fb48f85e83d7c95fb388c0dedda0a392"
] | [
"Images_To_CSV.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nimport re\nimport os\n\ndef load_image(location,flatten=True):\n\timg = None\n\ttry:\n\t\timg = Image.open(location).convert('RGB')\n\t\timg = img.resize((64,64))\n\t\timg = np.asarray(img,dtype=np.int)\n\t\t#plt.imsh... | [
[
"numpy.asarray",
"numpy.save",
"numpy.append"
]
] |
zrxbeijing/NewsTrader | [
"06818f2891bc17f419743d0a4089b5935e74b6ac"
] | [
"NewsTrader/tickerfinder/find_isin.py"
] | [
"import requests\nimport pandas as pd\nimport urllib.parse\nimport time\nimport bs4\n\n\nHEADERS = {\n \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36\"\n}\n\n\n# base url for search companies (finanzen.net)\n# note: this ... | [
[
"pandas.Series"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.