repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
VoidHaruhi/OpenHGNN | [
"1371c238e7a4cab777333128619c0e4dd9bec2de"
] | [
"openhgnn/trainerflow/base_flow.py"
] | [
"import os\nimport torch\nfrom abc import ABC, abstractmethod\n\nfrom ..tasks import build_task\nfrom ..layers.HeteroLinear import HeteroFeature\nfrom ..utils import get_nodes_dict\n\n\nclass BaseFlow(ABC):\n candidate_optimizer = {\n 'Adam': torch.optim.Adam,\n 'SGD': torch.optim.SGD\n }\n\n ... | [
[
"torch.load"
]
] |
jiyangchen/benchmarks | [
"cfc870bd2871072accf8cef14b03edcb963bf62b"
] | [
"scripts/tf_cnn_benchmarks/variable_mgr.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.get_variable",
"tensorflow.device",
"tensorflow.control_dependencies",
"tensorflow.global_variables",
"tensorflow.local_variables",
"tensorflow.contrib.training.GreedyLoadBalancingStrategy",
"tensorflow.trainable_variables",
"tensorflow.train.replica_device_setter",
... |
ult-processor/tensortrade | [
"c2848f3bc33295085c31b8ad774c6e12f23210ea"
] | [
"tensortrade/features/scalers/standard_normalizer.py"
] | [
"# Copyright 2019 The TensorTrade 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 l... | [
[
"sklearn.preprocessing.StandardScaler"
]
] |
laurencer/functorch | [
"1bc4093b09f7a69606ff3fd2e6c76ffd55d4ac13"
] | [
"test/test_pythonkey.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom torch.testing._internal.common_utils import TestCase, run_tests\nimport torch\nimport torch.nn as... | [
[
"torch.randn",
"torch.mv",
"torch.testing._internal.common_utils.run_tests",
"torch.sin"
]
] |
NASLab/GroundROS | [
"6673db009ffcff59500eb1e3d5873111282e7749"
] | [
"src/experimental_results/navigation_test/path_planning_analysis.py"
] | [
"# python experimental tests for Husky\n\nimport numpy as np\nfrom numpy import sin, cos, pi\nimport matplotlib.pyplot as plt\n\nyaw_bound = 2 * pi / 180\nyaw_calibrate = pi / 180 * (0)\nx_offset_calibrate = .23\ny_offset_calibrate = -.08\n\n\ndata = np.load('pos.npy')[1:]\n# print len(data)\nerror_long = data[:, 0... | [
[
"matplotlib.pyplot.tight_layout",
"numpy.cos",
"matplotlib.pyplot.draw",
"numpy.sin",
"matplotlib.pyplot.close",
"numpy.load",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.figure"
]
] |
Salonijain27/cuml | [
"887575445ee0b162f4ac02feae86c0d7de14f793"
] | [
"python/cuml/test/test_mbsgd_classifier.py"
] | [
"# Copyright (c) 2019, NVIDIA CORPORATION.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"sklearn.datasets.samples_generator.make_classification",
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.SGDClassifier",
"sklearn.metrics.accuracy_score"
]
] |
Howdy-Personally/detrold | [
"5b3685db5fc114dd7770fd9a13ebe86f01756fc0"
] | [
"util/misc.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\r\n\"\"\"\r\nMisc functions, including distributed helpers.\r\n\r\nMostly copy-paste from torchvision references.\r\n\"\"\"\r\nimport os\r\nimport subprocess\r\nimport time\r\nfrom collections import defaultdict, deque\r\nimport datetime\r\nimp... | [
[
"torch.cat",
"torch.zeros",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.functional.interpolate",
"torch.distributed.get_rank",
"torch.ByteStorage.from_buffer",
"torch.save",
"torch.ones",
"torch.distributed.init_process_group",
"torch.distributed.barrier",
... |
MSZhang19/captum | [
"a189a1607f37bcf8a27decec516d5afb1709a161"
] | [
"captum/attr/_utils/attribution.py"
] | [
"#!/usr/bin/env python3\nfrom typing import Callable\n\nimport torch\nimport torch.nn.functional as F\n\nfrom .common import (\n _run_forward,\n _format_input_baseline,\n _format_tensor_into_tuples,\n _format_additional_forward_args,\n _validate_input,\n _validate_target,\n _tensorize_baseline,... | [
[
"torch.no_grad",
"torch.nn.functional.interpolate"
]
] |
markpp/object_detectors | [
"8a6cac32ec2d8b578c0d301feceef19390343e85"
] | [
"pytorch/MaskRCNN/MaskRCNN.py"
] | [
"import torch\n\nimport torchvision\nfrom torchvision.models.detection.faster_rcnn import FastRCNNPredictor\nfrom torchvision.models.detection.mask_rcnn import MaskRCNNPredictor\n\nimport numpy as np\nimport cv2\n\ndef create_model(num_classes,pretrained=True):\n # load an instance segmentation model pre-trained... | [
[
"numpy.concatenate",
"torch.tensor"
]
] |
ViugiNick/sentiment-discovery | [
"7f5ab28918a6fc29318a30f557b9454f0f5cc26a"
] | [
"multiproc.py"
] | [
"import torch\nimport sys\nimport os\nimport subprocess\n\nargslist = list(sys.argv)[1:]\n\nLOGDIR = 'distributed_logs'\nif '--save' in argslist:\n savepath = os.path.splitext(os.path.basename(argslist[argslist.index('--save')+1]))[0]\nelse:\n savepath = 'model'\nLOGDIR = os.path.join(LOGDIR, savepath)\nif no... | [
[
"torch.cuda.device_count"
]
] |
andre91998/Image_Processing | [
"e507b4b95a64d76bbabb63f8148317879dbc80d3"
] | [
"src/log.py"
] | [
"\n# coding: utf-8\n\n# # Function log\n# \n# Laplacian of Gaussian image.\n# \n# ## Synopse\n# 1D, 2D Laplacian of Gaussian image.\n# \n# - **g = ialog(s, mu, sigma)**\n# - Output:\n# - **g**: Image.\n# - Input:\n# - **s**: Image. [rows cols], output image dimensions.\n# - **mu*... | [
[
"matplotlib.pyplot.title",
"numpy.arange",
"numpy.indices",
"matplotlib.pyplot.plot",
"numpy.shape",
"numpy.ravel",
"numpy.array",
"numpy.exp"
]
] |
GireeshS22/Kaggle-submissions | [
"d772d3fc8fafb1719972a1e58b5106876c9dfba3"
] | [
"AV/Ship prediction/train.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Apr 12 10:08:12 2019\r\n\r\n@author: tornado\r\n\"\"\"\r\n\r\nimport pandas as pd\r\n\r\nfrom keras.layers import Input, TimeDistributed, Bidirectional, Conv2D, BatchNormalization, MaxPooling2D, Flatten, LSTM, Dense, Lambda, GRU, Activation\r\nfrom keras.optimize... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split"
]
] |
dericke/pandas | [
"efa85af76db3d76e175abbb4a98c0dddb88f57a0"
] | [
"pandas/core/indexes/base.py"
] | [
"from copy import copy as copy_func\nfrom datetime import datetime\nimport operator\nfrom textwrap import dedent\nfrom typing import TYPE_CHECKING, Any, FrozenSet, Hashable, Union\nimport warnings\n\nimport numpy as np\n\nfrom pandas._libs import algos as libalgos, index as libindex, lib\nimport pandas._libs.join a... | [
[
"pandas.core.indexes.multi.MultiIndex",
"pandas.core.indexes.range.RangeIndex",
"pandas.core.dtypes.common.ensure_object",
"numpy.where",
"pandas.core.dtypes.common.is_interval_dtype",
"pandas.core.common.cast_scalar_indexer",
"pandas.core.arrays.PeriodArray._from_sequence",
"panda... |
melvyniandrag/quadpy | [
"ae28fc17351be8e76909033f03d71776c7ef8280"
] | [
"tools/xiao_gimbutas/import_xiao_gimbutas_tet.py"
] | [
"# -*- coding: utf-8 -*-\n#\n\"\"\"\nParse Fortran code to extract points and weight of the Xiao-Gimbutas schemes.\n\"\"\"\nimport numpy\n\n\n# TODO the first two functions could go into a helper and be shared with tri\ndef _parsed_strings_to_array(strings):\n return numpy.array(\n \"\".join(strings).repl... | [
[
"numpy.argsort",
"numpy.linalg.solve",
"numpy.sqrt",
"numpy.column_stack"
]
] |
kimager/CRRLpy | [
"7209f18f7b2d25c85ea1938e5ae8474511823d6b"
] | [
"crrlpy/frec_calc.py"
] | [
"#!/usr/bin/env python\n\n__docformat__ = 'reStructuredText'\n\nimport argparse\n\nimport numpy as np\n\nfrom scipy.constants import c, m_e, physical_constants\nfrom astropy import units as u\n\ndef line_freq(Z, R_X, n, dn):\n \"\"\"\n Uses the Rydberg formula to get the frequency\n of a transition to quan... | [
[
"numpy.arange"
]
] |
abakhru/stock_prediction | [
"bfb4483ac888bc67e2a8928fdf037d23acbf48f9"
] | [
"stock_predictions/search_stock.py"
] | [
"#!/usr/bin/env python\nimport json\nfrom datetime import datetime\n\nimport click\nimport requests\nimport yfinance\nfrom pandas import DataFrame\n\nfrom stock_predictions import ROOT\nfrom stock_predictions.logger import LOGGER\nfrom stock_predictions.utils import pretty_print_df\n\nLOGGER.setLevel('INFO')\nfinal... | [
[
"pandas.DataFrame"
]
] |
VijaySingh-GSLab/venue_recommender | [
"3c3bddc19c2f3be71833b85c5a1de2522771f0b3"
] | [
"utils.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom scipy import stats\nfrom scipy.spatial import distance\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom matplotlib.ticker import MaxNLocator\nfrom pathlib import Path\nimport plotly.graph_objects as go\n\nMAPBOX_TOKEN = 'pk.eyJ1IjoidmlqYXlzaW5naGdzbGFiIiwi... | [
[
"pandas.concat",
"pandas.merge",
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"numpy.nonzero",
"numpy.take",
"matplotlib.pyplot.subplots",
"scipy.spatial.distance.euclidean",
"matplotlib.ticker.MaxNLocator",
"numpy.array",
"matplotlib.pyplot.show",
"pandas.m... |
hbendekgey/FairSurrogates | [
"d81747817c866a67a6a324f8aea2f02cc3ece5c9"
] | [
"CelebA/sim_dp.py"
] | [
"import sys\nimport torch\nimport torchvision\nimport torch.optim as optim\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom tqdm import tqdm, trange\nfrom time import sleep\nfrom PIL import Image\nfrom torchvision import transforms\n\nif len(sys.argv) != 4:\n print(\"Usage: python simulate.py lambda... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.max",
"torch.load",
"torch.utils.data.DataLoader",
"torch.cuda.empty_cache",
"torch.nn.functional.logsigmoid",
"torch.tensor",
"torch.nn.Linear",
"torch.nn.BCEWithLogitsLoss",
"torch.cuda.is_available",
"torch.hub.loa... |
Chris2L/gnss-ins-sim | [
"2d2ba0fac193afd10b4d7758cc85d14457f17001"
] | [
"demo_free_integration_long_time.py"
] | [
"# -*- coding: utf-8 -*-\n# Filename: demo_free_integration_long_time.py\n\n\"\"\"\nA simple free integration (strapdown inertial navigation) demo of Sim.\nCreated on 2018-01-23\n@author: dongxiaoguang\n\"\"\"\n\nimport os\nimport math\nimport numpy as np\nfrom gnss_ins_sim.sim import imu_model\nfrom gnss_ins_sim.s... | [
[
"numpy.array",
"numpy.genfromtxt"
]
] |
dadi-vardhan/Assurance-cases-for-LEC | [
"cbd6e8b296c624fdd734ac4ee0fbf4308a114026"
] | [
"robo_cup_experiments/test.py"
] | [
"from cv2 import sepFilter2D\nimport torch\nimport os\nimport numpy as np\nimport pytorch_lightning as pl\nfrom datamodule import MNISTDataModule\nfrom model import MnistModel\nfrom torchvision import datasets\nfrom torchvision.transforms import ToTensor\nfrom utils import get_device\nfrom torchmetrics.functional... | [
[
"numpy.hstack"
]
] |
zenseact/development_kit | [
"c52a8c8a625b0acd60c158bb2330cf35ee7dde11"
] | [
"plot_gps_on_image.py"
] | [
"\"\"\"Module to perform OxTS extraction and visualize GPS track projection on image plane.\"\"\"\nfrom datetime import datetime\n\nimport cv2\nimport numpy as np\nimport pandas as pd\nimport pyproj\nfrom pytz import utc\n\nfrom constants import (\n DEFAULT_COL_VALUES,\n DISTORTION,\n ECEF_XYZ,\n EXTRIN... | [
[
"numpy.radians",
"numpy.einsum",
"numpy.arctan2",
"numpy.concatenate",
"numpy.round",
"numpy.zeros_like",
"numpy.cross",
"numpy.ones_like",
"numpy.unique",
"numpy.arange",
"numpy.eye",
"numpy.stack",
"numpy.sin",
"numpy.argmax",
"pandas.DataFrame.from_di... |
iimuz/til | [
"b100438e8ce2f369331b3be215a4b9cdce9ffda5",
"b100438e8ce2f369331b3be215a4b9cdce9ffda5"
] | [
"machine_learning/tf_autoencoder/src/models/dense_ae.py",
"machine_learning/tf_eager_mnist/model.py"
] | [
"# third party\nimport tensorflow as tf\nfrom tensorflow.keras import layers\n\n# my packages\nfrom src.data import history\n\n\nclass Autoencoder(tf.keras.Model):\n \"\"\"単純な全結合Autoencoder\n \"\"\"\n\n def __init__(self, input_dim: int) -> None:\n \"\"\"Initialize\n\n Args:\n inpu... | [
[
"tensorflow.keras.layers.Dense",
"tensorflow.GradientTape"
],
[
"tensorflow.train.CheckpointManager",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"tensorflow.train.Checkpoint",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.m... |
dmpelt/pywt | [
"5fc0f769dfdd6d21c2d0b2fa4fa8cdb7e887bb9f"
] | [
"pywt/_dwt.py"
] | [
"import numpy as np\n\nfrom ._extensions._pywt import Wavelet, Modes, _check_dtype\nfrom ._extensions._dwt import (dwt_single, dwt_axis, idwt_single, idwt_axis,\n upcoef as _upcoef, downcoef as _downcoef,\n dwt_max_level as _dwt_max_level,\n ... | [
[
"numpy.asarray",
"numpy.array",
"numpy.zeros_like",
"numpy.iscomplexobj"
]
] |
geometrikal/coral_usb_ros | [
"46341a30ec91d887f631353f1e7b26680d75e8d1"
] | [
"node_scripts/edgetpu_human_pose_estimator.py"
] | [
"#!/usr/bin/env python\n\n\nimport matplotlib\nmatplotlib.use(\"Agg\") # NOQA\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport sys\n\n# OpenCV import for python3.5\nsys.path.remove('/opt/ros/{}/lib/python2.7/dist-packages'.format(os.getenv('ROS_DISTRO'))) # NOQA\nimport cv2 # NOQA\nsys.pat... | [
[
"matplotlib.use",
"matplotlib.pyplot.Axes",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.pyplot.figure"
]
] |
maker-tj/WA-SUPER-BPD | [
"afe8977cb3fb3ba3db2d7f3361e286dd4221fa7d"
] | [
"vis_flux.py"
] | [
"import sys\nimport scipy.io as sio\nimport math\nimport numpy as np\nimport cv2\nimport matplotlib\nmatplotlib.use('agg')\nimport pylab as plt\nfrom matplotlib import cm\nimport torch\n\n\ndef label2color(label): # 定义颜色标签\n\n label = label.astype(np.uint16) # astype生成的矩阵是无符号整型\n \n height, width = labe... | [
[
"numpy.sqrt",
"numpy.unique",
"matplotlib.use",
"numpy.arctan2",
"numpy.array",
"numpy.zeros"
]
] |
Eurus-Holmes/CHABCNet | [
"8d3985c7680981e58751d043880b5b5a818cc1d3"
] | [
"adet/data/augmentation.py"
] | [
"import numpy as np\nfrom fvcore.transforms import transform as T\n\nfrom detectron2.data.transforms import RandomCrop, StandardAugInput\nfrom detectron2.structures import BoxMode\n\n\nclass InstanceAugInput(StandardAugInput):\n \"\"\"\n Keep the old behavior of instance-aware augmentation\n \"\"\"\n\n ... | [
[
"numpy.random.choice",
"numpy.asarray",
"numpy.ceil",
"numpy.floor",
"numpy.random.randint"
]
] |
anandnet/Bone-Fracture-Detection- | [
"562ce7b12a0a92a937863b82b3769332fa0e5499"
] | [
"manual/main.py"
] | [
"import cv2\nimport numpy as np\n\nfrom pre_process import _reshape_img, get_model\n\nimg_name=\"new\"\n\"\"\"\nCurrently, `img_name` will be used to get resized image from `images/resized` folder\nand original image from `images/Fractured Bone` so it expects the same named image file\nto be available in both the f... | [
[
"numpy.rot90",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
JiajShi/VSR-colorization | [
"800f5a3f3cbbaf12936b272b430b5e3f8d07b794"
] | [
"VSR+colorization.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # 1.**安装PaddleGAN**\n# \n# PaddleGAN的安装目前支持Clone GitHub和Gitee两种方式.\n\n# In[ ]:\n\n\n# 当前目录在: /home/aistudio/, 该目录即:左边文件和文件夹所在的目录\n# 克隆最新的PaddleGAN仓库到当前目录\n# !git clone https://github.com/PaddlePaddle/PaddleGAN.git\n# github下载慢,从gitee clone:\nget_ipython().system('git clo... | [
[
"matplotlib.animation.ArtistAnimation",
"numpy.concatenate",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure"
]
] |
EmanuelCastanho/PMLDataPipeline | [
"3f613a46a42898f78a90d956c0c6af364778c529"
] | [
"download_features.py"
] | [
"'''This script downloads and processes modeling traning data \n in to a format that is ready for the modeling script.\n To run use the following command\n\n python download_features -feature_list=data/features.csv -o output_dir\n \n This will generate EOPatches with each training data point at the center... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
czyzq/mstrio-py | [
"b25fd19936b659d503a7eaaa96c8d0b4e118cb7c",
"b25fd19936b659d503a7eaaa96c8d0b4e118cb7c"
] | [
"mstrio/users_and_groups/user.py",
"mstrio/utils/acl.py"
] | [
"from datetime import datetime\nfrom typing import List, Optional, TYPE_CHECKING, Union\n\nfrom pandas import DataFrame, read_csv\nfrom requests.exceptions import HTTPError\n\nfrom mstrio import config\nfrom mstrio.access_and_security.privilege_mode import PrivilegeMode\nfrom mstrio.access_and_security.security_rol... | [
[
"pandas.read_csv",
"pandas.DataFrame.from_dict"
],
[
"pandas.DataFrame"
]
] |
Eng-RSMY/OpenPNM | [
"a0a057d0f6346c515792459b1da97f05bab383c1"
] | [
"OpenPNM/Utilities/__topology__.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n===============================================================================\nNetwork.tools.topology: Assorted topological manipulation methods\n===============================================================================\n\n\"\"\"\nimport scipy as _sp\nimport numpy as _np\ni... | [
[
"scipy.amin",
"scipy.sum",
"scipy.zeros",
"scipy.copy",
"scipy.ones",
"scipy.ndarray",
"scipy.shape",
"scipy.mean",
"scipy.array",
"scipy.vstack",
"scipy.where",
"scipy.inner",
"scipy.spatial.distance.cdist",
"scipy.size",
"scipy.arange",
"numpy.arra... |
AaronWChen/RHCR | [
"e5d5ac06c46d7cc4052a688338d9371518d1f445"
] | [
"model_training_v2/mnist/mnist_saved_model_tf2.py"
] | [
"\"\"\"\nThis script is a refactor of the original mnist_saved_model.py originally included in the repo. \nThe original was written in 2016 by Google and the original tutorial does not seem to be available \nanymore. \n\nAlso, TensorFlow 2 debuted in September 2019, so refactoring to TF 2 seemed like a good idea.\n... | [
[
"tensorflow.compat.v1.app.flags.DEFINE_integer",
"tensorflow.compat.v1.app.flags.DEFINE_string"
]
] |
hrlblab/CircleNet | [
"219aa47fa4dc4f362b28448c0dcd41b29c4f1166"
] | [
"src/lib/datasets/dataset/kidpath_new.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport pycocotools.coco as coco\nimport datasets.eval_protocals.kidpath_circle as kidpath_circle\nfrom datasets.eval_protocals.circle_eval import CIRCLEeval\nfrom pycocotools.cocoeval import COCOeval\n... | [
[
"numpy.array",
"numpy.random.RandomState"
]
] |
sukruc/parking-model | [
"82b9e5cb33095a82f86ac6a94da8865890ff6d01"
] | [
"taxiv2.py"
] | [
"from gym.envs.toy_text import TaxiEnv\nimport gym.envs.toy_text.discrete as discrete\nimport numpy as np\nimport json\n\nMAP = [\n \"+---------+\",\n \"|R: | : :G|\",\n \"| : | : : |\",\n \"| : : : : |\",\n \"| | : | : |\",\n \"|Y| : |B: |\",\n \"+---------+\",\n]\n\nclass TaxiEnvTr(TaxiEnv):\... | [
[
"numpy.asarray",
"numpy.repeat",
"numpy.zeros"
]
] |
lsauthie/nlp | [
"8d562443ffea056a66db6ec87823d9198255884d"
] | [
"main.py"
] | [
"import cosine\nimport fileprocessing\nimport re\nimport sys\nimport colorama\nfrom colorama import Fore, Style\ncolorama.init()\n\ncfg_data = fileprocessing.read_json() #get config data\nlist_q = []\nlist_db = []\n\ncosine_ob = '' #initiate the object\n\n#h_p_x functions should help printing information in the con... | [
[
"numpy.percentile"
]
] |
thocoo/gamma-desk | [
"9cb63a65fe23e30e155b3beca862f369b7fa1b7e"
] | [
"gdesk/panels/imgview/imgdata.py"
] | [
"import pathlib\nimport collections\nimport queue\nimport threading\nimport math\n\nfrom qtpy import QtGui, QtCore\nfrom qtpy.QtGui import QImage\n\nimport numpy as np\n\nfrom ... import gui, config\n\nfrom ...utils.shared import SharedArray\nfrom ...utils import imconvert\n\nfrom .dimensions import DimRanges\nfrom... | [
[
"numpy.take",
"numpy.ones"
]
] |
NHPatterson/napari | [
"d8d2d301b71af79a6a7f8f4bafa1f55a18317dd8"
] | [
"napari/_vispy/experimental/tiled_image_visual.py"
] | [
"\"\"\"TiledImageVisual class\n\nA visual that draws tiles using a texture atlas.\n\nUltimately TiledImageVisual cannot depend on OctreeChunk. And Octree\ncode should not depend on TiledImageVisual! So there really can be\nno class or named tuple that gets passed between them.\n\nInstead, we'll probably just have a... | [
[
"numpy.array",
"numpy.zeros",
"numpy.vstack"
]
] |
OSUKED/Outage-Watch | [
"d2795e3ef971c906e633cf669c2d70511349a1aa"
] | [
"outage/retrieval.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01-retrieval.ipynb (unless otherwise specified).\n\n__all__ = ['extract_ukpn_single_incident_ids', 'extract_ukpn_multiple_incident_urls',\n 'extract_ukpn_multiple_incident_ids', 'get_ukpn_incident_detail_url', 'is_ukpn_incident_active',\n 'extract... | [
[
"pandas.to_datetime"
]
] |
StanfordMSL/mslquad | [
"c319ecf4ba1063075221b67f12f4e017992f28fc"
] | [
"mslquad/scripts/trajectory_path.py"
] | [
"#!/usr/bin/env python\n\n#Sergio Esteban SURF 2019\n#takes waypoints from .CSV files and commands the drone\nimport rospy\nimport std_msgs.msg\nfrom geometry_msgs.msg import Pose, PoseStamped\nimport numpy as np\n\nclass Conductor:\n\n\tdef __init__(self):\n\t\trospy.init_node('poseConductor', anonymous=True)\n\t\... | [
[
"numpy.array",
"numpy.linalg.norm"
]
] |
burkovae/evidently | [
"015f7d24811b956a624f379ebf2d58c98cc3b652"
] | [
"src/evidently/analyzers/classification_performance_analyzer.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\nfrom typing import List\nfrom typing import Optional\nfrom typing import Dict\n\nimport pandas as pd\nimport numpy as np\nfrom dataclasses import dataclass\nfrom sklearn import metrics\n\nfrom evidently import ColumnMapping\nfrom evidently.analyzers.base_analyzer import Anal... | [
[
"sklearn.metrics.precision_score",
"sklearn.metrics.classification_report",
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.f1_score",
"sklearn.metrics.recall_score",
"sklearn.metrics.accuracy_score"
]
] |
RyanWangZf/pytorch-deeplab-xception | [
"d01239585e582e485c143694728ffb5c2c2f6eba"
] | [
"data/construction/split_train_val.py"
] | [
"import numpy as np\nimport os, pdb\nimport shutil\nnp.random.seed(2020)\n\ndef check_exist_path(path):\n if not os.path.exists(path):\n os.makedirs(path)\n\n\n# create save dirs\nsave_tr_dir = \"train\"\nsave_tr_img_dir = os.path.join(save_tr_dir, \"image_npy\")\ncheck_exist_path(save_tr_img_dir)\nsave_t... | [
[
"numpy.random.shuffle",
"numpy.random.seed"
]
] |
Brollof/Advent-of-Code | [
"c9cdf52660acc997aa7947509ca9933adcf11ca8"
] | [
"2020/Day 20/20_1.py"
] | [
"import re\nimport numpy as np\nfrom copy import deepcopy as dc, copy\nfrom math import sqrt\n\n\nLEFT = (1 << 0)\nRIGHT = (1 << 1)\nUP = (1 << 2)\nDOWN = (1 << 3)\n\n\nclass Tile:\n def __init__(self, raw_data=None):\n self.raw_data = raw_data\n tile_str = raw_data.splitlines()\n self.id = ... | [
[
"numpy.fliplr",
"numpy.rot90",
"numpy.flipud"
]
] |
wiVlad/DPMMSubClusters.jl | [
"64fa5a5a37bef85b715bbd056c66d47ffe6922a5"
] | [
"paper_utils.py"
] | [
"# Change directory to VSCode workspace root so that relative path loads work correctly. Turn this addition off with the DataScience.changeDirOnImportExport setting\n# ms-toolsai.jupyter added\nimport os\n\n\nimport pickle\nfrom datetime import datetime as date\nfrom pathlib import Path\nfrom timeit import default_... | [
[
"sklearn.cluster.KMeans",
"numpy.unique",
"numpy.eye",
"sklearn.mixture.GaussianMixture",
"numpy.array",
"numpy.zeros",
"sklearn.metrics.cluster.adjusted_rand_score"
]
] |
prstolpe/rrc_simulation | [
"b430fe4e575641cdd64945cf57d0dd67a0eea17a"
] | [
"tests/test_reset_joints.py"
] | [
"#!/usr/bin/env python3\nimport unittest\nimport numpy as np\n\nfrom rrc_simulation.sim_finger import SimFinger\nfrom rrc_simulation import sample\n\n\nclass TestResetJoints(unittest.TestCase):\n \"\"\"\n This test verifies that the state of the finger(s) gets reset correctly.\n\n So, all the 1DOF joints o... | [
[
"numpy.testing.assert_array_equal"
]
] |
maxim1um/PathFinding | [
"272391a0434c3fe1c17ef7f8e507a240183788f3"
] | [
"A-Star/animation_demo.py"
] | [
"\"\"\"\n================\npyplot animation\n================\n\nGenerating an animation by calling `~.pyplot.pause` between plotting commands.\n\nThe method shown here is only suitable for simple, low-performance use. For\nmore demanding applications, look at the :mod:`animation` module and the\nexamples that use... | [
[
"numpy.random.random",
"matplotlib.pyplot.subplots",
"numpy.random.seed",
"matplotlib.pyplot.pause"
]
] |
10088/MockingBird | [
"6a793cea8488ad40fcad6ab30f9d82bc920ac114"
] | [
"vocoder/fregan/dwt.py"
] | [
"# Copyright (c) 2019, Adobe Inc. All rights reserved.\n#\n# This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike\n# 4.0 International Public License. To view a copy of this license, visit\n# https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.\n\n# DWT code borrow from http... | [
[
"torch.nn.Parameter",
"torch.zeros",
"torch.tensor",
"torch.cuda.is_available",
"torch.nn.functional.pad"
]
] |
yydv98/FinNetIndicators | [
"5559b2039e173175b8efed89916d4e8601f31414"
] | [
"network_entropy.py"
] | [
"# Code calculates network entropy for degree and remaining degree distribution\n# Reference for Network Entropy: R.V. Sole and S. Valverde, Information theory of complex networks: on evolution and architectural constraints. Complex networks. Springer Berlin Heidelberg, 2004. 189-207.\n# Packages required: igraph, ... | [
[
"numpy.log2"
]
] |
mli0603/Bi3D | [
"dfcccdae3c3e0a6fc847e5cec6129dc5b497b906"
] | [
"src/models/RefineNet3D.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, related documentation\n# and any modifications thereto. Any use, reproduction, disclosure or\n# distribution of this softwa... | [
[
"numpy.sqrt",
"torch.cat"
]
] |
davicn/tuh_seizures | [
"0b1e6983baba3ffba0aa9942c3d22ab1e14c1e4b"
] | [
"scripts/getFeatures.py"
] | [
"import numpy as np\nimport pandas as pd\nimport mne\nimport os\nfrom functions import gpuFeatures as gf\n\nPATH = os.getcwd()\nHOME = os.path.expanduser(\"~\")\n\nw = pd.read_csv(PATH+'/docs/class_w.csv', header=None)\nn = pd.read_csv(PATH+'/docs/class_n.csv', header=None)\n\nuse = ['EEG FP1-REF', 'EEG FP2-REF', '... | [
[
"pandas.read_csv",
"numpy.save"
]
] |
EchoWho/AnytimeNeuralNetwork_public | [
"f2f04a836b984250aca6180afedfcab29be9ead9"
] | [
"tensorpack/dataflow/format.py"
] | [
"# -*- coding: utf-8 -*-\n# File: format.py\n\n\nimport numpy as np\nimport six\nfrom six.moves import range\nimport os\nimport struct\n\nfrom ..utils import logger\nfrom ..utils.utils import get_tqdm\nfrom ..utils.timer import timed_operation\nfrom ..utils.loadcaffe import get_caffe_pb\nfrom ..utils.serialize impo... | [
[
"tensorflow.python_io.tf_record_iterator",
"numpy.load",
"numpy.fromstring",
"numpy.arange"
]
] |
jusjusjus/autograd-hacks | [
"c12556d03e40cccaa0e70e14b0120b723002ed9e"
] | [
"autograd_hacks/test_autograd_hacks.py"
] | [
"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport pytest\n\nfrom . import autograd_hacks\n\n\nclass StriddenNet(nn.Module):\n def __init__(self):\n super().__init__()\n self.conv1 = nn.Conv2d(1, 20, 5, stride=2, padding=2)\n self.conv2 = nn.Conv2d(20, 30, 5, str... | [
[
"torch.nn.CrossEntropyLoss",
"torch.LongTensor",
"torch.manual_seed",
"torch.nn.Conv2d",
"torch.zeros_like",
"torch.sum",
"torch.nn.Linear",
"torch.rand",
"torch.flatten",
"torch.stack",
"torch.nn.functional.max_pool2d",
"torch.autograd.grad"
]
] |
mkzirncz1/ResNet-PyTorch | [
"2a19be30cc65eb5cb8cc41341b22bd040c022546"
] | [
"examples/simple/test.py"
] | [
"# Copyright 2020 Lorna Authors. All Rights Reserved.\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 b... | [
[
"torch.topk",
"torch.softmax",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
hrabeale/arrow | [
"4009b62086dfa43a4fd8bfa714772716e6531c6f"
] | [
"python/pyarrow/tests/test_convert_builtin.py"
] | [
"# -*- coding: utf-8 -*-\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.... | [
[
"numpy.bool",
"numpy.iinfo"
]
] |
SuzukiDaishi/AutoVC.pytorch | [
"0ce6f2dd5b6e34f812c56fc1466bb3444ef837bd"
] | [
"train.py"
] | [
"import os\nimport json\nimport argparse\nimport torch\nimport random\nimport torch.optim as optim\nfrom model_vc import StyleEncoder\nfrom model_vc import Generator\nfrom dataset import AudiobookDataset\nfrom dataset import train_collate\nfrom dataset import test_collate\nfrom utils.dsp import save_wav\nimport num... | [
[
"torch.abs",
"torch.autograd.set_detect_anomaly",
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device"
]
] |
kyawakyawa/image-filters-python | [
"0bcc8ef583834deba4697f17d0e627ce695bfd07"
] | [
"main.py"
] | [
"\"\"\"\nMIT License\n\nCopyright (c) 2021 kyawakyawa\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, modify, ... | [
[
"torch.abs",
"torch.set_grad_enabled",
"torch.max"
]
] |
Windxy/YOLO-F | [
"b334471613816238f7d968e538aca1b3f30b9482"
] | [
"utils/utils.py"
] | [
"from __future__ import division\nimport os\nimport math\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\nimport matplotlib.pyplot as plt\n\nclass DecodeBox(nn.Module):\n def _... | [
[
"torch.sigmoid",
"torch.linspace",
"torch.max",
"torch.Tensor",
"numpy.min",
"torch.cat",
"torch.min",
"numpy.concatenate",
"torch.exp",
"torch.sort",
"torch.clamp"
]
] |
daBawse167/torch-toolbox | [
"a1c0440127bca00201dfa0d0e0dcbafb65628632"
] | [
"torchtoolbox/tools/summary.py"
] | [
"# -*- coding: utf-8 -*-\n# @Author : DevinYang(pistonyang@gmail.com)\n__all__ = ['summary']\n\nfrom collections import OrderedDict\nimport torch\nimport torch.nn as nn\nimport numpy as np\n\n\ndef _flops_str(flops):\n preset = [(1e12, 'T'), (1e9, 'G'), (1e6, 'M'), (1e3, 'K')]\n\n for p in preset:\n i... | [
[
"torch.no_grad",
"numpy.prod"
]
] |
mjasieczko/new_offer_success_predictor | [
"d6bf146f25729c96f611ffdbe57ecf9b9afa82b6"
] | [
"src/application/app_utils.py"
] | [
"import pickle\nimport warnings\nfrom pathlib import Path\n\nimport pandas as pd\n\nfrom data.data_manager import DataManager\nfrom data.data_processor import DataProcessor, TestDataProcessor\nfrom ml_preprocessing.categorical_encoders import LeaveOneOutEncoder\n\nwarnings.filterwarnings('ignore')\n\n\ndef run(arg_... | [
[
"pandas.merge",
"pandas.get_dummies"
]
] |
Nyquixt/multiview-human-pose-estimation-pytorch | [
"d1469ee19f1761281aa738287c6fca0fb1fd9866"
] | [
"lib/utils/pose_utils.py"
] | [
"# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n# Written by Chunyu Wang (chnuwa@microsoft.com)\n# ------------------------------------------------------------------------------\n\nimpo... | [
[
"numpy.diag",
"numpy.dot",
"numpy.linalg.svd",
"numpy.sqrt",
"numpy.reshape",
"numpy.arange",
"numpy.linalg.inv",
"numpy.matmul",
"numpy.concatenate",
"numpy.linalg.pinv",
"sklearn.preprocessing.normalize",
"numpy.linalg.det",
"numpy.mean",
"numpy.cross",
... |
joaopfonseca/research | [
"ac4ad6fa05b5985050c63dc9e4e18cd00965e09b"
] | [
"research/utils/_data.py"
] | [
"\"\"\"\nData I/O utils. Later on I might add other data handling utilities.\n\"\"\"\nfrom os import listdir\nfrom os.path import isdir, join\nimport pandas as pd\nfrom sqlite3 import connect\n\n\ndef load_datasets(data_dir, suffix=\"\", target_exists=True, **read_csv_kwargs):\n \"\"\"Load datasets from sqlite d... | [
[
"pandas.read_csv",
"pandas.read_sql"
]
] |
Zacchaeus14/lang-seg | [
"ad1196a4d33830f3219dbe2260a69364a745f094"
] | [
"modules/lsegmentation_module.py"
] | [
"import types\nimport time\nimport random\nimport clip\nimport torch\nimport torch.nn as nn\nimport torchvision.transforms as transforms\n\nfrom argparse import ArgumentParser\n\nimport pytorch_lightning as pl\n\nfrom data import get_dataset, get_available_datasets\n\nfrom encoding.models import get_segmentation_mo... | [
[
"torch.optim.Adam",
"torch.max",
"torch.utils.data.DataLoader",
"torch.cuda.amp.autocast",
"torch.cuda.amp.GradScaler",
"torch.optim.SGD"
]
] |
FangHao1993/LineBot-X-PhotoHub- | [
"77164642f610e56dbb720a1d7debc70efdb42382"
] | [
"object_detection/evaluate2.py"
] | [
"#! /usr/bin/env python\n# coding=utf-8\n#================================================================\n# Copyright (C) 2019 * Ltd. All rights reserved.\n#\n# Editor : VIM\n# File name : evaluate.py\n# Author : YunYang1994\n# Created date: 2019-02-21 15:30:26\n# Description :\n#\n#======... | [
[
"numpy.reshape",
"tensorflow.placeholder",
"tensorflow.ConfigProto",
"numpy.copy",
"tensorflow.train.ExponentialMovingAverage",
"tensorflow.name_scope",
"numpy.array"
]
] |
eloqute/WaveRNN | [
"036674b2e3745e22f15f6f945661f5f9d8a63003"
] | [
"models/tacotron.py"
] | [
"import os\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom pathlib import Path\nfrom typing import Union\n\n\nclass HighwayNetwork(nn.Module):\n def __init__(self, size):\n super().__init__()\n self.W1 = nn.Linear(size, size)\n self.W2 = nn.Lin... | [
[
"torch.nn.functional.softmax",
"torch.cat",
"torch.nn.functional.dropout",
"torch.zeros",
"torch.load",
"torch.nn.GRU",
"torch.nn.Embedding",
"torch.tanh",
"torch.tensor",
"torch.nn.LSTMCell",
"torch.nn.MaxPool1d",
"torch.nn.functional.relu",
"torch.nn.GRUCell",... |
gaecom/Paddle | [
"d39d8bee4ee34d44f7012a0e5715f00f3ea31a90"
] | [
"python/paddle/fluid/tests/unittests/test_dygraph_to_static_basic.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 ... | [
[
"numpy.random.random",
"numpy.random.seed"
]
] |
KasiaOtko/Master_thesis | [
"41630cb2d4b7e82ceacc146437645acacbe41428"
] | [
"src/models/gnn_classifiers/GraphSAGE_model.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch import batch_norm, nn\nfrom torch_geometric.nn import BatchNorm, Linear, SAGEConv # type: ignore\n\n\nclass SAGE(nn.Module):\n def __init__(\n self, in_channels: int, hidden_channels: int, out_channels: int, dropout: float, num_layers: int, aggr:... | [
[
"torch.nn.Dropout",
"torch.nn.ModuleList",
"torch.nn.functional.relu",
"torch.batch_norm"
]
] |
RebeccaLeh/todolists | [
"234e5e873374aca9d1af1f40f95832da680decea"
] | [
"export_pitcount.pyt"
] | [
"import xlsxwriter , os, arcpy, sys, string, math, traceback, numpy\r\nimport pandas as df\r\n\r\nclass Toolbox(object):\r\n def __init__(self):\r\n \"\"\"Define the toolbox (the name of the toolbox is the name of the\r\n .pyt file).\"\"\"\r\n self.label = \"Toolbox\"\r\n self.alias =... | [
[
"pandas.DataFrame"
]
] |
hitesh-ag1/expense-tracker | [
"bf5238ef4dbed82aff151f53b2e0784eca7213d3"
] | [
"todayFuncs.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom datetime import datetime\n\ndef todayFilter(data):\n data = data[(data.index.year == datetime.today().year) & (data.index.month == datetime.today().month) &(data.index.day == datetime.today().day)]\n return data\n\ndef transToday(data):\n trans = (data)[['amt'... | [
[
"numpy.negative",
"pandas.Grouper"
]
] |
fellajimed/SparseScatNet | [
"9725e066b4ddb899c8c1ae225ca4a4292fc04e64",
"9725e066b4ddb899c8c1ae225ca4a4292fc04e64"
] | [
"models/Classifier.py",
"models/LinearProj.py"
] | [
"import torch.nn as nn\n\n\nclass Classifier(nn.Module):\n def __init__(self, n_space, nb_channels_in, classifier_type='mlp', nb_classes=1000,\n nb_hidden_units=2048, nb_l_mlp=2, dropout_p_mlp=0.3, avg_ker_size=1):\n super(Classifier, self).__init__()\n\n self.nb_classes = nb_classe... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.functional.avg_pool2d",
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
],
[
"torch.nn.functional.pad"
]
] |
braniii/numba | [
"565a778cbcd0f363bf82e31292ef1b1a3e77a390"
] | [
"numba/cuda/compiler.py"
] | [
"import collections\nimport ctypes\nimport functools\nimport inspect\nimport os\nimport subprocess\nimport sys\nimport tempfile\n\nimport numpy as np\n\nfrom numba import _dispatcher\nfrom numba.core.typing.templates import AbstractTemplate, ConcreteTemplate\nfrom numba.core import (types, typing, utils, funcdesc, ... | [
[
"numpy.ctypeslib.as_array"
]
] |
rogerlew/statsmodels | [
"3c460db864d2039126593d6b61849c8796296adf"
] | [
"statsmodels/tsa/tests/test_ar.py"
] | [
"\"\"\"\nTest AR Model\n\"\"\"\nimport statsmodels.api as sm\nfrom statsmodels.tsa.ar_model import AR\nfrom numpy.testing import (assert_almost_equal, assert_equal, #assert_allclose,\n assert_)\nfrom results import results_ar\nimport numpy as np\nimport numpy.testing as npt\nfrom pandas im... | [
[
"numpy.testing.assert_equal",
"numpy.log",
"pandas.Series",
"numpy.asarray",
"pandas.Index",
"pandas.DatetimeIndex",
"numpy.ones",
"numpy.testing.assert_almost_equal",
"numpy.random.randn"
]
] |
ereidelbach/cfbAnalysis | [
"55366a4305b3f99adab491b38426258b0a28e62f"
] | [
"src/data/scrape_Salaries.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Sep 21 13:56:10 2017\n\n@author: ejreidelbach\n\n:DESCRIPTION:\n - Scrapes Coaching Salary Data from USA Today's Website\n\n:REQUIRES:\n - Refer to `Package Import` section below for required packages\n \n:TODO:\n - NONE\n \n\"\"... | [
[
"pandas.DataFrame",
"pandas.DataFrame.from_dict"
]
] |
Chellison/rcp2 | [
"779f2eb787cce342200f0c43e0988f1008f091ac"
] | [
"src/data/DataLoaders.py"
] | [
"from pathlib import Path\nimport numpy as np\nimport pandas as pd\nfrom src import utils\n\n\nclass ARCPData():\n # american red cross preparedness data \n def __init__(self, ACS, file_name = 'ARC Preparedness Data.csv' ):\n self.data = None\n self.file_name = utils.DATA['master'] / file_name ... | [
[
"pandas.crosstab",
"pandas.to_datetime",
"pandas.read_csv",
"numpy.where"
]
] |
yhcc/fastNLP | [
"5ec58e3b868f07d9b8ac36568168165304d499d4",
"5ec58e3b868f07d9b8ac36568168165304d499d4"
] | [
"fastNLP/core/field.py",
"fastNLP/modules/encoder/char_embedding.py"
] | [
"import torch\n\n\nclass Field(object):\n \"\"\"A field defines a data type.\n\n \"\"\"\n\n def __init__(self, is_target: bool):\n self.is_target = is_target\n\n def index(self, vocab):\n raise NotImplementedError\n\n def get_length(self):\n raise NotImplementedError\n\n def t... | [
[
"torch.LongTensor",
"torch.tensor"
],
[
"torch.empty",
"torch.max",
"torch.nn.LSTM",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.init.orthogonal_",
"torch.nn.functional.tanh",
"torch.squeeze"
]
] |
dacb/eisy | [
"bb948590b03124ddb90d112c07ecf60908735daf"
] | [
"eisy/data/simulation/circuits.py"
] | [
"import numpy as np\n\n\ndef freq_gen(high_freq, low_freq, decades=7):\n '''\n Function that generates the frequency range used to investigate the\n impedance response of an electrical circuit Frequency Generator with\n logspaced freqencies\n\n Parameters\n ----------\n high_freq : single value... | [
[
"numpy.around",
"numpy.log",
"numpy.log10"
]
] |
KTH-dESA/GEOSeMOSYS_Kenya | [
"bb2a525538359845f2e995ca5513d98ec031ce7d"
] | [
"src/Download_files.py"
] | [
"\"\"\"\nModule: Download_files\n=============================\n\nA module that downloads data that is required for the GEOSeMOSYS analysis and unzips them and places them in a new folder\n-------------------------------------------------------------------------------------------------------------------------------... | [
[
"pandas.read_csv"
]
] |
tonybutzer/etm_v3_tony | [
"ec32d94a8730247af90072c49bdb9f81d036af9b"
] | [
"Validate/aws_functions.py"
] | [
"import os\n\nimport pandas as pd\nimport requests\nimport json\nimport sys\nimport boto3\nfrom botocore.exceptions import ClientError\n\n\n# aws stuff here\n\n##-----------------------------------------------------------------------------------------------------------\n# S3 AWS UTILITY FUNCIONS\n\n# ... | [
[
"pandas.read_table"
]
] |
H-C-Orsted-Gym/SO2-opgave | [
"e594ada8f6b9490c0e72f52f08199b7ef8a6f956"
] | [
"main.py"
] | [
"# ALLE KRAV HER:\n\n# - pH skal ligge på 7 - 7,4\n# - Frit klor skal ligge på 0.5-3mg/l\n# - z \n\n# ALLE MÅDER MAN LAVER JUSTERINGER PÅ:\n\n\n# I vores \n\n# HOCL koncentration = frit Klor koncentration / volumen \n# 4.5 pH == HOCL\n\n# HOCl/OCl-\n# Disse chlorforbindelser benævnes ofte samlet\n# som frit chlor... | [
[
"numpy.random.uniform"
]
] |
supriyascode/MODIS-Aggregation | [
"cc6ce992b81c358e6b7cb2635a5b8ff72d6e99f9"
] | [
"benchmarking/spark/monthly-aggregation-pixel-level-spark-sampling.py"
] | [
"from netCDF4 import Dataset\nimport numpy as np\nimport glob\nimport matplotlib.pyplot as plt\nimport time\nimport h5py\nimport sys\nimport xarray as xr\nfrom pyspark.sql import SparkSession\n\ndef aggregateOneFileData(M06_file, M03_file, sampling_rate):\n \"\"\"Aggregate one file from MYD06_L2 and its correspo... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.xlabel",
"numpy.array",
"numpy.zeros",
"numpy.where",
"matplotlib.pyplot.ylabel"
]
] |
Sapphirine/oscar-winner-prediction | [
"7b323bac082937911ff09f8d87a0ecfd66642a02"
] | [
"src/predict.py"
] | [
"import cPickle\nimport json\nimport logging\nimport os\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.metrics import classification_report\nfrom sklearn.preprocessing import scale\n\nfrom models import Adaboost, LogisticReg, SVM\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__nam... | [
[
"sklearn.preprocessing.scale",
"pandas.DataFrame"
]
] |
IrohXu/MAE-ViT-pytorch | [
"725ded18ff688af4d933c2b8b501864d0ef1bfc2"
] | [
"dataloader.py"
] | [
"import os\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom PIL import Image\nimport cv2\nimport numpy as np\n\nfrom torchvision.transforms import ToTensor\nfrom torchvision import datasets, transforms\n\nimport random\n\nclass RandomMaskingGenerator:\n def __init__(self, input_size, mask_ra... | [
[
"numpy.zeros",
"numpy.random.shuffle",
"numpy.ones"
]
] |
HawkTom/EAPY | [
"c9dabbfb233f4a135bf9560bebcf6c01ec9baf94"
] | [
"pso/wPSO.py"
] | [
"# !/usr/bin/env python\n\"\"\"\nwPSO.py\n\nDescription: the implemention of modified particle swarm optimization\n\nRefrence paper:\nShi, Yuhui, and Russell Eberhart. \"A modified particle swarm optimizer.\" \nEvolutionary Computation Proceedings, 1998. IEEE World Congress on Computational Intelligence.\n\nM... | [
[
"numpy.random.seed",
"numpy.min",
"numpy.random.random_sample",
"numpy.ones",
"numpy.argmin"
]
] |
kevintli/mural | [
"e18e7d1a72b561fab1b5da026806e3417a9c63db"
] | [
"examples/sawyer_pick/variants.py"
] | [
"from copy import deepcopy\nfrom ray import tune\nimport numpy as np\nimport tensorflow as tf\n\nfrom softlearning.misc.utils import get_git_rev, deep_update\nfrom softlearning.misc.generate_goal_examples import (\n DOOR_TASKS, PUSH_TASKS, PICK_TASKS)\n# from softlearning.misc.get_multigoal_example_pools import ... | [
[
"numpy.arange",
"numpy.array",
"numpy.random.randint"
]
] |
amirziai/cs224n-project | [
"64f62d8894d2cea10c96c4c83815aa404e1e1056",
"64f62d8894d2cea10c96c4c83815aa404e1e1056"
] | [
"experiments.py",
"archive/pytorch/run.py"
] | [
"import os\nfrom itertools import product\nfrom typing import Dict, Set, List, Any, Tuple\nfrom uuid import uuid4\n\nimport pandas as pd\nfrom joblib import Parallel, delayed\n\nimport params\nimport run\nfrom run import ExperimentResults\nfrom utils import log, merge_dicts, uuid_to_str, pickle_object, unpickle\n\n... | [
[
"pandas.DataFrame"
],
[
"numpy.abs",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.no_grad",
"torch.device",
"numpy.exp"
]
] |
gabririgo/hummingbot | [
"7ae2c7cc04f0bfdb2838371450b838872db314c9"
] | [
"test/test_cross_exchange_market_making.py"
] | [
"#!/usr/bin/env python\n\nfrom os.path import join, realpath\nimport sys;\n\n\nsys.path.insert(0, realpath(join(__file__, \"../../\")))\n\nfrom nose.plugins.attrib import attr\n\nfrom hummingbot.strategy.market_symbol_pair import MarketSymbolPair\nfrom decimal import Decimal\nimport logging; logging.basicConfig(lev... | [
[
"pandas.Timestamp"
]
] |
Photic/mlAllTheCars | [
"b54c9efaf8626bfdbef11508664f096dee06d299"
] | [
"src/R_functions.py"
] | [
"# Some of the functions in this file has been copyed from https://towardsdatascience.com/how-to-write-your-favorite-r-functions-in-python-11e1e9c29089\n\ndef mean(array):\n \"\"\"\n Calculates the mean of an array/vector\n \"\"\"\n import numpy as np\n array=np.array(array)\n result= np.mean(arra... | [
[
"scipy.stats.norm.ppf",
"scipy.stats.ncf.ppf",
"scipy.stats.ncf.pdf",
"scipy.stats.norm.cdf",
"scipy.stats.ncx2.pdf",
"numpy.max",
"numpy.mean",
"scipy.stats.uniform.rvs",
"scipy.stats.binom.ppf",
"scipy.stats.binom.rvs",
"scipy.stats.gamma.cdf",
"scipy.stats.f.rvs"... |
xbe/qcc | [
"90a35057c7fea37187a0cf253eb65613702c51e3"
] | [
"src/solovay_kitaev.py"
] | [
"# python3\n\"\"\"Example: Solovay-Kitaev Algorithm for gate approximation.\"\"\"\n\nimport math\nimport random\n\nfrom absl import app\nimport numpy as np\n\nfrom src.lib import helper\nfrom src.lib import ops\nfrom src.lib import state\n\n\ndef to_su2(U):\n \"\"\"Convert a 2x2 unitary to a unitary with determina... | [
[
"numpy.linalg.eig",
"numpy.arccos",
"numpy.cos",
"numpy.sin",
"numpy.linalg.det",
"numpy.real",
"numpy.trace"
]
] |
BenDavisonPetch/ahfhalotools | [
"d150ac66294e29feb3f43baa0cea135ac12fcb9b"
] | [
"examples/clusterComp/HaloDatavsHaloDataScatterPlot.py"
] | [
"import numpy as np\nimport ahfhalotools.filetools as ft\nfrom ahfhalotools.objects import Cluster\nimport ahfhalotools.analysis as analysis\nfrom astropy.cosmology import FlatLambdaCDM\nfrom astropy.cosmology import WMAP9\nfrom astropy import units as au\nimport matplotlib.pyplot as plt\nimport matplotlib.colors a... | [
[
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
]
] |
gbisschoff/Z-model | [
"98e34799ccedfc52a6f5f6958f5e0ebeca1aa5f3"
] | [
"src/z_model/exposure_at_default.py"
] | [
"from numpy import array, repeat, arange, cumprod, cumsum, maximum, minimum, ceil\nfrom pandas import Series\nfrom .account import Account\nfrom .effective_interest_rate import EffectiveInterestRate\nfrom .assumptions import EADAssumptions\nfrom .scenarios import Scenario\n\nclass ConstantExposureAtDefault:\n de... | [
[
"numpy.maximum",
"pandas.Series",
"numpy.arange",
"numpy.cumsum",
"numpy.ceil",
"numpy.cumprod"
]
] |
batikim09/translate | [
"ae275549c414a68af783a87cb2eacc303a0553b0",
"ae275549c414a68af783a87cb2eacc303a0553b0"
] | [
"pytorch_translate/research/adversarial/adversarial_utils.py",
"pytorch_translate/test/test_beam_decode.py"
] | [
"#!/usr/bin/env python3\n\nimport re\n\nimport torch\nimport torch.nn.functional as F\n\n\n# Delimiter for the word to word file\nblank_delim = re.compile(r\"[ \\t]+\")\n\n\ndef pairwise_dot_product(src_embeds, vocab_embeds, cosine=False):\n \"\"\"Compute the cosine similarity between each word in the vocab and ... | [
[
"torch.nn.functional.normalize",
"torch.rand_like",
"torch.einsum",
"torch.is_tensor",
"torch.nn.functional.relu",
"torch.log"
],
[
"torch.LongTensor",
"numpy.sort",
"torch.FloatTensor",
"torch.cuda.device_count",
"numpy.array",
"numpy.zeros"
]
] |
Jaimedlrm/entropytriangle | [
"46076aa6e9e06777df4dcf885cd951afdf1de168"
] | [
"entropytriangle/ternary/helpers.py"
] | [
"\"\"\"\nHelper functions and utilities for projecting to the simplex and various tasks.\n\"\"\"\n\nimport numpy\n\n\n### Constants ###\n\nSQRT3 = numpy.sqrt(3)\nSQRT3OVER2 = SQRT3 / 2.\n\n### Auxilliary Functions ###\n\n\ndef unzip(l):\n \"\"\"[(a1, b1), ..., (an, bn)] ----> ([a1, ..., an], [b1, ..., bn])\"\"\"... | [
[
"numpy.dot",
"numpy.deg2rad",
"numpy.array",
"numpy.sqrt"
]
] |
mjam03/epl | [
"ded3a931059f967366b1cc791ab466266b9a5332"
] | [
"epl/features_parse.py"
] | [
"import datetime as dt\nfrom functools import reduce\nimport numpy as np\nimport pandas as pd\n\nfrom epl.query import create_and_query, create_conn, get_table_columns, query_creator, query_db, table_exists\n\nFEATURE_KEY_COLS = ['Date', 'Team']\nFEATURE_ID_COLS = ['Country', 'Div', 'Season']\n\n\ndef create_featur... | [
[
"pandas.merge",
"numpy.where",
"pandas.merge_asof"
]
] |
davidinouye/failing-loudly | [
"6eee78530d48b83cef41ee5a4faa82d6fd1d892b"
] | [
"shift_tester.py"
] | [
"# -------------------------------------------------\n# IMPORTS\n# -------------------------------------------------\n\nimport numpy as np\nimport torch\nfrom torch import *\nfrom torch_two_sample import *\nfrom scipy.stats import ks_2samp, binom_test, chisquare, chi2_contingency, anderson_ksamp\nfrom scipy.spatial... | [
[
"scipy.stats.ks_2samp",
"scipy.stats.chi2_contingency",
"numpy.unique",
"numpy.min",
"scipy.stats.binom_test",
"numpy.median",
"numpy.amin",
"scipy.spatial.distance.cdist",
"torch.tensor",
"scipy.stats.chisquare",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
SiddeshSambasivam/pytorch | [
"ef5ac15f592f335eeb314bfceaf5d9af953ad15b"
] | [
"test/test_jit.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\n\n# This is how we include tests located in test/jit/...\n# They are included here so that they are invoked when you call `test_jit.py`,\n# do not run these test files directly.\nfrom jit.test_tracer import TestTracer, TestMixTracingScripting # noqa: F401\nfrom jit.test_recu... | [
[
"torch.BoolTensor",
"torch.jit.load",
"torch.randint",
"torch.lu_unpack",
"torch._C.PyTorchFileWriter",
"torch.testing._internal.jit_utils.get_execution_plan",
"torch.zeros",
"torch.nn.functional.dropout",
"torch.max",
"torch.nn.GRU",
"torch.neg",
"torch.testing._in... |
panda0881/Selectional_Preference | [
"e48c5ff3feade82fd7f6963bca8135989ce148fe"
] | [
"Label_data_preparation.py"
] | [
"from nltk.corpus import wordnet as wn\nfrom nltk.corpus import verbnet\nimport pandas\nimport json\nimport xml.etree.ElementTree as etree\nimport os\nimport random\n\n\ndef filter_word(input_word):\n tmp_output = ''\n for c in input_word:\n if c in 'zxcvbnmasdfghjklqwertyuiopZXCVBNMASDFGHJKLQWERTYUIOP... | [
[
"pandas.read_csv"
]
] |
Remosy/iceHocekeyIRL | [
"1ffeaf8a9bd9585038629be41a2da552e0a4473b"
] | [
"Demo/Demo_gym/envs/mujoco/humanoidstandup.py"
] | [
"from Demo_gym.envs.mujoco import mujoco_env\nfrom Demo_gym import utils\nimport numpy as np\n\nclass HumanoidStandupEnv(mujoco_env.MujocoEnv, utils.EzPickle):\n def __init__(self):\n mujoco_env.MujocoEnv.__init__(self, 'humanoidstandup.xml', 5)\n utils.EzPickle.__init__(self)\n\n def _get_obs(s... | [
[
"numpy.concatenate",
"numpy.square"
]
] |
matthijsz/etchasketch | [
"336186cb566a8716595b0de45ad9cebc3043092b"
] | [
"pointerclass.py"
] | [
"import cv2, random, time, imageio,os, argparse, datetime, multiprocessing, tkinter\r\nimport numpy as np\r\nfrom PIL import Image\r\nfrom scipy.spatial.distance import cdist\r\nimport PIL.Image, PIL.ImageTk\r\nfrom tkinter import filedialog\r\nfrom joblib import Parallel, delayed\r\nfrom my_gui import *\r\nfrom Go... | [
[
"numpy.uint8",
"numpy.zeros",
"numpy.where",
"numpy.transpose"
]
] |
AntoineGuillot2/RLFirmStrategy | [
"1ab7b59ccad2bbcad641f83dbad552e39b0f1591"
] | [
"CNN_market_reaction/Firm.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 23 10:47:13 2018\n\n@author: antoine\n\"\"\"\nimport numpy as np\nfrom keras.models import Model\nfrom keras.layers import Input,Dense, Conv1D, MaxPooling1D, Concatenate, Flatten\n\n\nclass Firm:\n def __init__(self,params,observation_s... | [
[
"numpy.random.choice",
"numpy.concatenate",
"numpy.max",
"numpy.std",
"numpy.argmax",
"numpy.shape",
"numpy.mean",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
mjarrett/bikeraccoonAPI | [
"c3b15e63c4e6f32eaa6464ef86d4399733dd4919"
] | [
"bikeraccoonAPI/query_functions.py"
] | [
"import pandas as pd\nimport json\nimport requests\nimport datetime as dt\nimport timeout_decorator\nimport ssl\n\nimport logging\nlogger = logging.getLogger(\"Rotating Log\")\n\ndef get_station_status_url(sys_url):\n data = requests.get(sys_url).json()\n return [x for x in data['data']['en']['feeds'] if x['n... | [
[
"pandas.DataFrame"
]
] |
Ali1999-AK/heart-prediction-ML-and-Flask | [
"d14e65cd918c8da0b6a2b35594c6708fd0e3ef19"
] | [
"Heart_D/heart.py"
] | [
"import numpy as np\r\nimport pandas as pd\r\nfrom sklearn import *\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.ensemble import RandomForestClassifier\r\nfrom sklearn.svm import SVC\r\nimport warnings\r\nimport pickle\r\nwarnings.filterwarnings(\"ignore\")\r\n\r\ndata = pd.read_csv('hear... | [
[
"numpy.array",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.RandomForestClassifier"
]
] |
tylerbinski/recordlinkage | [
"5b3230f5cff92ef58968eedc451735e972035793"
] | [
"recordlinkage/algorithms/indexing.py"
] | [
"\"\"\"Algorithms for indexing.\"\"\"\n\nimport numpy as np\n\nfrom recordlinkage.measures import full_index_size\n\n\ndef _map_tril_1d_on_2d(indices, dims):\n \"\"\"Map 1d indices on lower triangular matrix in 2d. \"\"\"\n\n N = (dims * dims - dims) / 2\n\n m = np.ceil(np.sqrt(2 * N))\n c = m - np.roun... | [
[
"numpy.sqrt",
"numpy.unique",
"numpy.arange",
"numpy.append",
"numpy.mod",
"numpy.array",
"numpy.unravel_index",
"numpy.random.RandomState"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.