repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
krylea/Graphormer | [
"2e48f3fb52d25d505d0950f74a6016c5f9967c13"
] | [
"examples/customized_dataset/customized_dataset.py"
] | [
"from graphormer.data import register_dataset\nfrom dgl.data import QM9\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\n\n@register_dataset(\"customized_qm9_dataset\")\ndef create_customized_dataset():\n dataset = QM9(label_keys=[\"mu\"])\n num_graphs = len(dataset)\n\n # customi... | [
[
"sklearn.model_selection.train_test_split",
"numpy.arange"
]
] |
pavelkomarov/projection-pursuit-regression | [
"307ad765d447e81dce909dfa9778db1610704315"
] | [
"examples/plot_transformer.py"
] | [
"\"\"\" Plotting the Projection Pursuit Transformation\n\nThis example creates dummy data in three dimensions and a target one-dimensional\nY, fit_transforms the X data with respect to the Y data by finding the best\nalpha (and other) projection vectors such that the output can be reconstructed\nand then returning ... | [
[
"numpy.zeros",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.random.uniform",
"numpy.arange",
"matplotlib.pyplot.show"
]
] |
florian-wagner/pyvista | [
"ba858ec142d267c5f635a642af4fa37c9a7d9af7"
] | [
"examples/00-load/create-unstructured-surface.py"
] | [
"\"\"\"\n.. _ref_create_unstructured:\n\nCreating an Unstructured Surface\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCreate an irregular, unstructured grid from NumPy arrays\n\"\"\"\n\nimport pyvista as pv\nimport vtk\nimport numpy as np\n\n################################################################################\... | [
[
"numpy.array",
"numpy.vstack"
]
] |
sjforeman/halomod | [
"587db6bc71a77ea60a541b306fc3601eeb424bc9",
"587db6bc71a77ea60a541b306fc3601eeb424bc9"
] | [
"tests/test_blake.py",
"tests/test_wdm.py"
] | [
"\"\"\"\nTest a specific model against data provided by Chris Blake from his own halo modelling\ncode, used in Blake+08 (modelling of SDSS sources).\n\"\"\"\nimport numpy as np\nimport pytest\nfrom halomod import TracerHaloModel\nfrom halomod.hod import Zehavi05\nfrom scipy.interpolate import InterpolatedUnivariate... | [
[
"numpy.allclose",
"numpy.genfromtxt",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.log"
],
[
"numpy.all"
]
] |
karthkk/jax | [
"1090e89a86147a5ce326db68149677027b9bb0ef"
] | [
"jax/lax/lax_parallel.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 ... | [
[
"numpy.delete",
"numpy.less",
"numpy.less_equal",
"numpy.prod",
"numpy.insert"
]
] |
SivaMaplelabs/pdftabextract | [
"1139d7e9fa49d06efcd3a179185c67a6f3def0aa"
] | [
"pdftabextract/common.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCommon functions used in all modules of pdftabextract.\n\nCreated on Tue Jun 7 10:49:35 2016\n\n@author: mkonrad\n\"\"\"\n\n\nimport xml.etree.ElementTree as ET\nfrom collections import OrderedDict\nimport json\nimport struct\nimport imghdr\n\nimport numpy as np\n\nfrom .geom impo... | [
[
"numpy.array",
"numpy.add",
"numpy.minimum",
"numpy.arange",
"numpy.argmax",
"numpy.unique"
]
] |
jg8610/jack | [
"5d904771d608c7bdb59cded0854fb47a49aba880"
] | [
"jack/core/torch.py"
] | [
"import logging\nimport sys\nfrom abc import abstractmethod\nfrom typing import Mapping, List, Iterable, Tuple\n\nimport numpy as np\nimport torch\nfrom torch import nn\n\nfrom jack.core import ModelModule, SharedResources, TensorPort\nfrom jack.core import reader\nfrom jack.core.data_structures import Answer\nfrom... | [
[
"torch.load",
"torch.cuda.device_count"
]
] |
KnowledgeCluster/metrabs | [
"c43a57abe2eb745625f87ff8efeae1bcd23ffade"
] | [
"demo.py"
] | [
"#!/usr/bin/env python3\nimport os\n\nimport tensorflow as tf\n\n\ndef main():\n model = tf.saved_model.load(download_model('metrabs_eff2l_y4'))\n image = tf.image.decode_jpeg(tf.io.read_file('img/test_image_3dpw.jpg'))\n skeleton = 'smpl_24'\n\n pred = model.detect_poses(image, default_fov_degrees=55, ... | [
[
"matplotlib.pyplot.switch_backend",
"tensorflow.keras.utils.get_file",
"tensorflow.io.read_file",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.patches.Rectangle"
]
] |
wowwh/SI664-scripts | [
"7181b8184dd2cbdb6f7bcb80a851f17a81a0b547"
] | [
"scripts/inspect_un_data_sets.py"
] | [
"import logging\nimport os\nimport pandas as pd\nimport sys as sys\n\n\ndef main(argv=None):\n\t\"\"\"\n\tUtilize Pandas library to read in both UNSD M49 country and area .csv file\n\t(tab delimited) as well as the UNESCO heritage site .csv file (tab delimited).\n\tExtract regions, sub-regions, intermediate regions... | [
[
"pandas.read_csv"
]
] |
lite-david/espalier | [
"d98a5946d8271820c499c7f5a1bcd66dc99cee7f"
] | [
"util.py"
] | [
"import _pickle as pickle\nimport numpy as np\nimport os\nfrom scipy.misc import imread\n\n\ndef to_categorical(y, nb_classes=None):\n \"\"\"Converts a class vector (integers) to binary class matrix.\n E.g. for use with categorical_crossentropy.\n # Arguments\n y: class vector to be converted into a... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"scipy.misc.imread",
"numpy.arange"
]
] |
mjul/tensorflow-probability | [
"c733f06bccceb983f3e9db8e6e3c98b3bd4d23c9"
] | [
"tensorflow_probability/python/mcmc/transformed_kernel_test.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.squared_difference",
"numpy.linalg.cholesky",
"tensorflow.compat.v2.matmul",
"numpy.log",
"tensorflow.compat.v2.executing_eagerly",
"tensorflow.compat.v2.random.set_seed",
"tensorflow.compat.v2.compat.dimension_value",
"tensorflow.compat.v2.function",
... |
petrelharp/pyslim | [
"02513d9a95ce469c409cf58ffd68d7dc2c315814"
] | [
"pyslim/slim_tree_sequence.py"
] | [
"import attr\nimport struct\nimport msprime\nimport tskit\nimport kastore\nimport json\nfrom collections import OrderedDict\nimport warnings\nimport numpy as np\n\nfrom ._version import *\nfrom .slim_metadata import *\nfrom .provenance import *\nfrom .util import *\nfrom .slim_metadata import _decode_mutation_pre_n... | [
[
"numpy.bincount",
"numpy.zeros",
"numpy.logical_and",
"numpy.where",
"numpy.argmax",
"numpy.repeat",
"numpy.int32"
]
] |
zoumt1633/label-studio | [
"324d542b49b42cac5c9a3e23373b9febaf9a426e"
] | [
"label_studio/utils/uploader.py"
] | [
"# Import tasks from json, csv, zip, txt and more\n\nimport os\nimport csv\nimport hashlib\nimport shutil\nimport zipfile\nimport rarfile\nimport logging\nimport tempfile\nimport pandas as pd\ntry:\n import ujson as json\nexcept:\n import json\n\nfrom os.path import join\nfrom urllib.request import urlopen\n\... | [
[
"pandas.read_csv"
]
] |
HazyResearch/anchor-stability | [
"0d5d333a23ebc01f1ff139cc751b471b3934b679"
] | [
"notebooks/plot_utils.py"
] | [
"import matplotlib\nimport matplotlib.pyplot as plt\nimport pandas \n\nmarkers = ['s', 'v', '^', '<', '>', 'o']\n\ndef plt_single(df, vals, val_tag, xtag, dist, ylog=False, ylabel='', xlabel='', title='', val_tag_label='', legend=False, color='C4', marker='s', line_label=None):\n if val_tag_label == '':\n ... | [
[
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.py... |
m-tian/msaf-copy | [
"614bba6686fd0abf3c5866b92d78fccf5186b6a3"
] | [
"msaf/pymf/cnmf.py"
] | [
"#!/usr/bin/python\n#\n# Copyright (C) Christian Thurau, 2010. \n# Licensed under the GNU General Public License (GPL). \n# http://www.gnu.org/licenses/gpl.txt\n\"\"\" \nPyMF Convex Matrix Factorization [1]\n\n CNMF(NMF) : Class for convex matrix factorization\n \n[1] Ding, C., Li, T. and Jordan, M.. Con... | [
[
"numpy.dot",
"numpy.reshape",
"numpy.zeros",
"numpy.ones",
"numpy.where",
"numpy.sqrt",
"numpy.abs"
]
] |
qqsg06/python-exercise | [
"01b2886f439387808d2f1a30c18648985edffd45"
] | [
"15.data visualization/rw_visual.py"
] | [
"import matplotlib.pyplot as plt \nfrom random_walk import RandomWalk\n\n#多次随机漫步\nwhile True:\n #创建一个RandomWalk实例,并将其包含的点都绘制出来\n rw = RandomWalk(100000)\n rw.fill_walk()\n\n #设置绘图窗口尺寸,dpi指定分辨率\n plt.figure(dpi=128, figsize=(6, 4))\n\n point_numbers = list(range(rw.num_points))\n plt.scatter(rw.... | [
[
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.figure"
]
] |
Xietutu22/Raspibot | [
"6efb9387bd270644f8ed92f3779908d9b88f1a68"
] | [
"faceRecog.py"
] | [
"# coding = utf-8\nimport face_recognition\nimport numpy as np\nimport cv2\nimport multiProcess\nimport time\nimport sys\nimport RPi.GPIO as GPIO\nimport sendEmail\n\necodinglist = list(np.load('resources/ecodinglist.npy'))\nnamelist = list(np.load('resources/namelist.npy'))\nx0, y0 = 80, 30\n\ndef setServoAngle(se... | [
[
"numpy.load",
"numpy.save"
]
] |
babaMar/soundfactory | [
"0a6ee7260af1785ba72b1b282e2aa0f7b15e6fd0"
] | [
"soundfactory/settings/signal.py"
] | [
"import numpy as np\n\nalternate_minus_odd = lambda x: (-1.0) ** ((x.astype(complex) - 1) / 2)\n\nreal_part_or_zero_otherwise = lambda x: np.where(np.isreal(x), x, 0).real\n\n\nB_N_COEFF_MAP = {\n \"sine\": lambda x: np.where(x == 1, 1.0, 0),\n \"sawtooth\": lambda x: -2.0 / (np.pi * x),\n \"square\": lamb... | [
[
"numpy.where",
"numpy.isreal"
]
] |
rllab-snu/Trust-Region-CVaR | [
"6b97655117f49d045b9e811dc444b685c097f2ae"
] | [
"utils/env.py"
] | [
"import numpy as np\nimport safety_gym\nimport gym\nimport re\n\nclass GymEnv(gym.Env):\n def __init__(self, env_name, seed, max_episode_length, action_repeat):\n self.env_name = env_name\n self._env = gym.make(env_name)\n self._env.seed(seed)\n _, self.robot_name, self.task_name = re... | [
[
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.ones",
"numpy.exp",
"numpy.clip"
]
] |
binste/pipecutter | [
"18cac9340ea9f192e524b8a1b8f351cba972d45b"
] | [
"pipecutter/targets.py"
] | [
"import pickle\nfrom abc import ABC, abstractmethod, abstractproperty\nfrom pathlib import Path\nfrom typing import Optional, Union, Dict\n\nimport joblib\nimport luigi.format\nimport pandas as pd\nimport luigi.task\nfrom luigi import LocalTarget\n\n\nclass TargetBase(LocalTarget, ABC):\n @abstractproperty\n ... | [
[
"pandas.read_parquet"
]
] |
telenz/QCHS-2018 | [
"54bf34496adbb96f32e2975c46cf3f8abd7b262d"
] | [
"Modules/ML_Tools_QCHS_Ver/General/Ensemble_Functions.py"
] | [
"from __future__ import division\nimport numpy as np\nimport pandas\nimport math\nimport json\nimport os\nimport types\nfrom six.moves import cPickle as pickle\nimport glob\n\nfrom keras.models import Model, model_from_json, load_model\n\n#from rep.estimators import XGBoostClassifier\n\nfrom sklearn.metrics import ... | [
[
"numpy.array",
"sklearn.metrics.roc_auc_score"
]
] |
Marcnuth/aiflow | [
"6fb6b2d6eca35766debdc1c177fd8cadcced61df"
] | [
"aiflow/operators/text_classification_operator.py"
] | [
"from airflow.models import BaseOperator\nfrom pathlib import Path\nimport json\nfrom bson import json_util\nfrom aiflow.units.doc2mat_unit import Doc2MatUnit\nimport logging\nimport pandas as pd\nimport numpy as np\nimport shutil\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass TextClassificationDataBuildOpera... | [
[
"pandas.read_csv",
"pandas.isna",
"pandas.get_dummies"
]
] |
alexpieper/Youtube-API-Livestream-stats | [
"8da021d5e650b9bde2f0b56bf510b822d55c95bb"
] | [
"analysis.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt\n\ndef main():\n # read the data\n df = pd.read_csv(\"export.csv\", index_col = 0)\n df = df.drop(\"2021-06-03 21:51:13\", axis = 0)\n \n df.index = pd.DatetimeIndex(df.index)\n print(\"Correlation Analysis:\")\n print(df.corr())\n print(... | [
[
"matplotlib.pyplot.show",
"pandas.read_csv",
"pandas.DatetimeIndex",
"matplotlib.pyplot.subplots"
]
] |
pelikan/Halide | [
"17d8947fd99f867a24df904c8153c31ea75c537a"
] | [
"python_bindings/apps/local_laplacian.py"
] | [
"\"\"\"\nLocal Laplacian, see e.g. Aubry et al 2011, \"Fast and Robust Pyramid-based Image Processing\".\n\"\"\"\n\n\nimport halide as hl\n\nimport numpy as np\nimport imageio\nimport os.path\n\n\nint_t = hl.Int(32)\nfloat_t = hl.Float(32)\n\ndef get_local_laplacian(input, levels, alpha, beta, J=8):\n downsample... | [
[
"numpy.empty"
]
] |
mayankiitg/a-PyTorch-Tutorial-to-Image-Captioning | [
"13b2ea499b1ad11d308640df82f1502ddde0e6f6"
] | [
"train.py"
] | [
"import time\nimport torch.backends.cudnn as cudnn\nimport torch.optim\nimport torch.utils.data\nimport torchvision.transforms as transforms\nfrom torch import nn\nfrom torch.nn.utils.rnn import pack_padded_sequence\nfrom models import Encoder, DecoderWithAttention\nfrom datasets import *\nfrom utils import *\nfrom... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.utils.rnn.pack_padded_sequence"
]
] |
himringil/multidimensional-aggregation | [
"e3d0728afa3117f6254226899dc909dc07e2f793"
] | [
"tests/test2.py"
] | [
"import pandas as pd\nfrom os import walk\nfrom os.path import join\nfrom datetime import datetime, timedelta\n\nimport agg, agg0, agg1, agg2, agg3\n\ndef aggregate(tree, data_path):\n \n for (_, _, filenames) in walk(data_path):\n for filename in sorted(filenames):\n if filename.endswith('.... | [
[
"pandas.read_parquet"
]
] |
Cerenia/DC_Topos | [
"d9cd13af1e7efb768bbfc94665e8fc9a263383ca"
] | [
"Code/Topologies/util.py"
] | [
"import numpy as np\nimport networkx as nx\n\n##### #####\n#### ####\n### Visualisation ###\n#### ####\n##### #####\n\ndef gen_nodes(*switches):\n \"\"\"Creates a networkx DiGraph object and adds the nr. of nodes defined by the sum of the values in ... | [
[
"numpy.arange",
"numpy.zeros"
]
] |
kartheekmedathati/FeatureLearningRotNet | [
"61c77a7e5d1df0470738e92d94ad06d98ebafaa6"
] | [
"algorithms/ClassificationModel.py"
] | [
"from __future__ import print_function\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.optim\nimport os\nimport torchnet as tnt\nimport utils\nimport PIL\nimport pickle\nfrom tqdm import tqdm\nimport time\n\nfrom . import Algorithm\nfrom pdb import set_trace as bre... | [
[
"numpy.random.seed",
"torch.autograd.Variable",
"torch.FloatTensor",
"numpy.random.randint",
"torch.LongTensor"
]
] |
anshula2/autokeras | [
"9b73d55ee4b328883e0a2b0eb6809fb4941f8451"
] | [
"autokeras/engine/head.py"
] | [
"# Copyright 2020 The AutoKeras 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 applicable law... | [
[
"tensorflow.keras.losses.deserialize",
"tensorflow.keras.metrics.deserialize",
"tensorflow.keras.losses.serialize",
"tensorflow.keras.metrics.serialize"
]
] |
IDmy/deep-learning-models | [
"ab8777258aa2023f203b9292355949ba8965c198"
] | [
"NLP/machine translation/NMT_model_with_attention.py"
] | [
"from keras.layers import Bidirectional, Concatenate, Permute, Dot, Input, LSTM, Multiply\nfrom keras.layers import RepeatVector, Dense, Activation, Lambda\nfrom keras.optimizers import Adam\nfrom keras.utils import to_categorical\nfrom keras.models import load_model, Model\nimport keras.backend as K\nimport numpy ... | [
[
"numpy.argmax",
"numpy.zeros"
]
] |
rongliang-tech/alpha-mind | [
"66d839affb5d81d31d5cac7e5e224278e3f99a8b"
] | [
"alphamind/tests/execution/test_pipeline.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 2017-9-25\n\n@author: cheng.li\n\"\"\"\n\nimport unittest\nfrom collections import deque\n\nimport numpy as np\nimport pandas as pd\n\nfrom alphamind.execution.pipeline import ExecutionPipeline\nfrom alphamind.execution.targetvolexecutor import TargetVolExecutor\nfrom al... | [
[
"numpy.concatenate",
"pandas.DataFrame",
"numpy.random.randint",
"numpy.random.randn"
]
] |
adamviola/pytorch-lightning | [
"9826de21625b162dfef43f30864b5a6d9efab003"
] | [
"tests/plugins/test_tpu_spawn.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.device"
]
] |
juliecious/sinGAN_reload | [
"f67b651fef308d7c3e81cc34c64dd8cf5f2748f3"
] | [
"src/singan.py"
] | [
"\"\"\"SinGAN network\"\"\"\nimport torch\nimport torch.nn as nn\nfrom skimage import io\nimport numpy as np\nfrom src.architecture import Generator, Discriminator\nfrom src.image import pyramid, load_img, plot_pyr, get_pyr_shapes, gaussian_smoothing\nfrom skimage.color import rgb2lab, lab2rgb\nimport src.util as u... | [
[
"torch.zeros",
"numpy.array",
"torch.nn.MSELoss",
"numpy.log",
"numpy.round",
"torch.nn.functional.interpolate",
"torch.randn",
"torch.tensor",
"torch.nn.ZeroPad2d",
"torch.as_tensor",
"torch.mean"
]
] |
busyyang/torch_ecg | [
"031d90a32b8a1e202364efe1e5a19a9ba1f0a726",
"031d90a32b8a1e202364efe1e5a19a9ba1f0a726"
] | [
"references/cpsc2019/CPSC0433_2nd_qrs9155_hr9429/cpsc2019_score.py",
"torch_ecg/train/train_seq_lab_net_cpsc2019/dataset.py"
] | [
"from CPSC2019_challenge import CPSC2019_challenge\nimport numpy as np\nimport math\nnp.set_printoptions(threshold=np.inf)\nimport numpy as np\nimport tensorflow as tf\nnp.set_printoptions(threshold=np.inf)\nimport os\nimport re\nfrom scipy import io\nfrom keras.models import Model, load_model\nimport numpy as np\n... | [
[
"numpy.set_printoptions",
"numpy.sum",
"scipy.io.loadmat",
"numpy.diff",
"numpy.where",
"numpy.abs"
],
[
"numpy.max",
"numpy.zeros",
"numpy.set_printoptions",
"torch.set_default_tensor_type",
"numpy.min",
"numpy.mean",
"numpy.std"
]
] |
richardliaw/scalable_agent | [
"d24bd74bd53d454b7222b7f0bea57a358e4ca33e"
] | [
"dynamic_batching_test.py"
] | [
"# Copyright 2018 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.train.start_queue_runners",
"tensorflow.shape",
"tensorflow.train.Coordinator",
"tensorflow.group",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.fill",
"tensorflow.ones",
"tensorflow.constant",
"tensorflow.test.main",
"tensorflow.tile"
]
] |
bonnland/xarray | [
"d58a5114ccc8656e83d8a31eebf720548f004f86"
] | [
"xarray/tests/test_dask.py"
] | [
"import operator\nimport pickle\nimport sys\nfrom contextlib import suppress\nfrom distutils.version import LooseVersion\nfrom textwrap import dedent\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport xarray as xr\nimport xarray.ufuncs as xu\nfrom xarray import DataArray, Dataset, Variable\nfrom xa... | [
[
"numpy.array",
"numpy.sin",
"pandas.Index",
"numpy.random.RandomState",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.random.randn",
"pandas.MultiIndex.from_arrays",
"numpy.arange",
"numpy.maximum"
]
] |
google-ar/chromium | [
"2441c86a5fd975f09a6c30cddb57dfb7fc239699"
] | [
"tools/android/appstats.py"
] | [
"#!/usr/bin/python\n# Copyright 2015 The Chromium Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n\n# 'top'-like memory/network polling for Android apps.\n\nimport argparse\nimport curses\nimport os\nimport re\nimport sys\nimport... | [
[
"matplotlib.backends.backend_pdf.PdfPages",
"matplotlib.pyplot.figure"
]
] |
renmada/PaddleRec | [
"89f532f2cb68407e2710e1b4c2438b0057fcd1eb"
] | [
"models/recall/mhcn/net.py"
] | [
"# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"scipy.sparse.coo_matrix",
"numpy.array"
]
] |
remi-adam/minot | [
"1b2d0f2780dec922adfb7f411d2f821f4cd9ad1a"
] | [
"minot/model_modpar.py"
] | [
"\"\"\"\nThis file deals with 'model parameters' issues regarding the Cluster Class (e.g. GNFW parameteres)\n\"\"\"\nimport astropy.units as u\nimport numpy as np\nfrom scipy import interpolate\nimport warnings\n\nfrom minot.ClusterTools import cluster_global\nfrom minot.ClusterTools import cluster_profile\nfrom mi... | [
[
"scipy.interpolate.interp1d",
"numpy.isnan",
"numpy.exp",
"numpy.amax",
"numpy.amin",
"numpy.log10",
"numpy.gradient"
]
] |
chenyaofo/image-classification-codebase | [
"30344fd0aa31340edd49b33ec239304edb12069a"
] | [
"codebase/engine.py"
] | [
"import functools\nimport logging\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data as data\nfrom torch.cuda.amp import autocast, GradScaler\n\nfrom codebase.torchutils.distributed import world_size\nfrom codebase.torchutils.metrics import AccuracyMetric, AverageMetric, Es... | [
[
"torch.cuda.amp.GradScaler",
"torch.cuda.amp.autocast",
"torch.set_grad_enabled"
]
] |
ruoxinx/PPE-Detection-Pose | [
"0a79d1519f227a528437e80d05103ba72428f3f5"
] | [
"nets/frcnn_training.py"
] | [
"from keras.applications.imagenet_utils import preprocess_input\nfrom keras import backend as K\nimport keras\nimport tensorflow as tf\nimport numpy as np\nfrom random import shuffle\nimport random\nfrom PIL import Image\nfrom keras.objectives import categorical_crossentropy\nfrom utils.frcnn_anchors import get_anc... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.reshape",
"tensorflow.gather_nd",
"numpy.shape",
"numpy.random.shuffle",
"numpy.logical_and",
"numpy.expand_dims"
]
] |
inzamamulDU/log-anomaly-detection | [
"93846fc3bb5fc2414a2fc08c381d7b21e8fb0a3b"
] | [
"deepgravewell/dns-query-log/Drain.py"
] | [
"import regex as re\nimport os\nimport numpy as np\nimport pandas as pd\nimport hashlib\nfrom datetime import datetime\n\n\nclass Logcluster:\n def __init__(self, logTemplate='', logIDL=None):\n self.logTemplate = logTemplate\n if logIDL is None:\n logIDL = []\n self.logIDL = logI... | [
[
"pandas.DataFrame"
]
] |
esqu1/audio | [
"1def3fa99867e45728c908e2ca557eb02681aad1"
] | [
"examples/pipeline_wavernn/main.py"
] | [
"import argparse\nimport logging\nimport os\nimport signal\nfrom collections import defaultdict\nfrom datetime import datetime\nfrom time import time\nfrom typing import List\n\nimport torch\nimport torchaudio\nfrom torch import nn as nn\nfrom torch.optim import Adam\nfrom torch.utils.data import DataLoader\nfrom t... | [
[
"torch.no_grad",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"torch.jit.script",
"torch.nn.DataParallel"
]
] |
L28071512/LdG-sim | [
"ecdcfbffb4db83fb86b3a7f0ae338024cc866cc2"
] | [
"ldgsim/param.py"
] | [
"import numpy as np\n\n\"\"\" path \"\"\"\npath = '../data/result.txt'\n\n\"\"\" spatial parameters \"\"\"\ndr = 300\t\t\t# spatial resolution (300 nm per grid)\nx_real = 8000\ny_real = 8000\nz_real = 5000\nr_real = 2000 # radius (nm) of shpere (i.e. origin of meshgrid)\n\n\"\"\" temporal parameters \"\"\"\nd... | [
[
"numpy.arange"
]
] |
N0rbi/dice-face-value-classifier | [
"b2080932da60e4106c492522ddd378eebc7955ee"
] | [
"change_perspective.py"
] | [
"import numpy as np\nimport skimage\nfrom skimage import color\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport cv2\nfrom skimage import morphology\nfrom skimage import feature\n\n\ndef change_perspective(image):\n orig = image\n image = color.rgb2gray(image)\n image = skimage.morphology.dilatio... | [
[
"numpy.where",
"numpy.float32",
"numpy.linalg.norm"
]
] |
Accioy/keras-retinanet | [
"01dce4547f78588185fa6a138c45279609bfa1c9"
] | [
"tests/utils/test_anchors.py"
] | [
"import numpy as np\nimport configparser\nimport tensorflow as tf\n\nfrom keras_retinanet.utils.anchors import anchors_for_shape, AnchorParameters\nfrom keras_retinanet.utils.config import read_config_file, parse_anchor_parameters\n\n\ndef test_config_read():\n config = read_config_file('tests/test-data/config/c... | [
[
"tensorflow.keras.backend.floatx",
"numpy.sqrt",
"numpy.testing.assert_equal"
]
] |
rriyaldhi/volksdep | [
"572c7fde96d12964709065510df03a5e9d29979c"
] | [
"volksdep/converters/base.py"
] | [
"# adapted from torch2trt\n\nimport re\n\nimport torch\nimport torch.nn as nn\nimport tensorrt as trt\n\nfrom .. import utils\n\n\n__all__ = ['TRTModel', 'load', 'save']\n\n\ndef torch_dtype_from_trt(dtype):\n if dtype == trt.int8:\n return torch.int8\n elif trt.__version__ >= '7.0' and dtype == trt.bo... | [
[
"torch.cuda.current_stream",
"torch.device",
"torch.empty"
]
] |
felipeelorrieta/Datos-COVID19 | [
"b9e90cd9a8eca149f96e8b256b2fd7cd3dde74a4"
] | [
"src/informeEpidemiologico.py"
] | [
"'''\nMIT License\n\nCopyright (c) 2020 Sebastian Cornejo\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 restriction, including without limitation the rights\nto use, copy, modi... | [
[
"pandas.melt",
"pandas.read_csv"
]
] |
a-spichakou/sova-tts-binding | [
"cd6313b19dba20dc539f1859451763c1029c5e63"
] | [
"synthesizer.py"
] | [
"import os\nimport sys\nimport time\nimport yaml\n\nimport numpy as np\nimport soundfile\n\nfrom tps import cleaners, Handler, load_dict, save_dict\nfrom tps.types import Delimiter\n\nroot_path = os.path.dirname(os.path.abspath(__file__))\nsys.path.insert(0, root_path)\n\nimport backend_wrappers as bw\nfrom utils.a... | [
[
"numpy.concatenate",
"numpy.random.random",
"numpy.zeros"
]
] |
foolyc/bullet3 | [
"f4f5f70886e8d85bb5c000fe0c443fbf958f45d8"
] | [
"examples/pybullet/gym/pybullet_envs/minitaur/agents/ppo/algorithm.py"
] | [
"# Copyright 2017 The TensorFlow 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"tensorflow.exp",
"tensorflow.ones",
"tensorflow.nn.moments",
"tensorflow.sqrt",
"tensorflow.zeros_like",
"tensorflow.control_dependencies",
"tensorflow.gather",
"tensorflow.identity",
"tensorflow.cast",
"tensorflow.trainable_variables",
"tensorflow.shape",
"tensorf... |
Ending2015a/rlchemy | [
"42b1ed3d5654dd28cffd99de0db62584356228d4"
] | [
"rlchemy/lib/data/utils.py"
] | [
"# --- built n\r\nimport abc\r\nfrom typing import (\r\n Any,\r\n List,\r\n Optional,\r\n Tuple,\r\n Union\r\n)\r\n# --- 3rd party ---\r\nimport numpy as np\r\n# --- my module ---\r\nfrom rlchemy.lib import utils as rl_utils\r\n\r\n__all__ = [\r\n 'compute_nstep_rew',\r\n 'compute_advantage',\r\n 'SegmentTr... | [
[
"numpy.max",
"numpy.zeros_like",
"numpy.ones_like",
"numpy.asarray",
"numpy.zeros",
"numpy.min",
"numpy.isscalar"
]
] |
munhouiani/Deep-Packet | [
"e2d5bf20e97e96f18767dfad2ec467d030dd3c38"
] | [
"create_train_test_set.py"
] | [
"import os\nimport sys\nfrom pathlib import Path\n\nimport click\nimport numpy as np\nimport psutil\nfrom petastorm.codecs import CompressedNdarrayCodec, ScalarCodec\nfrom petastorm.etl.dataset_metadata import materialize_dataset\nfrom petastorm.unischema import Unischema, UnischemaField, dict_to_spark_row\nfrom py... | [
[
"numpy.array"
]
] |
vedant-jad99/GeeksForGeeks-DSA-Workshop-Complete-Codes | [
"35cee8317c05b36864a992789c741554205b3919"
] | [
"Leetcode/Out of Boundary Paths/out_of_bounds.py"
] | [
"\"\"\"\nThere is an m x n grid with a ball. The ball is initially at the position [startRow, startColumn]. You are allowed to move the ball to one of the four adjacent cells in the grid \n(possibly out of the grid crossing the grid boundary). You can apply at most maxMove moves to the ball.\nGiven the five integer... | [
[
"numpy.zeros"
]
] |
anarthal/prettyresults | [
"4dfa505b7744961301339a13cd459e513e4b4316"
] | [
"prettyresults/descriptives.py"
] | [
"from matplotlib import pyplot as plt\nimport pandas as pd\nimport numpy as np\nfrom scipy import stats\n\nfrom .utils import VarType, readable_index, freq_bar, freq_pie, format_float\n\n# For simplicity, mean CI is included here too\ndef mean_confidence_interval(data, confidence=0.95):\n data = data[~np.isnan(d... | [
[
"numpy.isnan",
"matplotlib.pyplot.xlabel",
"pandas.crosstab",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"numpy.mean",
"matplotlib.pyplot.ylabel",
"scipy.stats.sem",
"scipy.stats.t.ppf"
]
] |
aarkue/sap-meta-explorer | [
"613bf657bbaa72a3781a84664e5de7626516532f"
] | [
"sapextractor/algo/o2c/obj_centr_log.py"
] | [
"import pandas as pd\nfrom pm4pymdl.objects.mdl.exporter import exporter as mdl_exporter\nfrom pm4pymdl.objects.ocel.exporter import exporter as ocel_exporter\n\nfrom sapextractor.algo.o2c import o2c_common\nfrom sapextractor.utils import constants\nfrom sapextractor.utils.change_tables import extract_change\n\n\nd... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
kshivvy/tfx | [
"bb9c7c930b825be85c3cd38b8a7bdba948a7f955"
] | [
"tfx/components/transform/executor_test.py"
] | [
"# Lint as: python2, python3\n# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\... | [
[
"tensorflow.data.TFRecordDataset",
"tensorflow.io.gfile.glob",
"tensorflow.io.gfile.exists",
"tensorflow.io.gfile.listdir",
"tensorflow.test.main"
]
] |
pfackeldey/vector | [
"87e9e942f2a9ae09a3e250e12f37505eb22e25ea"
] | [
"src/vector/_compute/spatial/deltaR.py"
] | [
"# Copyright (c) 2019-2021, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.\n#\n# Distributed under the 3-clause BSD license, see accompanying file LICENSE\n# or https://github.com/scikit-hep/vector for details.\n\nimport typing\n\n\"\"\"\n.. code-block:: python\n\n Spatial.deltaR(self, other... | [
[
"numpy.errstate"
]
] |
mflorezto/AI_EQ_Ground_Motion | [
"153ef3e1b06cf66c456cad136a2e09eb62299d76"
] | [
"gan.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nimport torch\n\n\ndef embed(in_chan, out_chan):\n layers = nn.Sequential(\n nn.Linear(in_chan, 32), torch.nn.ReLU(),\n nn.Linear(32, 64), torch.nn.ReLU(),\n nn.Linear(64, 256), torch.nn.ReLU(),\n nn.Linear(256, 512), torch.nn.Re... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.Tanh",
"torch.nn.BatchNorm2d",
"torch.unsqueeze",
"torch.nn.ReLU",
"torch.nn.Upsample",
"torch.nn.Conv2d",
"torch.squeeze",
"torch.nn.BatchNorm1d",
"torch.nn.functional.relu",
"torch.nn.functional.leaky_relu"
]
] |
alexeyrodriguez/waveunet | [
"021a7e3d90a685d948aec2e77a7973a3656a6e99"
] | [
"test/models/test_waveunet.py"
] | [
"import pytest\nfrom models import WaveUNet\nfrom models import WaveUNetSizeCalculator\nimport torch\n\ni = 40\nk_down = 5\nk_up = 3\n\n@pytest.fixture\ndef t1():\n return torch.arange(1, i*2*2+1, dtype=torch.float32).view(2, 2, i)\n\nclass TestWaveUNet:\n def test_depth_0(self, t1):\n w = WaveUNet(2, ... | [
[
"torch.randn",
"torch.arange"
]
] |
pharmbio/ximeng_project | [
"9d1ed18c6fd62df95c7c008979c0c72ad27e0e3e",
"9d1ed18c6fd62df95c7c008979c0c72ad27e0e3e"
] | [
"Old_Scripts/savemore_split0.2_biggroups_Xception_epoch40.py",
"Old_Scripts/split_bigfamilies.py"
] | [
"import torch\nimport pandas as pd\nimport PIL\nimport os\nimport matplotlib.pyplot as plt\nimport time\nimport numpy as np\nfrom torchvision import datasets, models, transforms\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torchvision.transforms import ToTensor\nimport pretrainedmodels\nfrom sklearn.me... | [
[
"sklearn.metrics.confusion_matrix",
"torch.cuda.is_available",
"pandas.read_csv",
"matplotlib.pyplot.savefig",
"sklearn.metrics.ConfusionMatrixDisplay",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.device",
"numpy.array",
"numpy.savetxt",
"torch.max",
"torc... |
SebKleiner/Hateful_Memes | [
"28036062fd2b4b382be9dd7191462850f1be2b04"
] | [
"predict.py"
] | [
"import pickle\nimport pandas as pd\nimport os\n\n\ndef vectorize(labels, objects, text):\n \"\"\"\n Reads the tfidf vectorizers from models directory\n Vectorizes labels, objects and text with the correspondant tfidf vectorizer.\n Returns a data frame with the concatenation of the above\n :param lab... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
amsjavan/nazarkav | [
"b796cad10349009d5af734965b1257bbb9c0f678"
] | [
"nazarkav/tests/test_nazarkav.py"
] | [
"import os.path as op\r\nimport numpy as np\r\nimport pandas as pd\r\nimport numpy.testing as npt\r\nimport nazarkav as sb\r\n\r\ndata_path = op.join(sb.__path__[0], 'data')\r\n\r\n\r\ndef test_transform_data():\r\n \"\"\" \r\n Testing the transformation of the data from raw data to functions \r\n used for... | [
[
"numpy.array",
"numpy.zeros",
"numpy.testing.assert_equal",
"numpy.testing.assert_almost_equal",
"numpy.linspace"
]
] |
PierreDC/qiskit-sdk-py | [
"e879167ac86ee731f53ee71c10210ba37e4559ab"
] | [
"test/python/aer/test_qasm_simulator_py.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright 2017, IBM.\n#\n# This source code is licensed under the Apache License, Version 2.0 found in\n# the LICENSE.txt file in the root directory of this source tree.\n\n# pylint: disable=missing-docstring,redefined-builtin\nfrom sys import version_info\nimport unittest\n\nimport nu... | [
[
"numpy.tan"
]
] |
PalmerTurley34/tigju-lambdata | [
"6ee30362b0df608bb94b2b00a0da142be56d0c8c"
] | [
"tigju_lambdata/oop.py"
] | [
"import pandas as pd\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.utils.multiclass import unique_labels\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\nclass ConfusionMatrix:\n\n '''\n This class creates and object of confusion matrix for classification predictions\n\n Params:\n... | [
[
"sklearn.utils.multiclass.unique_labels",
"pandas.DataFrame",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.figure"
]
] |
wmkouw/quiver-time | [
"1e9ff2afa473e6aec04b5b525d5b1dae08b53cab"
] | [
"quiver_engine/util.py"
] | [
"from __future__ import absolute_import, division, print_function\nimport json\nfrom flask.json import jsonify\nimport numpy as np\nimport keras.backend as K\nfrom contextlib import contextmanager\nfrom quiver_engine.imagenet_utils import preprocess_input, decode_imagenet_predictions\nfrom os import path\n\ndef val... | [
[
"numpy.load",
"tensorflow.get_default_graph"
]
] |
JimmyCai91/tensorboardX | [
"9bff602008d71f4bbf6e83e99125033629f4ee6f"
] | [
"examples/matplotlib_demo.py"
] | [
"import matplotlib.pyplot as plt\nplt.switch_backend('agg')\n\nfig = plt.figure()\n\nc1 = plt.Circle((0.2,0.5), 0.2, color='r')\nc2 = plt.Circle((0.8,0.5), 0.2, color='r')\n\nax = plt.gca()\nax.add_patch(c1)\nax.add_patch(c2)\nplt.axis('scaled')\n\n\nfrom tensorboardX import SummaryWriter\nwriter = SummaryWriter()\... | [
[
"matplotlib.pyplot.switch_backend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axis"
]
] |
beeway/Data_Bootcamp | [
"abc2486060672e19f5e4a71342cb8ca05155db83"
] | [
"Code/Lab/Yahoo_options.py"
] | [
"\"\"\"\nYahoo options data using pandas-datareader\n\nMust install pandas-datareader and html5lib:\nconda install pandas-datareader, html5lib\n\nReferences\n* http://finance.yahoo.com/q/op?s=AMZN+Options\n* https://pandas-datareader.readthedocs.org/en/latest/\n\nPrepared for Data Bootcamp course at NYU\n* http://d... | [
[
"pandas.read_html",
"matplotlib.pyplot.subplots"
]
] |
microsoft/MetaXL | [
"a3ddebeb762e94e1c4cc814527365b5c234f6e06"
] | [
"mlt.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\ntry:\n import apex\nexcept ImportError:\n pass\n\nBERT_DIM = 768\nBERT_LAYERS = 13 # (emb + 12 hidden from transformers)\nIGNORED_INDEX = -100\n\n'''\ndef trim_input(bert_ids, bert_mask, bert_labels=None):\n max_leng... | [
[
"torch.cat",
"numpy.random.permutation",
"torch.ones",
"torch.tensor",
"torch.ones_like",
"torch.sum"
]
] |
TheNathanielWatkins/rasa | [
"8c28fcbeb2c94f5ac63a4c144bfea158700f3fd8"
] | [
"rasa/core/processor.py"
] | [
"import json\nimport logging\nimport os\nfrom types import LambdaType\nfrom typing import Any, Dict, List, Optional, Text, Tuple\n\nimport numpy as np\nimport time\n\nfrom rasa.core import jobs\nfrom rasa.core.actions.action import Action\nfrom rasa.core.actions.action import (\n ACTION_LISTEN_NAME,\n ActionE... | [
[
"numpy.max",
"numpy.argmax"
]
] |
zakur0/carla | [
"8854804f4d7748e14d937ec763a2912823a7e5f5"
] | [
"PythonAPI/util/performance_benchmark.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) 2019 Intel Labs.\n# authors: German Ros (german.ros@intel.com)\n#\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n\n\"\"\"\nThis is a benchmarking script for CARLA. It serves to analyze the performance... | [
[
"numpy.std",
"numpy.array",
"numpy.mean"
]
] |
liyi2017/flydra | [
"9ec83f14514f73e660ae8fbda32a3cc0348d0cb4"
] | [
"flydra_analysis/setup.py"
] | [
"from setuptools import setup, find_packages\nfrom distutils.core import Extension # actually monkey-patched by setuptools\nfrom Cython.Build import cythonize\nimport os\nimport sys\n\nimport flydra_analysis.version\nversion = flydra_analysis.version.__version__\n\nimport numpy as np\n\next_modules = []\n\next_modu... | [
[
"numpy.get_include"
]
] |
filteredcophy/FilteredCoPhy | [
"acf9f5fdb01c09baa663475dda22b918fed006ff"
] | [
"train_predrnn.py"
] | [
"import os\nimport torch\nimport random\nfrom tqdm import tqdm\nfrom torch.utils.data import DataLoader\nfrom Dataloader.Video_Loaders import blocktowerCF_Video, ballsCF_Video, collisionCF_Video\nimport argparse\nimport torch.nn as nn\nfrom skimage.metrics import peak_signal_noise_ratio\nimport numpy as np\nimport ... | [
[
"numpy.mean",
"torch.cuda.is_available",
"torch.load",
"torch.flip",
"torch.FloatTensor",
"matplotlib.pyplot.subplots",
"torch.manual_seed",
"torch.zeros",
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.shape",
"numpy.random.random_sample",
"numpy.cli... |
RensDimmendaal/scikit-lego | [
"9263df7a57ca059aec40ce6738715388ce50c9e2"
] | [
"sklego/pipeline.py"
] | [
"'''\nPipelines, variances to the :class:`sklearn.pipeline.Pipeline` object.\n'''\n\n\nimport logging\nimport time\n\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.utils.validation import check_memory\n\n\ndef default_log_callback(output, execution_time, **kwargs):\n '''\n The default log callback which... | [
[
"sklearn.utils.validation.check_memory"
]
] |
frsann/flytesnacks | [
"c788b79283d62788295ac3f059168113ec1e0a5a"
] | [
"cookbook/case_studies/feature_engineering/feast_integration/feature_eng_tasks.py"
] | [
"\"\"\"\nFeature Engineering Tasks\n-------------------------\nWe'll define the relevant feature engineering tasks to clean up the SQLite data.\n\"\"\"\n\n# %%\n# First, let's import the required libraries.\nimport numpy as np\nimport pandas as pd\nfrom flytekit import task\nfrom flytekit.types.schema import FlyteS... | [
[
"sklearn.impute.SimpleImputer",
"sklearn.feature_selection.SelectKBest"
]
] |
tjzhou23/iree | [
"63fd39fa023d0c1e5fb828a96ba927249252ec52"
] | [
"runtime/bindings/python/iree/runtime/array_interop_test.py"
] | [
"# Copyright 2022 The IREE Authors\n#\n# Licensed 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\nimport copy\nimport numpy as np\nimport unittest\n\nimport iree.runtime\n\n\nclass DeviceHa... | [
[
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.asarray",
"numpy.testing.assert_array_equal",
"numpy.isfinite"
]
] |
uTensor/utensor_cgen | [
"eccd6859028d0b6a350dced25ea72ff02faaf9ad"
] | [
"utensor_cgen/transformer/linear_reoder.py"
] | [
"# -*- coding:utf8 -*-\nr\"\"\"Linear Re-ordering Transformer\n\nLinear Operation Legalizations\n\n\"\"\"\nimport tensorflow.compat.v1 as tf\n\n# FIXME: remove uTensorOpEqualityDelegate import after we have generic ops\nfrom utensor_cgen.backend.utensor.code_generator.legacy._operators import \\\n uTensorOpEqual... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.nn.relu",
"tensorflow.compat.v1.nn.max_pool",
"tensorflow.compat.v1.Graph"
]
] |
sheh/drivendata-tissuenet-20 | [
"72d815eb7812414a66d8fd2f8f53462b18b4cfd4"
] | [
"src/roi_probs_dataset.py"
] | [
"import random\nfrom typing import List, Callable\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\n\nfrom src.slide import Slide, SlidesList, SlidesListLocalTrain\nfrom src.tools import BBox, best_page_for_sz\n\nimport pandas as pd\n\n\nclass RoiProbsDataset(Dataset):\n\n def __init__(s... | [
[
"numpy.asarray",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
hrb56/Mental-Health-Stories-Natural-Language-Processing | [
"7a2bc5d350cb1ef420d5018a6d20b31108309b6b"
] | [
"topic_modeling_CC.py"
] | [
"import nltk\r\nfrom nltk.tokenize import sent_tokenize\r\nfrom nltk import FreqDist\r\nimport pandas as pd\r\npd.set_option(\"display.max_colwidth\", 200)\r\nimport numpy as np\r\nimport re\r\nfrom nltk.corpus import stopwords\r\nimport spacy\r\n\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\n\r\nm... | [
[
"pandas.set_option",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.figure",
"pandas.Series",
"matplotlib.pyplot.show"
]
] |
peterse/Cirq | [
"31daa9410a0e1e1ac3da38109aa8ce3a15aed17b"
] | [
"cirq-core/cirq/devices/named_topologies.py"
] | [
"# Copyright 2021 The Cirq Developers\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 o... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca"
]
] |
tianyudwang/adversarial_imitation_learning | [
"8c0049ab75fd63ce600542d95fc392e9de2f5d50"
] | [
"scripts/eval_utils.py"
] | [
"from typing import Tuple, List, Union\n\nimport gym\nimport numpy as np\nimport torch as th\nfrom sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score\nfrom tqdm import tqdm\n\n\ndef to_torch(\n array: Union[np.ndarray, Tuple, List],\n device: Union[th.device, str],\n copy: bool = True... | [
[
"numpy.max",
"numpy.array",
"sklearn.metrics.mean_squared_error",
"numpy.min",
"numpy.mean",
"torch.from_numpy",
"numpy.std",
"sklearn.metrics.mean_absolute_error",
"torch.tensor",
"sklearn.metrics.r2_score",
"torch.as_tensor"
]
] |
sekiguchi92/SpeechEnhancement | [
"9318e8f7c4ba7cf43b71c32769e36da7d78d021e"
] | [
"src/separation/MNMF.py"
] | [
"#! /usr/bin/env python3\n# coding: utf-8\n\nimport numpy as np\nimport sys, os\nimport soundfile as sf\nfrom pathlib import Path\n\nsys.path.append(str(Path(os.path.abspath(__file__)).parents[1]))\nfrom Base import EPS, MIC_INDEX, Base, MultiSTFT\n\n\nclass MNMF(Base):\n \"\"\"The blind source separation using ... | [
[
"numpy.linalg.eigh",
"numpy.cuda.Device",
"numpy.abs",
"numpy.sqrt",
"numpy.linalg.inv"
]
] |
HaiFengZeng/expressive_tacotron | [
"e6c195e36f561a2b5be5725bca49f8318be77f86"
] | [
"data_utils.py"
] | [
"import random\n\nimport librosa\nimport numpy as np\nimport torch\nimport torch.utils.data\nimport audio\n\nimport layers\nfrom utils import load_wav_to_torch, load_filepaths_and_text, get_split_mels, split_audio\nfrom text import text_to_sequence\n\n_pad = 0\n\n\nclass TextMelLoader(torch.utils.data.Dataset):\n ... | [
[
"numpy.pad",
"torch.stack",
"torch.autograd.Variable",
"numpy.load",
"torch.from_numpy",
"torch.squeeze",
"numpy.stack"
]
] |
itoko/qiskit-experiments | [
"404397d92768bb8daa468da8b2414d22dd1b9cfb"
] | [
"qiskit_experiments/framework/json.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2021.\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-2.0.\n#\n# Any modifications or ... | [
[
"numpy.array"
]
] |
FellowsFreiesWissen/- | [
"3e74e6531985b0e9ba2e34bf1f6a1224cc7b52f3"
] | [
"data_v1/rdf/py/gs_countries.py"
] | [
"__author__ = \"Florian Thiery\"\n__copyright__ = \"MIT Licence 2021, Florian Thiery\"\n__credits__ = [\"Florian Thiery\"]\n__license__ = \"MIT\"\n__version__ = \"beta\"\n__maintainer__ = \"Florian Thiery\"\n__email__ = \"mail@fthiery.de\"\n__status__ = \"beta\"\n__update__ = \"2021-05-11\"\n\n# import dependencies... | [
[
"pandas.read_csv"
]
] |
Staniwnl/SlowFast | [
"fb332bc02a69244fe69794c70e28d9fb8aeae741"
] | [
"slowfast/visualization/gradcam_utils.py"
] | [
"#!/usr/bin/env python3\r\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\r\n\r\nimport matplotlib.pyplot as plt\r\nimport torch\r\nimport torch.nn.functional as F\r\n\r\nimport slowfast.datasets.utils as data_utils\r\nfrom slowfast.visualization.utils import get_layer\r\n\r\n\r\nclass Grad... | [
[
"torch.reshape",
"torch.device",
"torch.gather",
"torch.max",
"matplotlib.pyplot.get_cmap",
"torch.nn.functional.interpolate",
"torch.from_numpy",
"torch.nn.functional.relu",
"torch.sum"
]
] |
doanthevu1910/nl-house-price | [
"50c2b49248c3d6874fffd2ec1af1c26e465ae5c8"
] | [
"data/eindhoven/distance.py"
] | [
"import pandas as pd\nfrom geopy.extra.rate_limiter import RateLimiter\nfrom geopy.geocoders import Nominatim\nimport datetime\nnow = datetime.datetime.now()\nfrom geopy.distance import geodesic\n\npd.options.mode.chained_assignment = None # default='warn'\n\ndf = pd.read_csv('data/eindhoven.csv')\n\ndf['latitude'... | [
[
"pandas.read_csv"
]
] |
hussamaa/sentence-transformers | [
"07db1ab9ce37913cfc2a4e48b3a4452f3775aec2"
] | [
"examples/training/multilingual/make_multilingual.py"
] | [
"\"\"\"\nThis script contains an example how to extend an existent sentence embedding model to new languages.\n\nGiven a (monolingual) teacher model you would like to extend to new languages, which is specified in the teacher_model_name\nvariable. We train a multilingual student model to imitate the teacher model (... | [
[
"torch.utils.data.DataLoader",
"numpy.mean"
]
] |
yrunhaar/fact-ai | [
"95186394c46f07b84343368bd08522bc8784fa4a"
] | [
"metrics/evaluation_old.py"
] | [
" \n# Copyright (c) 2021, Ahmed M. Alaa, Boris van Breugel\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\n\"\"\"\n \n ----------------------------------------- \n Metrics implementation\n ----------------------------------------- \n\n\"\"\"\n\nimport numpy as np\nimport sys\nfrom sklearn.nei... | [
[
"numpy.max",
"numpy.array",
"numpy.min",
"numpy.mean",
"torch.tensor",
"numpy.abs",
"numpy.linspace"
]
] |
rlpink/external_cluster_editing | [
"80ca5850dd367a6ef2e6392ab10f6de52802f6a8"
] | [
"merging_methods_v5_slim.py"
] | [
"\"\"\"\nThis module implements several methods for calculating and outputting solutions of the unionfind_cluster_editing() algorithm.\nIt contains two methods for the (best) generated raw solutions,\nand, more importantly, methods to merge solutions into one better solution. It uses rem_union instead of classical ... | [
[
"numpy.array",
"numpy.int8",
"numpy.zeros",
"numpy.ones",
"numpy.float64",
"numpy.arange",
"numpy.sort",
"numpy.argsort",
"numpy.argwhere",
"pandas.unique",
"numpy.unique"
]
] |
JASTYN/pythonmaster | [
"46638ab09d28b65ce5431cd0759fe6df272fb85d"
] | [
"datascience/census_data/census.py"
] | [
"\"\"\" This script reads csv file and plots a chart\"\"\"\nimport csv as csv\n\nimport matplotlib.pyplot as plt\n\nDATA_FILE = \"adult.csv\"\nKEYS = [\"age\", \"workclass\", \"fnlwgt\", \"education\", \"education-num\", \"marital-status\", \"occupation\",\n \"relationship\", \" race\", \"sex\", \"capital-ga... | [
[
"matplotlib.pyplot.show"
]
] |
joao-aguilera-c/Binance-Algo-Trading-Bot | [
"859f971cf7b7f99c1c930157f22e44b801b8007c"
] | [
"main.py"
] | [
"import asyncio\r\nimport datetime\r\nimport os\r\nimport sys\r\n\r\nimport pandas as pd\r\nfrom binance import AsyncClient, BinanceSocketManager\r\n\r\nimport Get_Symbol_Info\r\nimport strategies as strats\r\nimport order_management as orders\r\nimport math\r\nimport csv\r\nimport time\r\n\r\n\r\ndef utcnow():\r\n... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.to_timedelta"
]
] |
tody411/ImageViewerFramework | [
"5c183c34e65494b6af1287e70152b995a868c6ac"
] | [
"ivf/batch/overview_figure.py"
] | [
"# -*- coding: utf-8 -*-\n## @package ivf.batch.overview_figure\n#\n# ivf.batch.overview_figure utility package.\n# @author tody\n# @date 2016/02/21\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\nfrom ivf.datasets.shape import shapeFile, shapeResultFile\nfrom ivf.io_util.image im... | [
[
"numpy.array",
"matplotlib.pyplot.subplots"
]
] |
bschroedr/sg2im | [
"ff412237cff45fa3f21406d4a4c59d9fe1b95a31",
"ff412237cff45fa3f21406d4a4c59d9fe1b95a31"
] | [
"scripts/save_val_results_baseline.py",
"scripts/save_val_results_triplet.py"
] | [
"#!/usr/bin/python\n#\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"torch.zeros",
"torch.device",
"torch.no_grad",
"numpy.mean",
"torch.nn.functional.mse_loss",
"torch.nn.functional.cross_entropy",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"torch.log"
],
[
"torch.zeros",
"torch.device",
"torch.... |
felenitaribeiro/connectome-fingerprint-analyses | [
"ace81d48ceca59f390b5e7587defbf8cad255665"
] | [
"plots/violin_plots.py"
] | [
"import numpy as np\nimport scipy.stats as stat\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\n\nparcellation = ['shen', 'gordon']\nnets = [9, 13]\ntitle_shen = ['Whole-brain', 'Medial frontal', 'Frontoparietal',\n 'Default mode', 'Subcortical-cerebellum', 'Motor', 'Visua... | [
[
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.savez",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
matejm/polynomial-interpolation | [
"c4b054c7b80a1f5cb9aa3b97543a19a33b1893f7"
] | [
"src/linear_regression.py"
] | [
"import numpy as np\n\n\"\"\"\nUseful functions for linear regression.\nNOTE: Because of solvnig system of equations, errors can be quite large.\n\"\"\"\n\n\ndef linear_regression(points):\n \"\"\"\n :points list of points (x, y).\n Finds best linear fit for given points using least squares method.\n :r... | [
[
"numpy.array",
"numpy.linalg.lstsq"
]
] |
ckelly314/pyIsotopomer | [
"5ff84398222414a0b4a80b66208958d21a98c158"
] | [
"src/pyisotopomer/automate_gk_setinputs.py"
] | [
"\"\"\"\nFile: automate_gk_setinputs.py\n---------------------------\nCreated on Weds April 14th, 2021\n\nExample script showing how to use scrambling solver.\n\n@author: Colette L. Kelly (clkelly@stanford.edu).\n\"\"\"\n\n# import utils\nimport pandas as pd\nimport parseinput\nimport parseoutput\n\n###############... | [
[
"pandas.ExcelWriter"
]
] |
aaknitt/pixel_mapper | [
"643fd0ba36159dedaca158c6840abd3f0f21c16b"
] | [
"pixel_automap.py"
] | [
"from imutils import contours, grab_contours\nfrom skimage import metrics, measure\nimport numpy as np\nimport argparse\nimport imutils\nimport cv2\nimport socket \nimport sys \nimport json\nimport time\nfrom lumos import DMXSource\nimport _thread\nimport matplotlib.path as pltPath\nfrom playsound import playsou... | [
[
"matplotlib.path.Path",
"numpy.array",
"numpy.zeros",
"numpy.unique"
]
] |
xmeng525/RealTimeDenoisingNeuralBilateralGrid | [
"8281f8ec9c6d432fae3228edaa01b7d2f879ac8a"
] | [
"image_utils.py"
] | [
"import os\nimport numpy as np\nimport PIL.Image\nimport scipy.misc\nfrom skimage import metrics\n\ndef load_exr(filename, datatype=np.float16):\n\timport OpenEXR\n\timport Imath\n\tHALF = Imath.PixelType(Imath.PixelType.HALF)\n\tif not OpenEXR.isOpenExrFile(filename):\n\t\traise Exception(\"File '%s' is not an EX... | [
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.mean",
"numpy.stack",
"numpy.abs",
"numpy.clip"
]
] |
steven-murray/analytic_diffuse | [
"b82fea27da4c476b4d04c2a0d8959e5af38bdd09"
] | [
"analytic_diffuse/tests/test_solutions.py"
] | [
"from analytic_diffuse.solutions import projgauss\nimport numpy as np\n\n\ndef test_return_cumsum():\n res = projgauss(1, 0.01, order=30, ret_cumsum=True)\n assert res.shape == (30, )\n\n res = projgauss(1, 0.01, order=30, ret_cumsum=False)\n assert np.isscalar(res)\n\n res = projgauss(np.linspace(1,... | [
[
"numpy.linspace",
"numpy.isclose",
"numpy.isscalar"
]
] |
maak-sdu/pyScattData | [
"c42af0ceb625a4ac74158cfa442b92215bd570ff"
] | [
"xy_stackplot_echem/example/tio2_rutile/waterfall_echem_TiO2-rutile.py"
] | [
"import sys\nfrom pathlib import Path\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nfrom diffpy.utils.parsers.loaddata import loadData\nimport matplotlib.ticker as ticker\n\n# INPUT SECTION\nFILE_EXT = 'gr'\nX_COLUMN = 0\nY_COLUMN = 1\n\nDPI = 300\nFIGSIZE = (12,4)\nFON... | [
[
"numpy.array",
"matplotlib.ticker.MultipleLocator",
"matplotlib.pyplot.figure",
"numpy.amax",
"numpy.amin"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.