repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ocatias/Research_KnowledgeGraph | [
"0b1407b0846badd41bd59f0785dc9b9512191dd6"
] | [
"src/data_preprocessing.py"
] | [
"import ijson\nimport pickle\nimport csv\nimport os\nimport sys\nimport gc\nimport time\nfrom numpy import random\n\n# Path to the 12gb arxiv dataset\npath_dataset = \"..\\data\\dblp.v12.json\"\n\npath_dataset_cities = \"..\\data\\cities15000.txt\"\n\n# Path were we will store the dataset as a python dict\n#path_pi... | [
[
"numpy.random.rand"
]
] |
MTonyM/PReMVOS | [
"3d01f0c6156628083a4c8441b4b57622c500e04e",
"3d01f0c6156628083a4c8441b4b57622c500e04e",
"3d01f0c6156628083a4c8441b4b57622c500e04e"
] | [
"code/refinement_net/forwarding/FewShotSegmentationForwarder.py",
"code/refinement_net/network/deeplab/model.py",
"code/ReID_net/datasets/Custom/Custom.py"
] | [
"from math import ceil\n\n\nfrom refinement_net.forwarding.Forwarder import Forwarder\nfrom refinement_net.core import Measures, Extractions\nfrom refinement_net.core.Timer import Timer\nfrom refinement_net.datasets import DataKeys\n# import DataKeys\nfrom refinement_net.core.Measures import accumulate_measures, me... | [
[
"numpy.asfortranarray"
],
[
"tensorflow.image.resize_bilinear",
"tensorflow.shape",
"tensorflow.reverse_v2",
"tensorflow.concat",
"tensorflow.expand_dims",
"tensorflow.argmax",
"tensorflow.logging.info",
"tensorflow.add_n",
"tensorflow.variable_scope",
"tensorflow.g... |
hoechenberger/pycircstat | [
"53d2efdf54c394fd9ecff8d47eaae165c1458fb0"
] | [
"tests/test_event_series.py"
] | [
"from __future__ import absolute_import\n\nimport numpy as np\n\nfrom numpy.testing import assert_allclose\nfrom nose.tools import assert_equal, assert_true\n\nimport pycircstat\nfrom pycircstat import event_series as es\n\n\ndef test_vector_strength_spectrum():\n T = 3 # 2s\n sampling_rate = 10000.\n fir... | [
[
"numpy.testing.assert_allclose",
"numpy.random.poisson",
"numpy.where"
]
] |
jasonbian97/ptlflow | [
"8a7307af1c0b241108f3125cb716d64a18c1b87e"
] | [
"ptlflow/models/flownet/submodules.py"
] | [
"# freda (todo) : \n\nimport torch.nn as nn\nimport torch\nimport numpy as np\ntry:\n from spatial_correlation_sampler import spatial_correlation_sample\nexcept ModuleNotFoundError:\n from ptlflow.utils.correlation import iter_spatial_correlation_sample as spatial_correlation_sample\n\ndef conv(batchNorm, in_... | [
[
"numpy.ceil",
"numpy.zeros",
"torch.nn.LeakyReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.BatchNorm2d",
"torch.from_numpy",
"torch.nn.Conv2d"
]
] |
pyun-ram/uncertainty-baselines | [
"b9c6b870790034c1a2303246f887fd2cf53bff38",
"b9c6b870790034c1a2303246f887fd2cf53bff38"
] | [
"uncertainty_baselines/datasets/places.py",
"uncertainty_baselines/datasets/clinc_intent.py"
] | [
"# coding=utf-8\n# Copyright 2021 The Uncertainty Baselines 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# Unles... | [
[
"tensorflow.compat.v2.cast",
"tensorflow.compat.v2.random.experimental.stateless_fold_in"
],
[
"tensorflow.compat.v2.data.Dataset.list_files",
"tensorflow.compat.v2.keras.preprocessing.text.tokenizer_from_json",
"tensorflow.compat.v2.io.parse_example",
"tensorflow.compat.v2.io.FixedLen... |
rsprouse/ultratils | [
"f106ea99f0eaf6cd1c3dd36e0b5539a9d724a962"
] | [
"ultratils/taptest.py"
] | [
"from __future__ import division\nimport numpy as np\nfrom scipy import ndimage\nimport scipy.signal as signal\nimport scipy.io.wavfile\n\nfrom ultratils.pysonix.bprreader import BprReader\n\n# Algorithms to analyze taptests.\n\ndef peakdiff(wavfile):\n '''Find tap by 'peakdiff' algorithm, which finds the peak o... | [
[
"numpy.float",
"numpy.zeros",
"numpy.mean",
"numpy.std",
"numpy.where",
"numpy.abs"
]
] |
pkassotis/detectron2 | [
"e49c7882468229b98135a9ecc57aad6c38fea0a0"
] | [
"setup.py"
] | [
"#!/usr/bin/env python\n# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport glob\nimport os\nimport shutil\nfrom os import path\nfrom setuptools import find_packages, setup\nfrom typing import List\nimport torch\nfrom torch.utils.cpp_extension import CUDA_HOME, CppExtension, CUDAExtension\nfrom torch.utils... | [
[
"torch.__version__.split",
"torch.cuda.is_available",
"torch.utils.hipify.hipify_python.hipify",
"torch.utils.hipify.__version__.split"
]
] |
leomauro/pysptk | [
"bcd76ccefbbd60c9f864bd26f3d9ad223c82a5c7"
] | [
"pysptk/sptk.py"
] | [
"# coding: utf-8\n\n\"\"\"\nLibrary routines\n----------------\n.. autosummary::\n :toctree: generated/\n\n agexp\n gexp\n glog\n mseq\n acorr\n\nAdaptive cepstrum analysis\n--------------------------\n.. autosummary::\n :toctree: generated/\n\n acep\n agcep\n amcep\n\nMel-generalized ... | [
[
"numpy.log",
"scipy.linalg.solve_toeplitz",
"numpy.sqrt",
"numpy.empty_like"
]
] |
maxgenettiUCSC/cytracepy | [
"8aa3e06560e078acc8896f830cd01ba148bcfec2"
] | [
"cytracepy/manipulation.py"
] | [
"\"\"\"\nCommon matrix manipulation operations needed for comparing\nbranches and trajectories.\n\"\"\"\nimport pandas as pd\n\n\ndef order(matrix, psuedotime):\n \"\"\"Order the rows of a matrix by rank of psuedotime.\n \n Arguments:\n matrix (pandas DataFrame): samples x features (rows x cols) mat... | [
[
"pandas.DataFrame"
]
] |
LBJ-Wade/phenom | [
"8f0fdc14099dac09cb2eef36d825e577340a8421"
] | [
"examples/ifft/tdfd.py"
] | [
"from phenom.utils import pad_to_pow_2, planck_taper\nfrom scipy.fftpack import fft, fftfreq, fftshift, ifft\nfrom numpy import arange, pi, exp\n\ndef my_fft(t, h):\n\n # compute frequencies\n dt = t[1] - t[0]\n N = len(h)\n f = fftfreq( N, dt )\n\n # compute fft\n htilde = fft( h ) * dt\n\n re... | [
[
"scipy.fftpack.fftfreq",
"scipy.fftpack.ifft",
"numpy.exp",
"scipy.fftpack.fft",
"numpy.arange"
]
] |
zhuang13atJHU/dolo | [
"a40c82f3c87e7a051b56fb9d1a0d646433481167"
] | [
"dolo/compiler/derivatives.py"
] | [
"import ast\nfrom ast import BinOp, Compare, Sub\nimport sympy\nimport numpy\n\nfrom dolo.compiler.function_compiler_sympy import ast_to_sympy, compile_higher_order_function\n\nfrom dolang.symbolic import stringify, stringify_symbol\n\n\ndef timeshift(expr, variables, date):\n from sympy import Symbol\n from ... | [
[
"numpy.concatenate"
]
] |
RyanWangZf/VITA-Rec | [
"b640e9c5cd4259c605cc2d9752e78b9a77672c1b"
] | [
"test_mf_alpha_yahoo.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport pandas as pd\nimport torch\nimport pdb\nimport os\nfrom sklearn.metrics import roc_auc_score\nnp.random.seed(2020)\ntorch.manual_seed(2020)\n\nfrom dataset import load_data\nfrom matrix_factorization import MF, MF_CVIB, MF_IPS, MF_SNIPS\n\nfrom matrix_factorizati... | [
[
"numpy.array",
"numpy.random.seed",
"numpy.sum",
"numpy.mean",
"torch.manual_seed",
"sklearn.metrics.roc_auc_score"
]
] |
keotl/vision_project | [
"5601562e7562ebf005a067d93e3f3a90d9097c42"
] | [
"vision_project/vision/image.py"
] | [
"import cv2\nimport numpy as np\n\nfrom vision_project.vision.util import Mask, PixelCoordinate\n\n\nclass Image:\n\n def __init__(self, opencv_frame):\n self.frame = opencv_frame\n\n def to_color_space(self, color_space_transform) -> \"Image\":\n new_frame = cv2.cvtColor(self.frame, color_space... | [
[
"numpy.array",
"numpy.ones"
]
] |
akshaybahadur21/keras-preprocessing | [
"6dff68839f9f8235df167a9e7a1f170752408a5d"
] | [
"keras_preprocessing/image/utils.py"
] | [
"\"\"\"Utilities for real-time data augmentation on image data.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport warnings\n\nimport numpy as np\n\ntry:\n from PIL import ImageEnhance\n from PIL import Image as pil_imag... | [
[
"numpy.max",
"numpy.min",
"numpy.asarray"
]
] |
mdrumond/tensorflow-rmsspec2 | [
"ec6c992fa41c88bcc4c38350c10db40cd04ee9af"
] | [
"ssd/simpleDnn_model.py"
] | [
"\n\"\"\"Builds the simple MNIST network\n\nThe network is composed by:\nInput [28*28] -> Layer1 [300] -> Output [10]\n\nThe loss function used os logSoftMax\"\"\"\n\nimport math\nimport tensorflow as tf\n\n# pylint: disable=E1101\n\n# The MNIST dataset has 10 classes, representing the digits 0 through 9.\nNUM_CLAS... | [
[
"tensorflow.exp",
"tensorflow.nn.in_top_k",
"tensorflow.size",
"tensorflow.range",
"tensorflow.zeros",
"tensorflow.concat",
"tensorflow.expand_dims",
"tensorflow.matmul",
"tensorflow.Variable",
"tensorflow.pack",
"tensorflow.histogram_summary",
"tensorflow.scalar_su... |
DrMarkusReinhardt/MySimple4ChannelDAS | [
"6fbc31bd0fd80cd27429e850afb3791038de097e"
] | [
"SW/PC/EvalMeasurementsFromArduinoOnPC.py"
] | [
"#!/usr/local/bin/python3\n# -*- coding:utf-8 -*-\n\"\"\"\nPC program to evaluate temperature measurements from a sensor connected to an Arduino board\n(suited for Max OSX, Windows, Linux)\n\nCreated 29th March 2021\n\nLast change on 31st March 2021\n\n@author: Dr. Markus Reinhardt\n\n\"\"\"\nfrom __future__ import... | [
[
"matplotlib.use",
"numpy.ones",
"matplotlib.figure.Figure",
"numpy.mean"
]
] |
rdkannao/tensorflow-yolo-v3 | [
"a4287f5513be137f976431967e38fa1bbeb57ee1"
] | [
"convert_weights_pb.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport tensorflow as tf\nimport yolo_v3\nimport yolo_v3_tiny\nfrom PIL import Image, ImageDraw\n\nfrom utils import load_weights, load_coco_names, detections_boxes, freeze_graph\n\nFLAGS = tf.app.flags.FLAGS\n\ntf.app.flags.DEFINE_string(\n 'class_names', 'coco.nam... | [
[
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.Session",
"tensorflow.global_variables",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.app.run",
"tensorflow.app.flags.DEFINE_bool"
]
] |
jovany-wang/arrow | [
"1f30466ac7042354de35cc69fd49ced1acd54b38"
] | [
"python/pyarrow/tests/test_pandas.py"
] | [
"# 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.0 (the\n# \"License\"); y... | [
[
"pandas.SparseArray",
"numpy.random.rand",
"pandas.DatetimeIndex",
"pandas.Timestamp.now",
"pandas.Timestamp",
"numpy.where",
"pandas.concat",
"numpy.frombuffer",
"pandas.period_range",
"numpy.dtype",
"numpy.empty",
"pandas.DataFrame",
"numpy.random.randint",
... |
dan-garvey/pytorch-lightning | [
"79c4e5de60685dbc895641b0139ffc6180d069aa"
] | [
"pytorch_lightning/strategies/ddp_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.distributed.broadcast_object_list",
"torch.multiprocessing.spawn",
"torch.distributed.get_backend",
"torch.multiprocessing.get_context",
"torch.cuda.set_device",
"torch.cuda.empty_cache",
"torch.tensor",
"torch.distributed.barrier"
]
] |
omartinez182/stable-baselines3 | [
"2e25500d56796a20706faeccd9ab36a0c37ec8ca"
] | [
"stable_baselines3/a2c_nstep/a2c_nstep.py"
] | [
"from typing import Any, Dict, Optional, Type, Union\n\nimport torch as th\nfrom gym import spaces\nfrom torch.nn import functional as F\n\nfrom stable_baselines3.common.on_policy_algorithm import OnPolicyAlgorithm\nfrom stable_baselines3.common.on_policy_algorithm_nstep import OnPolicyAlgorithm_nstep\nfrom stable_... | [
[
"torch.nn.functional.mse_loss",
"torch.exp",
"torch.mean"
]
] |
yolanda314/PaddleSpeech | [
"94e5e37b060a0126d83788669a0d28d6db509579"
] | [
"paddlespeech/s2t/frontend/speech.py"
] | [
"# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.concatenate"
]
] |
AtharvaKatre/HelloDash | [
"e9f0d0abed895197002bdf3fe23c0fe21c7ecbe3"
] | [
"apps/DataTable.py"
] | [
"\"\"\"\nThis module is imported in the component_gallery.py and demonstrates how to style a\nDash DataTable to look better with Bootstrap themes.\n\nTo keep things organized:\n long descriptions and code examples are in text.py\n cards like a list of links are created in cheatsheet.py and imported here\n\nCa... | [
[
"pandas.read_csv"
]
] |
unlearnai/genemunge | [
"a7dc07706ae2bf487a04fcda5623013c055030a3"
] | [
"genemunge/search.py"
] | [
"import os, json, pandas\nfrom itertools import chain\n\n\nFILEPATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')\nGONAME = os.path.join(FILEPATH, 'go.json')\nATTRIBUTENAME = os.path.join(FILEPATH, 'gene_attributes.json')\nGTEXPATH = os.path.join(FILEPATH, 'gtex')\n\n\nclass Searcher(object):\n... | [
[
"pandas.read_hdf"
]
] |
cxrodgers/Rodgers2021 | [
"cbcc166f9c06b18022cec91a289a1e84ece791ae"
] | [
"05_behavior_vis/main7a2.py"
] | [
"## Plot lick histograms over course of trial\n# now also with contact histograms\n\n\"\"\"\n1I, left\t \n PLOT_LICK_AND_CONTACT_RATE_OVER_TIME\t\n Lick rate versus time in trial\n1I, right\t\n PLOT_NORMALIZED_CONTACT_RATE_AND_LICK_CORRECT_AND_CONCORDANT_RATE_OVER_TIME\t\n Correct/concordant lick pro... | [
[
"pandas.cut",
"matplotlib.pyplot.subplots",
"numpy.diff",
"numpy.allclose",
"pandas.concat",
"matplotlib.pyplot.show",
"numpy.linspace",
"pandas.Series"
]
] |
crockwell/sg2im | [
"662fd6b802d12258f7f7586dfb91920e82f2f7a5"
] | [
"vqa_analysis.py"
] | [
"import argparse\nimport h5py\nimport tqdm\nimport numpy as np\nimport pickle\nimport PIL\nimport yaml\nimport torch\nfrom torch import nn\nfrom torch.autograd import Variable\nimport json\nimport os\nimport sys\nfrom tensorboardX import SummaryWriter\nfrom datetime import datetime\nfrom sg2im.data.utils import ima... | [
[
"torch.device",
"numpy.array",
"numpy.median",
"torch.no_grad",
"numpy.tile",
"torch.from_numpy",
"torch.LongTensor",
"torch.load"
]
] |
stoicio/RoboCar | [
"65591e8c217e61d0571df39fe9d9993e5984d8fe"
] | [
"projects/advanced_lane_lines/lane_detector/utils/lane_detector.py"
] | [
"import cv2\n\nfrom . import lane_line\n\nimport numpy as np\n\n\nclass LaneDetector(object):\n def __init__(self, camera_calibration, perspective_transform, process_stream=False):\n '''Build a lane detector object that can process a single frame\n or a stream of camera frames\n camera_calib... | [
[
"numpy.int32",
"numpy.zeros_like",
"numpy.ones",
"numpy.stack"
]
] |
ThiagoPanini/voice-unlocker | [
"a0efaf21d40c898e11f09dbd696d8cd4ddd6b1c9"
] | [
"main.py"
] | [
"\"\"\"\nScript principal do projeto Voice Unlocker responsável\npor coordenar o recebimento de novos áudios a serem\nvalidados e a execução do modelo preditivo treinado\npreviamente de modo a apresentar um resultado ao\nexecutor do código.\n\n------------------------------------------------------\n ... | [
[
"pandas.DataFrame"
]
] |
Naereen/MetaLearningGP | [
"f2b7bdea594b31ad3046d910e6e41e2c9ff3e0fc"
] | [
"gpflow_mod/conditionals.py"
] | [
"# Copyright 2016 Valentine Svensson, James Hensman, alexggmatthews\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 req... | [
[
"tensorflow.matrix_transpose",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.sqrt",
"tensorflow.stack",
"tensorflow.tile",
"tensorflow.einsum",
"tensorflow.shape",
"tensorflow.matrix_diag_part",
"tensorflow.transpose",
"tensorflow.cholesky",
"tensorflow.zer... |
gokceuludogan/FaceIdentificationInArtwork | [
"9145c824bd8cb327677004f64484dd480b802ea7"
] | [
"face_identification_with_lbp.py"
] | [
"import multiprocessing\nimport os\nfrom tqdm import tqdm\nfrom lbp import lbp_features,lbp_skimage\nimport pickle\nimport numpy as np\nfrom sklearn.model_selection import cross_val_score, KFold, GridSearchCV\nfrom sklearn import metrics\nimport cv2 \nimport sys\nfrom sklearn.svm import SVC\nfrom pathlib import Pat... | [
[
"numpy.array",
"numpy.asarray",
"sklearn.model_selection.GridSearchCV",
"pandas.DataFrame",
"sklearn.svm.SVC",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.train_test_split"
]
] |
jlaura/autocnet | [
"4e1556ef5ee8a280787f911135ae4780c550a75a"
] | [
"autocnet/transformation/fundamental_matrix.py"
] | [
"import warnings\nimport numpy as np\nimport pandas as pd\nfrom scipy import optimize\nfrom autocnet.camera import camera\nfrom autocnet.camera import utils as camera_utils\nfrom autocnet.utils.utils import make_homogeneous, normalize_vector\n\ntry:\n import cv2\n cv2_avail = True\nexcept: # pragma: no cover... | [
[
"numpy.column_stack",
"numpy.linalg.matrix_rank",
"numpy.asarray",
"pandas.DataFrame",
"numpy.sqrt",
"numpy.abs",
"numpy.linalg.svd",
"numpy.inner",
"pandas.Series",
"numpy.diag"
]
] |
jeffhsu3/anndata | [
"762fdb924e757cdd7582312b0fa5034cc579c49d"
] | [
"anndata/_core/anndata.py"
] | [
"\"\"\"\\\nMain class and helper functions.\n\"\"\"\nimport warnings\nimport collections.abc as cabc\nfrom collections import OrderedDict\nfrom copy import deepcopy\nfrom enum import Enum\nfrom functools import reduce\nfrom pathlib import Path\nfrom os import PathLike\nfrom typing import Any, Union, Optional # Met... | [
[
"numpy.random.choice",
"scipy.sparse.isspmatrix_csr",
"pandas.concat",
"pandas.core.index.RangeIndex",
"pandas.api.types.is_categorical",
"numpy.dtype",
"numpy.concatenate",
"numpy.empty",
"pandas.DataFrame",
"pandas.api.types.is_string_dtype",
"numpy.in1d",
"scipy.... |
kumasento/pytorch-OpCounter | [
"b3b918389bcb0c576276226166b48dab6a0cbb11"
] | [
"thop/count_hooks.py"
] | [
"import argparse\n\nimport torch\nimport torch.nn as nn\n\nmultiply_adds = 2\n\n\ndef count_conv2d(m, x, y):\n\tx = x[0]\n\n\tcin = m.in_channels\n\tcout = m.out_channels\n\tkh, kw = m.kernel_size\n\tbatch_size = x.size()[0]\n\n\tout_h = y.size(2)\n\tout_w = y.size(3)\n\n\t# ops per output element\n\t# kernel_mul =... | [
[
"torch.Tensor"
]
] |
giovgiac/neptune | [
"a3cc256d3f3d833be2b8654131726ab48482f5e1",
"a3cc256d3f3d833be2b8654131726ab48482f5e1"
] | [
"optimizers/radam.py",
"datasets/triplet_dataset.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.minimum",
"tensorflow.where",
"tensorflow.group",
"tensorflow.keras.backend.epsilon",
"tensorflow.sqrt",
"tensorflow.control_dependencies",
"tensorflow.maximum",
"tensorflow.pow",
"tensorflow.gather",
"tensorflow.square",
... |
JohannesLiu/Deep-Learning-Loss-Function-Collection-for-Imbalanced-Data | [
"31f3fdd764db3662113ee3f42ad763e0792c47ca"
] | [
"losses/Accuracy.py"
] | [
"import torch.nn as nn\nimport torch\n\n\ndef accuracy(pred, target, topk=1):\n assert isinstance(topk, (int, tuple))\n if isinstance(topk, int):\n topk = (topk, )\n return_single = True\n else:\n return_single = False\n\n res = []\n mask = target >= 0\n for k in topk:\n ... | [
[
"torch.tensor"
]
] |
JorgeDeLosSantos/curso_mecanica_de_materiales | [
"1baf8c3cfe4b6c29cc9b109b23a7572b28d510bb"
] | [
"tareas/proyecto_01/prj01/ui.py"
] | [
"# -*- coding: utf8 -*-\n# ---------------------------------------------------------\n# Author: Pedro Jorge De Los Santos\n# E-mail: delossantosmfq@gmail.com\n# Source: http://github.com/JorgeDeLosSantos/wxpython-demos\n# License: MIT License\n# ---------------------------------------------------------\n#\n\"\"\"\n... | [
[
"numpy.random.random",
"numpy.zeros"
]
] |
apeterswu/fairseq_mix | [
"0f96d323d32edfdef19773f812970a76e618aad2"
] | [
"fairseq/sequence_scorer_ranking.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport torch\n\nfrom f... | [
[
"torch.is_tensor",
"torch.no_grad",
"torch.argmax"
]
] |
Evangeline98/Legal-AI | [
"4d6e01e7956f2f1940f803bc7c9599581a992a2d"
] | [
"law/utils.py"
] | [
"import re\nimport pandas as pd\nimport numpy as np\nimport jieba.posseg as pseg\nimport pymysql\n\n\ndef find_law_in_series(series):\n '''\n Input:\n Pandas Series\n\n Output:\n Law and its tiao and kuan\n First layer: Iterate through all rows in the Pandas Series\n Second laye... | [
[
"pandas.isnull",
"pandas.DataFrame"
]
] |
sbittner12/midi-wavenet | [
"206197801059b5cf307160dae13c7b65f1c271e1"
] | [
"generate.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nfrom datetime import datetime\nimport json\nimport os\n\nimport librosa\nimport numpy as np\nimport tensorflow as tf\n\nfrom wavenet import WaveNetModel, mu_law_decode, mu_law_encode, audio_reader\nfrom wavenet.midi_reader.m... | [
[
"numpy.array",
"tensorflow.size",
"tensorflow.train.latest_checkpoint",
"numpy.count_nonzero",
"numpy.zeros",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.global_variables",
"tensorflow.constant",
"tensorflow.placeholder",
"numpy.random.randint",
"ten... |
joaoantoniocardoso/python-control | [
"1ab67560db5319843a2c43a20944da061011399d"
] | [
"control/tests/convert_test.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"convert_test.py\n\nTest state space and transfer function conversion.\n\nCurrently, this unit test script is not complete. It converts several random\nstate spaces back and forth between state space and transfer function\nrepresentations. Ideally, it should be able to assert that t... | [
[
"numpy.matrix",
"numpy.array",
"numpy.linalg.matrix_rank",
"numpy.asarray",
"numpy.sin",
"numpy.random.seed",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_array_almost_equal",
"numpy.cos"
]
] |
zanussbaum/Transformers4Rec | [
"8a755e04968293b75ef3f489f74ecd70d8833a9d"
] | [
"transformers4rec/torch/utils/examples_utils.py"
] | [
"import glob\nimport os\n\nimport numpy as np\n\n\ndef list_files(startpath):\n \"\"\"\n Util function to print the nested structure of a directory\n \"\"\"\n for root, dirs, files in os.walk(startpath):\n level = root.replace(startpath, \"\").count(os.sep)\n indent = \" \" * 4 * (level)\n... | [
[
"numpy.argpartition"
]
] |
cshardin/optic-model | [
"5b47e63e3f5300fc5421de95b0b6806921ca9e8d"
] | [
"src/material.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nMaterials that reflect or refract.\n\nFor now, these are idealized and reflect or transmit 100% of light.\n\nA material should have boolean variable `is_reflector` which is True for reflectors\nand False for refractors.\n\nWhen `is_reflector` is False, the material should have metho... | [
[
"numpy.array",
"numpy.sqrt"
]
] |
zhiqwang/ppl.nn | [
"ddb31bff5ae89379a3d97f319880510aeff33caf"
] | [
"samples/python/maskrcnn_onnx/run_maskrcnn_onnx.py"
] | [
"import sys\nimport logging\nimport cv2\nimport numpy as np\nimport argparse\nfrom pyppl import nn as pplnn\nfrom pyppl import common as pplcommon\n\nlogging.basicConfig(level=logging.INFO)\n\ncoco_classes = [\n 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train',\n 'truck', 'boat', '... | [
[
"numpy.random.seed",
"numpy.array",
"numpy.random.randint",
"numpy.fromfile"
]
] |
Epsilon-Lee/fairseq-da | [
"9aa156956a3da28b2d275016b899ed77c8c54005"
] | [
"tests/speech_recognition/asr_test_base.py"
] | [
"#!/usr/bin/env python3\n\nimport argparse\nimport os\nimport unittest\nfrom inspect import currentframe, getframeinfo\n\nimport numpy as np\nimport torch\nfrom examples.speech_recognition.data.data_utils import lengths_to_encoder_padding_mask\nfrom fairseq.data import data_utils as fairseq_data_utils\nfrom fairseq... | [
[
"torch.zeros",
"torch.arange",
"torch.is_tensor",
"numpy.random.randn",
"torch.from_numpy",
"numpy.random.randint",
"torch.tensor",
"torch.div",
"torch.randn"
]
] |
danaiefst/GaitTracking | [
"5911d556f02fd676039fcb161707589f4bc234ae"
] | [
"cgdata.py"
] | [
"from matplotlib import pyplot as plt\nimport numpy as np\nfrom time import sleep\nimport torch\nimport os\n\nnp.random.seed(0)\n\nMAXX = 0.5\nMINX = -0.5\nMAXY = 1.2\nMINY = 0.2\nimg_side = 112\n\naccel = 8\n\nclass leg:\n\n def __init__(self, radius, offsetx, offsety, ampx, ampy, thetax, thetay, delayx, delayy... | [
[
"numpy.random.normal",
"numpy.sin",
"numpy.array",
"numpy.savetxt",
"numpy.zeros",
"numpy.random.seed",
"numpy.stack",
"numpy.random.randint",
"numpy.arctan2",
"numpy.cos",
"numpy.sqrt",
"numpy.random.random",
"numpy.linspace"
]
] |
Han-xv/RGGCNet | [
"5b1ccf9be4bd1fe91381624ae0b4b7e16296df89"
] | [
"learning/graphnet.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\nfrom builtins import range\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.init as init\nfrom learning import ecc\nfrom learning.modules import RNNGraphConvModule, ECC_CRFModule, GRUCellEx, LSTMCellEx\n\n\ndef create_fnet(widths, ortho... | [
[
"torch.nn.Linear",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"torch.nn.init.calculate_gain",
"torch.nn.init.orthogonal_"
]
] |
NervanaSystems/ngraph-mxnet | [
"eb3099541b588439ec28c8ecb900377a63c8ebd7"
] | [
"tests/python/ngraph/test_nnp.py"
] | [
"#*******************************************************************************\n# Copyright 2018 Intel 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:... | [
[
"numpy.array"
]
] |
sibirrer/decomprofile | [
"a4af9fd6b9fe5436cdf5fd1ee80d725d13e1da82"
] | [
"galight/data_process.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Sep 10 09:10:39 2020\n\n@author: Xuheng Ding\n\nA class to process the data\n\"\"\"\nfrom __future__ import print_function\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport astropy.io.fits as pyfits\nfrom astropy.wcs import WCS\nf... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.ones_like",
"matplotlib.colors.LogNorm",
"numpy.median",
"numpy.sum",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.std",
"matplotlib.pyplot.show",
"numpy.int0"
]
] |
tianyaoZhang/DeeCamp | [
"d731a80e8a30c78e52295bc53525e14a8c65af1c"
] | [
"mmdet/datasets/pipelines/transforms.py"
] | [
"import inspect\n\nimport mmcv\nimport numpy as np\nfrom numpy import random\n\nfrom mmdet.core import PolygonMasks\nfrom mmdet.core.evaluation.bbox_overlaps import bbox_overlaps\nfrom ..builder import PIPELINES\n\ntry:\n from imagecorruptions import corrupt\nexcept ImportError:\n corrupt = None\n\ntry:\n ... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.random.rand",
"numpy.asarray",
"numpy.random.permutation",
"numpy.tile",
"numpy.random.random_sample",
"numpy.any",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.clip"
]
] |
sea-shunned/hawks | [
"583c4e66ffadf9fdba2aca6a262773fc38416e22"
] | [
"hawks/problem_features.py"
] | [
"\"\"\"Defines the problem features for use in the analysis and instance space. All functions in this script are scraped via the :py:mod:`inspect` module. See the source code for implementation details.\n\n.. todo::\n Standardize format with e.g. a wrapper class.\n\"\"\"\nimport numpy as np\nfrom scipy.spatial.d... | [
[
"sklearn.metrics.silhouette_score",
"scipy.spatial.distance.pdist",
"numpy.ma.MaskedArray",
"numpy.sum"
]
] |
Suraj1127/ipl-estimator | [
"9f1c3b0e04fced7f5535289a12caaa750b523053"
] | [
"playoff_estimator.py"
] | [
"\"\"\"\nAuthor: Suraj Regmi\n\nData: 26th April, 2019\n\nDescription:\n\nContains functions for playoff estimator which estimates the probabilities for all the IPL teams going to\nplayoff based on the number of games played with each teams and their current point score.\n\nTie Case:\nIn case of ties that happen wh... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.figure"
]
] |
HansWesterhoff/Systems_Biology_FBA_tutorial | [
"cfb54ecadc6cd1659311f35e78ba71e2dd77779f"
] | [
"Stochastic_tutorials/brownian_function.py"
] | [
"\n# coding: utf-8\n\n# this code has been copied from https://github.com/scipy/scipy-cookbook/blob/master/ipython/BrownianMotion.ipynb\n# version 3 Mar 2017\n\n\"\"\"\nbrownian() implements one dimensional Brownian motion (i.e. the Wiener process).\n\"\"\"\n\n# File: brownian.py\n\nfrom math import sqrt\nfrom scip... | [
[
"numpy.empty",
"numpy.asarray",
"numpy.expand_dims",
"numpy.cumsum"
]
] |
The0nix/PerceptionProject | [
"86b69ba0b7473417fd5bab7d5ef0b608964d7abe"
] | [
"data/parser.py"
] | [
"import cv2\nimport pandas as pd\n\nvidcap = cv2.VideoCapture('video.mp4')\nframes_data = pd.read_csv(\"sensorsFrameTimestamps.csv\", header = None)\nsuccess,image = vidcap.read()\nprint(frames_data)\nframe_name = str(frames_data.iloc[0,0])\nprint(frame_name)\ncv2.imwrite(\"frames/\"+frame_name+\".jpg\", image)\nco... | [
[
"pandas.read_csv"
]
] |
Sjeetm/page-rank | [
"99d06a86ae53d497ddfe8e77a7b9f6090569bdc3"
] | [
"pgrankdf.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Apr 4 23:04:40 2018\r\n\r\n@author: Subhajeet\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport networkx as nx\r\n#%%\r\ndf=pd.read_csv('wiki-Vote.csv',header=None)\r\n#%%\r\ng=nx.DiGraph()\r\ng.add_nodes_from(np.unique(np.array(df[0])))\r\ned... | [
[
"numpy.array",
"numpy.matmul",
"numpy.abs",
"numpy.repeat",
"pandas.read_csv"
]
] |
thomasfrederikhoeck/mlflow | [
"b5ad419aa05aa32a575d79479d67d2bbf7ca1a9d"
] | [
"tests/keras/test_keras_model_export.py"
] | [
"# pep8: disable=E501\n\nimport h5py\nimport os\nimport json\nimport pytest\nimport shutil\nimport importlib\nimport random\nfrom packaging import version\n\nimport tensorflow as tf\nfrom tensorflow.keras.models import Sequential as TfSequential\nfrom tensorflow.keras.layers import Dense as TfDense\nfrom tensorflow... | [
[
"tensorflow.set_random_seed",
"numpy.array",
"tensorflow.keras.optimizers.SGD",
"numpy.random.seed",
"pandas.DataFrame",
"tensorflow.random.set_seed",
"tensorflow.keras.layers.Dense",
"numpy.testing.assert_array_almost_equal",
"pandas.read_json",
"tensorflow.keras.models.Se... |
atiorh/coremltools | [
"89d058ffdcb0b39a03031782d8a448b6889ac425"
] | [
"coremltools/converters/mil/mil/ops/defs/tensor_transformation.py"
] | [
"# Copyright (c) 2020, Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can be\n# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\n\nimport logging\nimport numpy as np\nimport sympy as sm\n\nfrom coremltools.converters.mil.m... | [
[
"numpy.array",
"numpy.reshape",
"numpy.float32",
"numpy.prod",
"numpy.transpose",
"numpy.int32",
"numpy.squeeze",
"numpy.flip"
]
] |
keckler/armi | [
"b5f95b4795aa21e00fd6786f6994862a4bdccb16"
] | [
"armi/bookkeeping/visualization/vtk.py"
] | [
"# Copyright 2020 TerraPower, 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 applicable law or agr... | [
[
"numpy.where",
"numpy.array"
]
] |
uchidalab/fontdesign_gan | [
"3c36c3911a6a9369aa36e2b40e99f2ac060b5cbf"
] | [
"models.py"
] | [
"import tensorflow as tf\n\nfrom ops import lrelu, batch_norm, linear, conv2d, maxpool2d, fc, layer_norm, upsample2x, downsample2x\n\n\"\"\"\n2 type models are defined:\n- DCGAN [Radford+, ICLR2016]\n- ResNet [He+, CVPR2016]\n - This model needs a lot of GPU memory, so you should reduce batch size.\n\"\"\"\n\n\ncl... | [
[
"tensorflow.image.resize_bilinear",
"tensorflow.nn.relu",
"tensorflow.reshape",
"tensorflow.variable_scope",
"tensorflow.nn.tanh",
"tensorflow.tanh",
"tensorflow.nn.dropout"
]
] |
bbudescu/Theano | [
"703408392397a4462e3f7a23478b858fc5a3c2f7"
] | [
"theano/tensor/nnet/nnet.py"
] | [
"\"\"\"\nProvides neural-network specific Ops.\n\nNotes\n-----\nTODO: factor this out into a neural-network toolbox.\n\nWe register all optimization with the gpu tag as we don't\nimplement all the intermediate case on the GPU (in particular\nAdvancedSubtensor). So to make sure it run well on the gpu with\nfast_comp... | [
[
"numpy.zeros_like",
"numpy.empty",
"numpy.zeros",
"numpy.log",
"numpy.sum",
"numpy.exp",
"numpy.allclose",
"numpy.argmax",
"numpy.all"
]
] |
xuanyuzhou98/higher | [
"a28b488d8d4c80b38d3a2d322258233d74a89656"
] | [
"examples/support/miniimagenet_loaders.py"
] | [
"import os\nimport torch\nfrom torch.utils.data import Dataset\nfrom torchvision.transforms import transforms\nimport numpy as np\nimport collections\nfrom PIL import Image\nimport csv\nimport random\n\n\nclass MiniImagenet(Dataset):\n \"\"\"\n put mini-imagenet files as :\n root :\n |- images/*.jpg... | [
[
"matplotlib.pyplot.ion",
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"torch.FloatTensor",
"numpy.random.shuffle",
"matplotlib.pyplot.figure",
"torch.LongTensor",
"matplotlib.pyplot.pause",
"numpy.unique"
]
] |
rtZamb/pyGCODE | [
"5b5807910daa5a85cb232337ea4a58e857e6ce3d"
] | [
"gcody/gcode.py"
] | [
"'''\nClass gcode written by Ryan Zambrotta\n'''\n\n# imports -----------------------------------------------------------------------\nfrom .gline import gline\nfrom .gsettings import gsettings\nfrom .helper import *\nfrom .visual import *\nfrom numpy import array, zeros, any, all, shape\nfrom numpy.linalg import n... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.shape",
"numpy.any",
"numpy.all"
]
] |
mobintaneh/pytorch-ssd | [
"16de2392e1a09a099dc5008ba71956452bb037d7"
] | [
"modules.py"
] | [
"from torch import nn\n\n\nclass SeparableConv2d(nn.Sequential):\n def __init__(self, in_channels, out_channels, kernel_size=1, stride=1, padding=0):\n super(SeparableConv2d, self).__init__(\n nn.Conv2d(in_channels=in_channels, out_channels=in_channels, kernel_size=kernel_size, groups=in_channe... | [
[
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU6"
]
] |
kevindevm/poe-archnemesis-scanner | [
"20ee66f68d9856d67406b146c6a4ca7237ca5bf8"
] | [
"src/RecipeShopper.py"
] | [
"from copy import deepcopy\nfrom typing import Dict, List, Tuple\nfrom ArchnemesisItemsMap import ArchnemesisItemsMap\nfrom DataClasses import RecipeItemNode\nimport numpy as np\n\nclass RecipeShopper:\n def __init__(self, item_map: ArchnemesisItemsMap):\n self._item_map = item_map\n\n def get_missing_items(se... | [
[
"numpy.concatenate"
]
] |
vishalbelsare/deepdow | [
"cbb99347fba9a447d4fcae64fe5137c203643e44"
] | [
"deepdow/utils.py"
] | [
"\"\"\"Collection of utilities and helpers.\"\"\"\nimport os\nimport pathlib\n\nimport numpy as np\nimport pandas as pd\n\n\nclass ChangeWorkingDirectory:\n \"\"\"Context manager that changes current working directory.\n\n Parameters\n ----------\n directory : str or pathlib.Path or None\n The ne... | [
[
"numpy.concatenate",
"numpy.array",
"pandas.DatetimeIndex",
"numpy.log",
"pandas.DataFrame",
"pandas.date_range",
"numpy.isfinite",
"numpy.all"
]
] |
undu/pyray | [
"a48f931ff203c83c9e45303625def8a0500420a3"
] | [
"utils/axes.py"
] | [
"'''\nMethods for drawing primitive constructs like axes, grids, arrows, etc.\n'''\n\nimport numpy as np\nfrom PIL import Image, ImageDraw, ImageFont, ImageMath\nimport rotation.rotation as rot\nfrom functions.functionalforms import *\n\n\ndef render_scene_4d_axis(draw, r = np.eye(4), width = 9, scale = 200, shift ... | [
[
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.eye",
"numpy.arange",
"numpy.sqrt"
]
] |
dekkerlab/matrix_shared | [
"233c215503e6687ddaebf9197e9dfa1043e41eff"
] | [
"sameer/scripts/insulation/insulation.py"
] | [
"import warnings\nimport numpy as np\nimport pandas as pd\nfrom cooltools.lib import peaks, numutils\n\n\ndef insul_diamond(pixels, bins,\n window=10, ignore_diags=2, balanced=True, norm_by_median=True):\n \"\"\"\n Calculates the insulation score of a Hi-C interaction matrix.\n Parameters\n -----... | [
[
"numpy.bincount",
"numpy.zeros_like",
"numpy.isnan",
"numpy.zeros",
"numpy.ones",
"numpy.nanmean",
"numpy.isfinite",
"pandas.concat",
"numpy.log2",
"numpy.nanmedian"
]
] |
yigitozgumus/PolimiRecSys2018 | [
"13d0c52d67347da3891f3b829e40128e09d7024a",
"13d0c52d67347da3891f3b829e40128e09d7024a",
"13d0c52d67347da3891f3b829e40128e09d7024a"
] | [
"models/MF_mark2/Cython/MatrixFactorization_Cython.py",
"models/graph/P3AlphaRecommender.py",
"models/hybrid/SeqRandRecommender.py"
] | [
"from base.BaseRecommender import RecommenderSystem\n\nfrom base.Incremental_Training_Early_Stopping import Incremental_Training_Early_Stopping\nfrom base.RecommenderUtils import check_matrix\nimport subprocess\nimport os, sys\nimport numpy as np\nimport scipy.sparse as sps\nimport pickle\n\nclass MatrixFactorizati... | [
[
"numpy.dot",
"numpy.atleast_1d",
"numpy.arange",
"numpy.isscalar",
"numpy.argsort"
],
[
"scipy.sparse.coo_matrix",
"numpy.ones",
"sklearn.preprocessing.normalize",
"numpy.zeros"
],
[
"numpy.abs",
"numpy.ones_like",
"numpy.argsort"
]
] |
hansenjakob/latticeconv | [
"ecce18f6a177aaf4f86e2ebb257392d7064cdc18"
] | [
"run_trials.py"
] | [
"\nimport numpy as np\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.functional as F\nimport torch.optim as optim\nfrom rivet import parse_rivet_output\nfrom neural import LatticeClassifier,ConvClassifier, HybridClassifier\nfrom train import *\nfrom numpy.random import permutation\nfrom torch.utils.d... | [
[
"torch.zeros",
"torch.device",
"torch.Generator",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.CrossEntropyLoss"
]
] |
ashwin/tensorflow | [
"55e854864fded7318c49daae0b634c5860f3e419"
] | [
"tensorflow/python/eager/def_function.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.eager.function.FunctionSpec.from_function_and_signature",
"tensorflow.python.framework.ops.inside_function",
"tensorflow.python.ops.resource_variable_ops.ResourceVariable.__init__",
"tensorflow.python.eager.function.class_method_to_instance_method",
"tensorflow.python.framew... |
miyosuda/oculomotor | [
"78e7ec61a808d058116c69bff1ea71ecf117c126"
] | [
"application/functions/fef.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport cv2\nimport math\nimport numpy as np\n\nimport brica\nfrom .utils import load_image\nfrom .pfc import Task, InternalPhase, TARGETS\n\nfrom oculoenv.environment import CAMERA_VERTICAL_ANGLE_MAX\nfrom oculoenv.environment import CAMERA_HORIZONTAL_ANGLE_MAX\n\n\"\"\"\nThis i... | [
[
"numpy.max",
"numpy.array",
"numpy.sin",
"numpy.zeros",
"numpy.mean",
"numpy.where",
"numpy.arctan2",
"numpy.cos",
"numpy.clip",
"numpy.linspace"
]
] |
ev-br/numpy | [
"3f0c28121c2021d79e2ced88eb53f8f3590ed942"
] | [
"numpy/add_newdocs.py"
] | [
"\"\"\"\nThis is only meant to add docs to objects defined in C-extension modules.\nThe purpose is to allow easier editing of the docstrings without\nrequiring a re-compile.\n\nNOTE: Many of the methods of ndarray have corresponding functions.\n If you update these docstrings, please keep also the ones in\n ... | [
[
"numpy.lib.add_newdoc"
]
] |
dengsang/covid-estimator | [
"53d8c205e5dd260abd59f95a633d3c5062ace0e0"
] | [
"venv/Lib/site-packages/jsonpickle/ext/pandas.py"
] | [
"from __future__ import absolute_import\n\nimport pandas as pd\nfrom io import StringIO\nimport zlib\n\nfrom .. import encode, decode\nfrom ..handlers import BaseHandler, register, unregister\nfrom ..util import b64decode, b64encode\nfrom .numpy import register_handlers as register_numpy_handlers\nfrom .numpy impor... | [
[
"pandas.Interval",
"pandas.DataFrame",
"pandas.Timestamp",
"pandas.Series",
"pandas.Period"
]
] |
colour-science/colour | [
"6d9b1b8b9e96b5a3c3e3b64d9954be808e4e37a8"
] | [
"colour/utilities/common.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCommon Utilities\n================\n\nDefines the common utilities objects that don't fall in any specific category.\n\nReferences\n----------\n- :cite:`Kienzle2011a` : Kienzle, P., Patel, N., & Krycka, J. (2011).\n refl1d.numpyerrors - Refl1D v0.6.19 documentation. Retrieved ... | [
[
"numpy.around",
"numpy.asarray",
"numpy.errstate"
]
] |
parejadan/bopflow | [
"183a0e0ae4c76265c1614402c59b3a54d328e097"
] | [
"bin/detect.py"
] | [
"import time\nimport tensorflow as tf\nimport argparse\n\nfrom bopflow.models.yolonet import default_detector, default_model\nfrom bopflow.transform.image import transform_images\nfrom bopflow.const import DEFAULT_IMAGE_SIZE\nfrom bopflow.iomanage import load_image_file\nfrom bopflow import LOGGER\n\n\ndef main(arg... | [
[
"tensorflow.expand_dims"
]
] |
KennedyPutraKusumo/py-DED | [
"c5742c29cae66542960060f19d65b446d532b477"
] | [
"examples/ode/case_2.py"
] | [
"from pydex.core.designer import Designer\nfrom case_2_model import simulate\nimport numpy as np\n\n\ndesigner_1 = Designer()\ndesigner_1.simulate = simulate\n\n\"\"\" specifying nominal model parameter values \"\"\"\npre_exp_constant = 0.1\nactiv_energy = 5000\ntheta_0 = np.log(pre_exp_constant) - activ_energy / (... | [
[
"numpy.array",
"numpy.linspace",
"numpy.log"
]
] |
aasthajh/cucim | [
"a95cc5c4ab25beffeac42d642dea8cb1bbf21408"
] | [
"python/cucim/src/cucim/skimage/filters/tests/test_window.py"
] | [
"import cupy as cp\nimport pytest\nfrom scipy.signal import get_window\n\nfrom cucim.skimage.filters import window\n\n\n@pytest.mark.parametrize(\"size\", [5, 6])\n@pytest.mark.parametrize(\"ndim\", [2, 3, 4])\ndef test_window_shape_isotropic(size, ndim):\n w = window('hann', (size,) * ndim)\n assert w.ndim =... | [
[
"scipy.signal.get_window"
]
] |
stegnerw/intelligent_systems | [
"46f70dd598666d5236773b137a268075105281a8"
] | [
"hw4/code/test_classifier_clean.py"
] | [
"###############################################################################\r\n# Imports\r\n###############################################################################\r\n# Custom imports\r\nfrom settings import *\r\nfrom classifier import Classifier\r\n# External imports\r\nimport numpy as np\r\nimport pa... | [
[
"matplotlib.pyplot.colorbar",
"numpy.zeros",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.imshow"
]
] |
SINTEF/pyopia | [
"f0b119533848586779267657d9b13cf82f61959b"
] | [
"pyopia/process.py"
] | [
"# -*- coding: utf-8 -*-\nimport time\nimport numpy as np\nfrom skimage import morphology\nfrom skimage import segmentation\nfrom skimage import measure\nimport pandas as pd\nfrom scipy import ndimage as ndi\nimport skimage.exposure\nimport h5py\nimport os\nfrom skimage.io import imsave\nimport traceback\n\n'''\nMo... | [
[
"numpy.uint8",
"pandas.datetime.now",
"numpy.sum",
"numpy.copy",
"pandas.DataFrame",
"numpy.percentile",
"numpy.min",
"numpy.shape",
"scipy.ndimage.binary_fill_holes",
"numpy.hstack"
]
] |
w601sxs/amazon-sagemaker-examples | [
"2ecb95b13df0bb6282bb6ad3e58d456867cb071c"
] | [
"sagemaker-ngc-examples/PyTorch BYOC BERT Finetuning/run_squad.py"
] | [
"# coding=utf-8\n# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.\n# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.\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 obtai... | [
[
"torch.distributed.get_world_size",
"torch.utils.data.RandomSampler",
"torch.cuda.is_available",
"torch.load",
"torch.nn.DataParallel",
"torch.distributed.init_process_group",
"torch.manual_seed",
"torch.distributed.is_initialized",
"torch.tensor",
"torch.utils.data.DataLoa... |
Luisiglm/Omics-Graph-Neural-Nets- | [
"75a4f72ff62c930fd907f4b232b307445ca0c06a"
] | [
"C_index_loss.py"
] | [
"import tensorflow as tf\r\n\r\n\r\ndef c_index_loss(surv, f):\r\n \"\"\" Returns the minus C-index for survival.\r\n Args:\r\n surv: a tensor with two columns corresponding to the times to last followup and events (1 if an event\r\n has occured at followup). tensor of shape [batch size x 2... | [
[
"tensorflow.shape",
"tensorflow.zeros",
"tensorflow.equal",
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.math.multiply",
"tensorflow.greater",
"tensorflow.tile",
"tensorflow.gather",
"tensorflow.cast"
]
] |
Cleymax/COVID19-France | [
"0588a93fca1de86afbeb90603756e4825b7ede89"
] | [
"modules/GraphEngine.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# Twitter: @xrths\n# www.xrths.fr\n\n# Importation des librairies.\nimport pygal.maps.fr\nfrom pygal.style import Style\nimport cairosvg\n\nimport matplotlib.image as image\nimport matplotlib.cbook as cbook\n\nfrom modules.ConfigEngine import get_config\nimport os\nimport ... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.matplotlib_fname",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.style.... |
xilinnancheng/hybrid-A-python-version | [
"22e70e5ad8fcf6fa2a4099a0b1126bb752d2ec03"
] | [
"path_sqp_smoother.py"
] | [
"import osqp\nimport math\nimport numpy as np\nfrom scipy import sparse\nfrom matplotlib import pyplot as plt\n\n\n# f(x) = 1/2 * x^T * Q * x + p^T * x\nclass SQPSmoother:\n def __init__(self, points_x, points_y, lb, ub, curvature_limit, smooth_weight, length_weight, distance_weight, slack_weight, fixed_start_en... | [
[
"numpy.array",
"numpy.dot",
"scipy.sparse.csc_matrix",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.cross"
]
] |
JonghwanMun/MCL-KD | [
"0e48bc41c2f1680aa593a32b562baef33c093895"
] | [
"src/utils/vis_utils.py"
] | [
"import os\nimport pdb\nimport glob\nimport json\nimport yaml\nimport time\nimport logging\nimport itertools\n\nimport h5py\nimport numpy as np\nfrom PIL import Image\nfrom textwrap import wrap\nimport matplotlib.pyplot as plt\nplt.switch_backend(\"agg\")\nfrom matplotlib import gridspec\nfrom mpl_toolkits.axes_gri... | [
[
"matplotlib.pyplot.switch_backend",
"numpy.array",
"matplotlib.pyplot.setp",
"numpy.asarray",
"numpy.set_printoptions",
"scipy.ndimage.filters.gaussian_filter",
"matplotlib.pyplot.close",
"scipy.misc.imresize",
"matplotlib.pyplot.figure",
"numpy.exp",
"numpy.arange",
... |
zhfeing/data-visualization | [
"5b88530ce8837a0160dcd9d078b4ef16c226e2d6"
] | [
"vis/axes/ticks.py"
] | [
"import copy\nimport math\nfrom typing import Dict, Any, List\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.axis import Axis, XAxis, YAxis\n\n\nclass Ticks:\n def __init__(self):\n self.ticks = None\n self.labels = None\n\n def get_ticks(self) -> List[float]:\n r... | [
[
"numpy.linspace"
]
] |
CopticScriptorium/stanza | [
"a16b152fce3d2cc325b7d67e03952bd00c878fe3"
] | [
"stanza/models/parser.py"
] | [
"\"\"\"\nEntry point for training and evaluating a dependency parser.\n\nThis implementation combines a deep biaffine graph-based parser with linearization and distance features.\nFor details please refer to paper: https://nlp.stanford.edu/pubs/qi2018universal.pdf.\n\"\"\"\n\n\"\"\"\nTraining and evaluation for the... | [
[
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.argmax"
]
] |
WeijieChen2017/friendly-bassoon | [
"a652f4a0b32bba34cdeebc39fb4592ce8ba04873"
] | [
"z9_true_activity_map.py"
] | [
"import glob\nimport numpy as np\nimport nibabel as nib\nimport matplotlib.pyplot as plt\nimport nibabel.processing\nfrom nibabel import load, save, Nifti1Image\n\nfile_list = glob.glob(\"./sCT_1_*.nii.gz\")\nfile_list.sort()\nfor file_path in file_list:\n\tprint(file_path)\n\tcase_idx = file_path[-10:-7]\n\tprint(... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.zeros",
"numpy.abs"
]
] |
cchvv/Project-Happy-4 | [
"d0002c0814d0610f9e28395ac24940771219799a"
] | [
"Happy_4/average_daily_solarandwind.py"
] | [
"from Happy_4 import solar_input\nfrom Happy_4 import wind_input\nimport pandas as pd\n\n'''\nThis file can use data from 2007 to 2012 to calculate the average daily data.\n'''\ndef leap_year_bool(yr):\n if yr % 4 ==0:\n if yr % 100 ==0:\n if yr % 400 ==0:\n return True\n ... | [
[
"pandas.DataFrame",
"pandas.date_range"
]
] |
benmaier/python-fisheye | [
"7d14aa48b1c1dbf91b2b8e7d4030351d4fbd15e6"
] | [
"fisheye/main.py"
] | [
"from __future__ import print_function\n\nimport numpy as np\nfrom scipy.spatial.distance import cdist\n\ndef is_iterable(obj):\n try:\n some_object_iterator = iter(obj)\n return True\n except TypeError as te:\n return False\n\nclass fisheye():\n \"\"\"A class for fisheye transformatio... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.sin",
"numpy.copy",
"numpy.logical_and",
"numpy.sign",
"numpy.arctan2",
"numpy.abs",
"numpy.sqrt",
"numpy.cos",
"numpy.linalg.inv",
"numpy.empty_like"
]
] |
smileyenot983/PPO-pytorch | [
"14fa91e0ac204fcba768f5e24f744f1ef9472488"
] | [
"environments/pybullet-gym/pybulletgym/envs/roboschool/robots/locomotors/humanoid.py"
] | [
"from pybulletgym.envs.roboschool.robots.locomotors.walker_base import WalkerBase\nfrom pybulletgym.envs.roboschool.robots.robot_bases import MJCFBasedRobot\nimport numpy as np\n\n\nclass Humanoid(WalkerBase, MJCFBasedRobot):\n self_collision = True\n foot_list = [\"right_foot\", \"left_foot\"] # \"left_hand... | [
[
"numpy.isfinite",
"numpy.clip"
]
] |
666DZY666/oneflow | [
"2062cb211dd1e0619d610659e6d41598d5f73e17"
] | [
"oneflow/python/test/ops/test_argwhere.py"
] | [
"\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap... | [
[
"numpy.array_equal",
"numpy.nonzero",
"numpy.random.random_sample",
"numpy.random.randint",
"numpy.argwhere"
]
] |
dtcaciuc/nitrous | [
"9ed63c13dbdc1b8b1880e49bbcc6fa442612fe71"
] | [
"tests/test_nbody.py"
] | [
"import unittest\n\ntry:\n import numpy as np\nexcept ImportError:\n np = None\n\n\n@unittest.skipIf(not np, \"Uses NumPy arrays\")\nclass NBodyTests(unittest.TestCase):\n\n def test(self):\n \"\"\"N-body benchmark adaptation from http://shootout.alioth.debian.org\"\"\"\n from nitrous.module ... | [
[
"numpy.genfromtxt"
]
] |
Adaptive-RL/AdaRL-code | [
"493b1ee5a0f98a220c5a1e5ce2e2ce6572d02e9f"
] | [
"test.py"
] | [
"import os\nimport cv2\nfrom datetime import datetime\nimport argparse\nimport warnings\n\nwarnings.filterwarnings('ignore')\nimport numpy as np\nimport random\n\nimport tensorflow as tf\n\n# from xvfbwrapper import Xvfb\n\nfrom models.missVAE import missVAE\nfrom models.dqn_pol import DoubleDQNAgent\nfrom utils.po... | [
[
"numpy.concatenate",
"numpy.reshape",
"numpy.zeros",
"tensorflow.Session",
"tensorflow.math.erf",
"tensorflow.ConfigProto",
"numpy.floor"
]
] |
syrinecheriaa/sentiment-analysis-test | [
"dc743f79c039cda5978c9c036014715ec86e19d9"
] | [
"sentiment_analysis/sentiment_analysis/classifier.py"
] | [
"\nfrom .data_reader import read_text\nfrom .const import path_checkpoint_file, path_index_to_target\nfrom transformers import AutoTokenizer, AutoModelForSequenceClassification\nfrom torch.utils.data import DataLoader\nimport os, json, torch\nimport numpy as np\n\n\nclass SentimentAnalysisDataset(torch.utils.data.... | [
[
"torch.device",
"numpy.array",
"torch.nn.Softmax",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader",
"numpy.argmax"
]
] |
zhangzhg0508/TensorFlowFoam | [
"57465ae03bf3462a73233c3dc5e788664acd4e8b"
] | [
"ML_LES/Training/OF_Readers/velocity_errors.py"
] | [
"import numpy as np\n\nfrom OF_Readers.mesh_params import num_cells_internal, num_cells_outlet, num_cells_inlet, num_cells_upperWall, num_cells_lowerWall\nfrom OF_Readers.mesh_params import internal_cells_start\nfrom OF_Readers.mesh_params import umag_outlet_start\n\ndef replaceZeroes(data):\n min_nonzero = np.m... | [
[
"numpy.concatenate",
"numpy.asarray",
"numpy.abs",
"numpy.nonzero"
]
] |
conanxjp/cse578_project | [
"f60c1bfdd43b38934996e27757e850a2694f8e3f"
] | [
"data_analysis/yelp_preprocess/aspects/analysis_reviews.py"
] | [
"import pandas as pd\nimport json\nimport config as cf\nfrom tqdm import tqdm\nimport random\nfrom pandas.io.json import json_normalize\nfrom nltk.corpus import stopwords\nfrom collections import Counter\nfrom odict import odict\nfrom nltk import word_tokenize\nimport math\nimport os\n\ndef log(x):\n try:\n ... | [
[
"pandas.DataFrame",
"pandas.read_json",
"pandas.concat"
]
] |
eungbean/DCGAN-pytorch-lightning-comet | [
"414cbd5eb50b7e45848479a69077d2060210d4ec"
] | [
"net/data/transformation/augmentations.py"
] | [
"import albumentations as A\nimport functools\nimport numpy as np\nimport random\nfrom torchvision import transforms\n\n\"\"\"\nImage Augmentation with Albumentation.\nhttps://github.com/albumentations-team/albumentations_examples/blob/master/notebooks/example.ipynb\n\"\"\"\n\n\ndef get_augmentation(_C, is_train):\... | [
[
"numpy.random.normal"
]
] |
dajiangsuo/EV_mixtedAutonomy | [
"0c87c378b737a282ac108c6bb5f344c5f39ab30e"
] | [
"flow/envs/base.py"
] | [
"\"\"\"Base environment class. This is the parent of all other environments.\"\"\"\n\nfrom copy import deepcopy\nimport os\nimport atexit\nimport time\nimport traceback\nimport numpy as np\nimport random\nfrom flow.renderer.pyglet_renderer import PygletRenderer as Renderer\nfrom flow.utils.flow_warnings import depr... | [
[
"numpy.copy",
"numpy.asarray",
"numpy.clip"
]
] |
KKruszynska/MulensModel | [
"07badd0b5eae4cf781cd07ba22db7a2c6050a34f"
] | [
"source/MulensModel/tests/test_Model_Parallax.py"
] | [
"import os\nimport numpy as np\nimport unittest\nfrom astropy import units as u\nfrom astropy.coordinates import SkyCoord\n\nimport MulensModel as mm\n\n\ndir_1 = os.path.join(mm.DATA_PATH, 'photometry_files', 'OB140939')\ndir_2 = os.path.join(mm.DATA_PATH, 'unit_test_files')\ndir_3 = os.path.join(mm.DATA_PATH, 'ep... | [
[
"numpy.array",
"numpy.testing.assert_almost_equal",
"numpy.genfromtxt",
"numpy.loadtxt",
"numpy.abs"
]
] |
MaybeShewill-CV/sfnet-tensorflow | [
"52094a466df7e25e3e6aecd79b2dd19ec595e60a"
] | [
"data_provider/cityscapes/cityscapes_tf_io.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# @Time : 2020/5/8 下午7:47\n# @Author : MaybeShewill-CV\n# @Site : https://github.com/MaybeShewill-CV/bisenetv2-tensorflow\n# @File : cityscapes_tf_io.py\n# @IDE: PyCharm\n\"\"\"\nCityscapes tensorflow dataset io module\n\"\"\"\nimport collections\nimport o... | [
[
"tensorflow.train.Int64List",
"tensorflow.data.TFRecordDataset",
"numpy.where",
"numpy.array",
"tensorflow.python_io.tf_record_iterator",
"tensorflow.nn.relu",
"numpy.zeros",
"tensorflow.Session",
"tensorflow.python_io.TFRecordWriter",
"numpy.random.shuffle",
"matplotli... |
vishalbelsare/GNN-FakeNews | [
"fff88dd284e5ab1641f61827157b58b5e70ba9de"
] | [
"gnn_model/gnn.py"
] | [
"import argparse\nimport time\nfrom tqdm import tqdm\nimport copy as cp\n\nimport torch\nimport torch.nn.functional as F\nfrom torch_geometric.nn import global_max_pool as gmp\nfrom torch_geometric.nn import GCNConv, SAGEConv, GATConv, DataParallel\nfrom torch.utils.data import random_split\nfrom torch_geometric.da... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.cuda.manual_seed",
"torch.utils.data.random_split",
"torch.no_grad",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.nn.functional.softmax",
"torch.nn.functional.nll_loss"
]
] |
michahu/garage | [
"c045a1e5e5088a18828ec48bfee0addb1943bfd4"
] | [
"tests/garage/torch/algos/test_dqn.py"
] | [
"\"\"\"Test DQN performance on cartpole.\"\"\"\nimport copy\nimport tempfile\nfrom unittest.mock import MagicMock\n\nimport pytest\nimport torch\nfrom torch.nn import functional as F # NOQA\n\nfrom garage.envs import GymEnv\nfrom garage.experiment import SnapshotConfig\nfrom garage.experiment.deterministic import ... | [
[
"torch.no_grad",
"torch.nn.functional.smooth_l1_loss",
"torch.max",
"torch.sum"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.