repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
Hanhui-Ma-Lab/ColabFold-in-local
[ "29a9d2f318cf781855186788127f484e4c7ee014" ]
[ "AlphaFold-local.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\n#@title Input protein sequence(s), then hit `Runtime` -> `Run all`\n#from google.colab import files\nimport os.path\nimport re\nimport hashlib\nimport random\n\ndef add_hash(x,y):\n return x+\"_\"+hashlib.sha1(y.encode()).hexdigest()[:5]\n\n\nwith open(\"p...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.close" ] ]
Elucidation/ChessboardDetect
[ "a5d2a2c2ab2434e4e041b4f384f3cd7d6884d2c4" ]
[ "generateFullDataset.py" ]
[ "# Given a list of pts text files, build a complete dataset from it.\nimport glob\nimport os\nimport PIL.Image\nimport cv2\nimport numpy as np\nfrom time import time\nfrom argparse import ArgumentParser\nfrom scipy.spatial import cKDTree\nimport tensorflow as tf\nimport SaddlePoints\nimport errno\n\ndef mkdir_p(pat...
[ [ "numpy.random.shuffle", "numpy.zeros", "tensorflow.train.Int64List", "numpy.arange", "scipy.spatial.cKDTree", "numpy.expand_dims", "tensorflow.train.Features", "tensorflow.python_io.TFRecordWriter", "numpy.array", "tensorflow.train.BytesList", "numpy.round" ] ]
binodthapachhetry/SWaN
[ "df54f72dfbd10bb67d3bed2cd20f3401eb779d50" ]
[ "build/lib/SWaN_accel/classify.py" ]
[ "import os, gzip, pickle, sys, datetime, struct\nfrom glob import glob\nimport pandas as pd\nimport subprocess\nimport shutil\nimport numpy as np\nfrom datetime import timedelta\nfrom io import StringIO\n\nfrom SWaN_accel import config\nfrom SWaN_accel import utils\nfrom SWaN_accel import feature_set\npd.options.mo...
[ [ "numpy.diff", "pandas.read_csv", "pandas.DataFrame", "numpy.asarray", "numpy.argmax", "pandas.Timedelta", "pandas.to_datetime", "pandas.Grouper", "pandas.concat", "pandas.DataFrame.from_dict" ] ]
jrg365/gpytorch
[ "52bf07a3a3c55a570b22ff2bf3825adf4a6e259d" ]
[ "test/variational/test_unwhitened_variational_strategy.py" ]
[ "#!/usr/bin/env python3\n\nimport unittest\n\nimport torch\n\nimport gpytorch\nfrom gpytorch.test.variational_test_case import VariationalTestCase\n\n\nclass TestUnwhitenedVariationalGP(VariationalTestCase, unittest.TestCase):\n @property\n def batch_shape(self):\n return torch.Size([])\n\n @propert...
[ [ "torch.Size" ] ]
anonymous-code-github/offline-rl
[ "ebe1335bab9a83e95e5c93f33fa9d248218c37e6" ]
[ "batch_rl/tests/fixed_replay_runner_test.py" ]
[ "# coding=utf-8\n#\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writi...
[ [ "tensorflow.logging.info", "tensorflow.test.main" ] ]
ygutgutia/Reinforcement-Learning-2nd-Edition-by-Sutton-Codes
[ "545349260ff9895383bd9041b8cde23148d5691e" ]
[ "Ch4/Jack_Car_Rental_Problem.py" ]
[ "# https://towardsdatascience.com/elucidating-policy-iteration-in-reinforcement-learning-jacks-car-rental-problem-d41b34c8aec7\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom scipy.stats import poisson\nimport sys\n\n\nclass Poisson:\n def __init__(self, exp_num):\n sel...
[ [ "matplotlib.pyplot.close", "scipy.stats.poisson.pmf", "numpy.zeros" ] ]
sumanyumuku98/contrastive-unpaired-translation
[ "91738727123252e39c4e23f75f93cad737c0d718" ]
[ "train.py" ]
[ "import time\nimport torch\nfrom options.train_options import TrainOptions\nfrom data import create_dataset\nfrom models import create_model\nfrom util.visualizer import Visualizer\n\n\nif __name__ == '__main__':\n opt = TrainOptions().parse() # get training options\n dataset = create_dataset(opt) # create...
[ [ "torch.cuda.synchronize" ] ]
frederiknolte/safety-gym
[ "a0b3354d4d8240ed9b2bc00ef511b70ccb0f08ea" ]
[ "safety_gym/envs/engine.py" ]
[ "#!/usr/bin/env python\n\nimport gym\nimport gym.spaces\nimport numpy as np\nfrom PIL import Image\nfrom copy import deepcopy\nfrom collections import OrderedDict\nimport mujoco_py\nfrom mujoco_py import MjViewer, MujocoException, const, MjRenderContextOffscreen\n\nfrom safety_gym.envs.world import World, Robot\n\n...
[ [ "numpy.sum", "numpy.ones", "numpy.asarray", "numpy.random.RandomState", "numpy.transpose", "numpy.reshape", "numpy.abs", "numpy.cos", "numpy.zeros", "numpy.prod", "numpy.square", "numpy.array", "numpy.matmul", "numpy.exp", "numpy.clip", "numpy.angle"...
mianuddin/csc492_recommender_pkg
[ "3c89bb1f4ef2a34ed4f9bb6a99ae623eaee1954b" ]
[ "recpkg/implicit.py" ]
[ "import numpy as np\nfrom sklearn.base import BaseEstimator\nfrom tensorflow import keras\nfrom .recommenders import KerasRecommender\n\n\nclass ItemPopularity(BaseEstimator):\n \"\"\"Recommender based solely on interactions per item.\"\"\"\n\n def fit(self, X=None, y=None):\n \"\"\"Fit the recommender...
[ [ "tensorflow.keras.optimizers.Adam", "tensorflow.keras.initializers.Constant", "tensorflow.keras.layers.Concatenate", "tensorflow.keras.constraints.unit_norm", "tensorflow.keras.Model", "tensorflow.keras.metrics.BinaryAccuracy", "tensorflow.keras.losses.BinaryCrossentropy", "tensorf...
ccfelius/TravelingSalesMan
[ "ebc3b960859590623c0eb301545cd093c41d157a" ]
[ "SA.py" ]
[ "\"\"\" TSP SIMULATED ANNEALING \"\"\"\n\n# Imports\nimport math\nimport numpy as np\n\n# read data from file\nf = open(\"TSP-configurations/eil51.tsp.txt\", \"r\")\n# f = open(\"TSP-configurations/a280.tsp.txt\", \"r\")\n# f = open(\"TSP-configurations/pcb442.tsp.txt\", \"r\")\n\nnetwork = f.readlines()[6:-1]\n\n#...
[ [ "numpy.log", "numpy.random.uniform", "numpy.random.shuffle" ] ]
yunchu/mmsegmentation
[ "404f3e0e8859991931b6a39a583de412348e98f0", "404f3e0e8859991931b6a39a583de412348e98f0" ]
[ "mmseg/apis/ote/apis/segmentation/model_wrappers/blur.py", "mmseg/integration/nncf/utils.py" ]
[ "# Copyright (C) 2021 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://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or a...
[ [ "numpy.transpose" ], [ "torch.load" ] ]
sixhobbits/Data-Storage-for-Artificial-Intelligence
[ "af14abfeb4f091da1dadab5aa6c02801c50e70da" ]
[ "Chapter09/Exercise03/preprocess_data.py" ]
[ "import argparse\nimport os\nimport json\nfrom pathlib import Path\nimport pandas as pd\n\ndef parse_args():\n parser = argparse.ArgumentParser(\n prog=\"exercise 3\",\n description=\"preprocess meta data\")\n parser.add_argument('-f', '--file', type=str, required=True, help='meta data file path...
[ [ "pandas.DataFrame" ] ]
shashankk24/natural-language-summary-generation-from-structured-data-master
[ "a8bd083685ff7d5c0228588c47ddfcecba4cf78b" ]
[ "TensorFlow_implementation/Summary_Generator/Tensorflow_Graph/order_planner_without_copynet.py" ]
[ "'''\n This file generates the graph of the Model that we are going to use for the order planner for neural summary generator\n The function returns the graph object and some of the important handles of the tensors of the graph in a dictionary.\n Note, that all the possible tensor handles can be obtained b...
[ [ "tensorflow.summary.scalar", "tensorflow.variable_scope", "tensorflow.matmul", "tensorflow.squeeze", "tensorflow.name_scope", "tensorflow.one_hot", "tensorflow.concat", "tensorflow.nn.softmax", "tensorflow.nn.raw_rnn", "tensorflow.summary.histogram", "tensorflow.nn.rnn_...
skavulya/atk
[ "c83f0bee2530282e39bf28d4a15355561b5eca4d" ]
[ "python-client/trustedanalytics/tests/sources.py" ]
[ "# vim: set encoding=utf-8\n\n#\n# Copyright (c) 2015 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://www.apache.org/licenses/LICENSE-2.0\n...
[ [ "pandas.DataFrame" ] ]
edwardstm/rbf_keras
[ "4029d1c15003438f7caadb9efefe0c026ba18933" ]
[ "rbflayer.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras import backend as K\nfrom tensorflow.keras.layers import Layer\nfrom tensorflow.keras.initializers import RandomUniform, Initializer, Constant\nimport numpy as np\n\nclass InitCentersRandom(Initializer):\n \"\"\" Initializer for initialization of centers of RBF net...
[ [ "tensorflow.keras.initializers.Constant", "tensorflow.keras.backend.sum", "tensorflow.keras.backend.expand_dims", "tensorflow.keras.initializers.RandomUniform", "tensorflow.keras.backend.transpose", "numpy.random.randint" ] ]
vt-vl-lab/video-data-aug
[ "01667cdbd1b952f2510af3422beeeb76e0d9e15a" ]
[ "tools/data/build_rawframes.py" ]
[ "import argparse\nimport glob\nimport os\nimport os.path as osp\nimport sys\nimport warnings\nfrom multiprocessing import Pool\n\nimport mmcv\nimport numpy as np\n\n# custom import \nimport pandas as pd\nimport pdb\n\ndef extract_frame(vid_item):\n \"\"\"Generate optical flow using dense flow.\n\n Args:\n ...
[ [ "pandas.read_csv", "numpy.shape" ] ]
Xuyiyang23333/asbot
[ "c3b8a88e0970c1b39f9f7575f64b3fc3fe5161ba" ]
[ "as/tools/generator.py" ]
[ "from PIL import Image, ImageDraw, ImageFont\r\nimport numpy as np\r\nfrom decimal import Decimal, ROUND_HALF_UP\r\nfrom math import radians, tan, cos, sin\r\nfrom os import path\r\n\r\n_round = lambda f, r=ROUND_HALF_UP: int(Decimal(str(f)).quantize(Decimal(\"0\"), rounding=r))\r\nrgb = lambda r, g, b: (r, g, b)\r...
[ [ "numpy.vstack", "numpy.linspace", "numpy.uint8" ] ]
mcx/legged_gym
[ "dd6a6892e54c4f111a203319c05da8dca9595ae1" ]
[ "legged_gym/envs/anymal_c/anymal.py" ]
[ "# SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n# SPDX-License-Identifier: BSD-3-Clause\n# \n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributio...
[ [ "torch.zeros", "torch.jit.load", "torch.inference_mode" ] ]
iRmantou/lightseq
[ "9a617306fa711a3d6a25ef3eab9bfbe408692189" ]
[ "lightseq/training/ops/pytorch/torch_transformer_layers.py" ]
[ "# Copyright 2021 The LightSeq Team\n# Copyright Facebook Fairseq\n# We use layers from Facebook Fairseq as our baseline\n\n\nimport math\nimport uuid\n\nfrom typing import Dict, Optional, Tuple, List\n\nimport torch\nimport torch.nn.functional as F\nfrom torch import Tensor, nn\nfrom torch.nn import Parameter, Lay...
[ [ "torch.nn.init.xavier_uniform_", "torch.nn.init.constant_", "torch.nn.init.xavier_normal_", "torch.cos", "torch.nn.Embedding", "torch.nn.init.normal_", "torch.ne", "torch.cumsum", "torch.sin", "torch.nn.LayerNorm", "torch.arange", "torch.cat", "torch.zeros", ...
davidmam/BirdNET-Pi
[ "873c8f4c56b30edb9297134a92a7c5a178c390e4" ]
[ "analyze.py" ]
[ "# BirdWeather edits by @timsterc\n# Other edits by @CaiusX and @mcguirepr89\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nos.environ['CUDA_VISIBLE_DEVICES'] = ''\n\ntry:\n import tflite_runtime.interpreter as tflite\nexcept:\n from tensorflow import lite as tflite\n\nimport argparse\nimport operator\...
[ [ "numpy.ones", "numpy.zeros", "tensorflow.lite.Interpreter", "numpy.exp", "numpy.expand_dims", "numpy.array", "numpy.concatenate" ] ]
joepvd/aiida_core
[ "6e9711046753332933f982971db1d7ac7e7ade58" ]
[ "aiida/backends/tests/export_and_import.py" ]
[ "# -*- coding: utf-8 -*-\n###########################################################################\n# Copyright (c), The AiiDA team. All rights reserved. #\n# This file is part of the AiiDA code. #\n# ...
[ [ "numpy.random.random", "numpy.random.randint" ] ]
corner4world/nntrainer
[ "0f342e8f2a1ec95b4e712aa3390b21cf0ea4efae" ]
[ "test/input_gen/genModelsRecurrent_v2.py" ]
[ "#!/usr/bin/env python3\n# SPDX-License-Identifier: Apache-2.0\n##\n# Copyright (C) 2021 Jihoon Lee <jhoon.it.lee@samsung.com>\n#\n# @file genModelsRecurrent_v2.py\n# @date 19 October 2021\n# @brief Generate recurrent model tcs\n# @author Jihoon lee <jhoon.it.lee@samsung.com>\n\nfrom recorder_v2 import record_v2, i...
[ [ "torch.stack", "torch.nn.Linear", "torch.nn.MSELoss", "torch.nn.LSTM", "torch.zeros_like", "torch.nn.GRUCell", "torch.nn.LSTMCell", "torch.nn.Identity", "torch.nn.RNNCell", "torch.zeros" ] ]
wi11dey/pylabnet
[ "a6e3362f727c45aaa60e61496e858ae92e85574d" ]
[ "pylabnet/scripts/counter/monitor_counts.py" ]
[ "\"\"\" Generic script for monitoring counts from a counter \"\"\"\n\nimport numpy as np\nimport time\nimport pyqtgraph as pg\nfrom pylabnet.gui.pyqt.external_gui import Window\nfrom pylabnet.utils.logging.logger import LogClient\nfrom pylabnet.scripts.pause_script import PauseService\nfrom pylabnet.network.core.ge...
[ [ "numpy.sum", "numpy.random.randint", "numpy.ones" ] ]
olmosUC3M/Inference-and-Learning-in-discrete-Bayesian-Networks
[ "12e08f2e3f34146638806212be54837cc22c0516" ]
[ "Notebooks/lib/Message_passing_BN.py" ]
[ "## Message passing over a discrete BN ##\n## Library created by Pablo Martínez Olmos, University Carlos III Madrid ##\n## olmos@tsc.uc3m.es ##\n## Last modification 15/11/2016 ##\n\nimport numpy as np\n\n## Messages are stored in the logaritmic domain ##\n## Global constants (to control numerical issues)\n\ninf_lo...
[ [ "numpy.ones", "numpy.zeros", "numpy.exp", "numpy.log", "numpy.array" ] ]
Alexsandruss/daal4py
[ "6e5a02d3fd46095585e618edba24fc258e8b0052" ]
[ "daal4py/sklearn/neighbors/_classification.py" ]
[ "#===============================================================================\n# Copyright 2020-2021 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# ...
[ [ "scipy.sparse.issparse", "sklearn.utils.validation.check_array", "sklearn.neighbors.base._check_weights", "sklearn.neighbors.classification.KNeighborsClassifier.predict_proba" ] ]
ZEROSNU/zer018
[ "c469cf22fa1fdf731b02c79f296ee96d35dccb25" ]
[ "zer018_perception/lane_vision/src/homography.py" ]
[ "import cv2\nimport numpy as np\nimport time\n\n'''\nTEST FILE using 1000, 1000 output image.\nActual code will have an output image of 200,200, which also means a different homography\n'''\n\n#recalculated homography\n\n# homography_front = np.array([[3.12570133882145e-05, 0.000286172662353515, -0.680179732686621]...
[ [ "numpy.array", "numpy.dstack", "numpy.multiply", "numpy.matmul" ] ]
anonymous-iclr-2019/acai-iclr-2019
[ "233058a8330e8162e199933ee22b8e5fcac22072" ]
[ "aae.py" ]
[ "# Copyright 2018\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writi...
[ [ "tensorflow.summary.scalar", "tensorflow.reshape", "tensorflow.variable_scope", "tensorflow.train.get_global_step", "tensorflow.greater", "tensorflow.layers.flatten", "tensorflow.shape", "tensorflow.ones_like", "tensorflow.get_collection", "tensorflow.to_float", "tensor...
harris-2374/THEx
[ "04c4f56eb2cf86b8f55ddd6edd3f48029296bf5a" ]
[ "src/thexb/STAGE_topobinner.py" ]
[ "\"\"\"\nAuthor: Andrew Harris\nPython 3.8\n\"\"\"\nimport logging\nimport os\n\nimport pandas as pd\nfrom ete3 import Tree\nfrom tqdm import tqdm\n############################### Set up logger #################################\ndef set_logger_level(WORKING_DIR, LOG_LEVEL):\n logger = logging.getLogger(__name__)...
[ [ "pandas.read_excel" ] ]
ablifedev/ABLIRC
[ "875278b748a8e22ada2c76c3c76dbf970be4a6a4" ]
[ "ABLIRC/bin/Basic/Distance2XXX/reads_or_peaks_distribution_relative2xxx.py" ]
[ "#!/usr/bin/env python2.7\n# -*- coding: utf-8 -*-\n\n####################################################################################\n### Copyright (C) 2015-2019 by ABLIFE\n####################################################################################\n\n\n\n\n\n#########################################...
[ [ "numpy.fromiter", "numpy.zeros" ] ]
drothlis/tensorflow
[ "04c318b69c5b565436cfeeaab1cb7fd5419dde27" ]
[ "tensorflow/contrib/layers/python/layers/layers.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2016 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/LICE...
[ [ "tensorflow.python.ops.math_ops.maximum", "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.layers.pooling.MaxPooling2D", "tensorflow.python.ops.math_ops.rsqrt", "tensorflow.python.ops.array_ops.expand_dims", "tensorflow.python.ops.sparse_ops.sparse_reshape", "t...
rchen2123/ryu
[ "99400f8c421c1a84b4c7e80dd26224b36ee6d779" ]
[ "venv/lib/python3.7/site-packages/colormath/color_diff_matrix.py" ]
[ "\"\"\"\nThis module contains the formulas for comparing Lab values with matrices\nand vectors. The benefit of using NumPy's matrix capabilities is speed. These\ncalls can be used to efficiently compare large volumes of Lab colors.\n\"\"\"\n\nimport numpy\n\n\ndef delta_e_cie1976(lab_color_vector, lab_color_matrix)...
[ [ "numpy.vstack", "numpy.arctan2", "numpy.sqrt", "numpy.fabs", "numpy.power", "numpy.array", "numpy.radians" ] ]
keurfonluu/toughio
[ "1db0600ee5ad1abb5ca858c81c8ac5226c9dbb4f" ]
[ "test/test_output.py" ]
[ "import os\n\nimport helpers\nimport numpy\nimport pytest\n\nimport toughio\n\nwrite_read = lambda output, writer_kws, reader_kws: helpers.write_read(\n \"output\",\n output,\n toughio.write_output,\n toughio.read_output,\n writer_kws=writer_kws,\n reader_kws=reader_kws,\n)\n\n\n@pytest.mark.param...
[ [ "numpy.allclose", "numpy.abs", "numpy.mean" ] ]
vincentchoqueuse/python-control-plotly
[ "5f4f7d354d4de2628ea52a5e544ebeb138d106bc" ]
[ "control_plotly/utils.py" ]
[ "import control as ctl\nimport numpy as np\n\ndef damp(sys,display=False):\n pole_list = []\n m_list = []\n wn_list = []\n\n for pole in sys.pole():\n pole = pole.astype(complex) # WTF: the python control \"damp\" function is buggy due to this missing cast !\n\n if ctl.isctime(sys):\n ...
[ [ "numpy.log", "numpy.abs", "numpy.real" ] ]
ai-nikolai/Retrograph-1
[ "54bd534d47218ca437c422a1abe5b1e995f55d71" ]
[ "training_utility/run_pretraining_adapter.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.reshape", "tensorflow.contrib.tpu.TPUEstimator", "tensorflow.logging.set_verbosity", "tensorflow.variable_scope", "tensorflow.matmul", "tensorflow.contrib.tpu.TPUEstimatorSpec", "tensorflow.contrib.cluster_resolver.TPUClusterResolver",...
TimS-ml/Scratch-ML
[ "0ea010e2b7ead5f98ba9a0db621cc7d7471e97af" ]
[ "scratchML/examples/linear_discriminant_analysis.py" ]
[ "from __future__ import print_function\nfrom sklearn import datasets\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom scratchML.supervised_learning import LDA\nfrom scratchML.utils import calculate_covariance_matrix, accuracy_score\nfrom scratchML.utils import normalize, standardize, train_test_split, P...
[ [ "sklearn.datasets.load_iris" ] ]
nclarey/pyg-base
[ "a7b90ea2ad4d740d8e7f8c4a7c9d341d36373862" ]
[ "src/pyg_base/_pandas.py" ]
[ "\"\"\"\nWe want to simplify the operations for pandas dataframes assuming we are using timeseries as the main objects.\n\nWhen we have multiple timeseries, we will:\n \n 1) calculate joint index using df_index()\n 2) reindex each timeseries to the joint index\n \nWe then need to worry about multiple co...
[ [ "pandas.Series", "numpy.isinf", "pandas.DataFrame", "pandas.concat", "numpy.isnan", "numpy.array", "pandas.Index", "numpy.full" ] ]
czbiohub/opencell-portal-pub
[ "2b056924e4f55490b16349ff0dcf3e719ab516c7" ]
[ "opencell/imaging/images.py" ]
[ "import datetime\nimport hashlib\nimport json\nimport numpy as np\nimport pandas as pd\nimport tifffile\n\n\ndef timestamp():\n return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')\n\n\nclass MicroManagerTIFF:\n\n def __init__(self, src_filepath, verbose=True):\n '''\n\n '''\n\n s...
[ [ "numpy.ceil", "numpy.zeros", "numpy.diff", "pandas.DataFrame", "numpy.floor", "numpy.mod", "numpy.round", "numpy.concatenate", "numpy.percentile" ] ]
XDong18/bdd-mtl
[ "c89703006a2a5250f4d1c71e0aad958d72526885" ]
[ "bdd_mtl/mmdet/models/detectors/two_stage.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom .base import BaseDetector\nfrom .test_mixins import RPNTestMixin, BBoxTestMixin, MaskTestMixin\nfrom .. import builder\nfrom ..registry import DETECTORS\nfrom mmdet.core import bbox2roi, bbox2result, build_assigner, build_sampler\n\n\n@DETECTORS.register_module\nclass Tw...
[ [ "torch.zeros", "torch.ones", "torch.cat" ] ]
nasa/giant
[ "1e939272d9a0ca533b4da400d132f854520f3adc" ]
[ "unittests/ray_tracer/test_kdtree.py" ]
[ "from unittest import TestCase, skip\nimport copy\n\nimport numpy as np\n\nfrom giant import rotations as at\nfrom giant.ray_tracer import kdtree, shapes, rays\n\n\nclass TestKDTree(TestCase):\n\n def setUp(self):\n\n self.max_depth = 4\n\n tri1 = np.array([[-5, -4, -4.5],\n ...
[ [ "numpy.testing.assert_array_equal", "numpy.arange", "numpy.hstack", "numpy.testing.assert_array_almost_equal", "numpy.isnan", "numpy.array" ] ]
sebwolf-de/Examples
[ "329db390d540e6f5fe1dff35372528f723882271" ]
[ "tpv29/generate_mytopo_tpv29.py" ]
[ "import numpy as np\n\n# Read scec input file\nfid = open(\"tpv29_tpv30_geometry_25m_data.txt\")\nline = fid.readline()\nline = fid.readline()\nheader = [float(a) for a in line.split()]\nnx, ny, lx, ly = header\nroughness = np.loadtxt(fid)\nroughness = roughness[:, 4]\nfid.close()\n\n# create x and y vectors\nx = n...
[ [ "numpy.savetxt", "numpy.loadtxt" ] ]
srujan71/CubeSat-Mission-Planner
[ "62d1ad33c2dcb1a2f8fb3ff615cc5cc0e6716969" ]
[ "example1.py" ]
[ "\"\"\"\nexample1.py\n\n\"A simple example how to use the CubeSat-Power-Estimation tool.\"\n\n@author: Johan Monster (https://github.com/Hans-Bananendans/)\n\"\"\"\n\n# Import packages\nimport numpy as np\nimport pandas as pd\n\nfrom mission import Mission\n\n# Defining the config\nconfig = {\n \"years_passed\" ...
[ [ "numpy.load", "pandas.read_excel" ] ]
leaderj1001/Action-Localization
[ "04d972e6dc3c07d347c70893723d91487c1c8cbd" ]
[ "action-baseline/evaluation/get_ava_performance.py" ]
[ "r\"\"\"Compute action detection performance for the AVA dataset.\n\nPlease send any questions about this code to the Google Group ava-dataset-users:\nhttps://groups.google.com/forum/#!forum/ava-dataset-users\n\nExample usage:\npython -O get_ava_performance.py \\\n -l ava/ava_action_list_v2.1_for_activitynet_2018....
[ [ "numpy.array" ] ]
lxtGH/cvpods-1
[ "614a975e5425bbaeb66bbd1ffca552d633ba89ca" ]
[ "tools/train_net.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n# Modified by BaseDetection, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nDetection Training Script.\n\nThis scripts reads a given config file and runs the training or evaluation.\nIt is an entry point that is made to train standard m...
[ [ "torch.load" ] ]
RafaelSouza94/Python_Machine_Learning
[ "5b150613410ddc64a61690f232ec61751744fa41" ]
[ "Ch_03/LogisticRegression.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nLogistic Regression Gradient Descent\n\"\"\"\n\nimport numpy as np\n\nclass LogisticRegressionGD(object):\n \"\"\"Logistic Regression Classifier using gradient descent.\n \n Parameters\n ------------\n eta : float\n Learning rate (betwe...
[ [ "numpy.random.RandomState", "numpy.dot", "numpy.log", "numpy.clip" ] ]
jilljenn/vfm
[ "4cb2f5157ee7301321bb4babedb62223a720d231" ]
[ "vfm.py" ]
[ "import chainer\nfrom chainer import training\nfrom chainer.training import extensions\nfrom chainer.datasets import TupleDataset\n\nfrom chainer import Chain\nfrom chainer import links as L\nfrom chainer import functions as F\nfrom chainer import reporter\nfrom chainer import cuda\nimport numpy as np\n\n\ndef dot(...
[ [ "numpy.sqrt", "numpy.random.randn" ] ]
degiere/zipline
[ "bc0b117dc94b8e93081818964e3b1bdbf9b33abb" ]
[ "zipline/pipeline/factors/factor.py" ]
[ "\"\"\"\nfactor.py\n\"\"\"\nfrom functools import wraps\nfrom operator import attrgetter\nfrom numbers import Number\n\nfrom numpy import inf, where\nfrom toolz import curry\n\nfrom zipline.errors import UnknownRankMethod\nfrom zipline.lib.normalize import naive_grouped_rowwise_apply\nfrom zipline.lib.rank import m...
[ [ "numpy.where" ] ]
DwaraknathT/sparsity
[ "705f2cba074e6ab4f7655c6af98882773cd826bf", "705f2cba074e6ab4f7655c6af98882773cd826bf" ]
[ "src/layers/transformers/sublayers.py", "src/attacks/base.py" ]
[ "\"\"\" Define the sublayers in encoder/decoder layer \"\"\"\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass ScaledDotProductAttention(nn.Module):\n \"\"\" Scaled Dot-Product Attention \"\"\"\n\n def __init__(self, temperature, attn_dropout=0.1):\n s...
[ [ "torch.nn.Linear", "torch.nn.functional.softmax", "torch.nn.LayerNorm", "torch.nn.Dropout", "torch.matmul" ], [ "torch.min", "torch.save", "torch.cat", "torch.max" ] ]
maldil/CPATMiner2.0
[ "88b96a5af438a9c2ea2dab351cb8b210119132a2" ]
[ "AtomicASTChangeMining/src/test/resources/ASTConversion/sklearn/utils/tests/test_seq_dataset.py" ]
[ "# Author: Tom Dupre la Tour\n# Joan Massich <mailsik@gmail.com>\n#\n# License: BSD 3 clause\n\nimport numpy as np\nimport pytest\nimport scipy.sparse as sp\nfrom numpy.testing import assert_array_equal\nfrom sklearn.utils._seq_dataset import (\n ArrayDataset32, ArrayDataset64, CSRDataset32, CSRDataset64...
[ [ "sklearn.utils._seq_dataset.CSRDataset32", "sklearn.utils._testing.assert_allclose", "scipy.sparse.csr_matrix", "numpy.testing.assert_array_equal", "numpy.arange", "sklearn.utils._seq_dataset.ArrayDataset64", "sklearn.utils._seq_dataset.CSRDataset64", "sklearn.utils._seq_dataset.Ar...
veritas9872/fastMRI-kspace
[ "4c484b3183e9f06838b5ee108af283611c2e1e77" ]
[ "train/new_model_trainers/img_only.py" ]
[ "import torch\nfrom torch import nn, optim, multiprocessing\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard.writer import SummaryWriter\n\nfrom tqdm import tqdm\n\nfrom time import time\nfrom collections import defaultdict\n\nfrom utils.run_utils import get_logger\nfrom utils.train_utils impo...
[ [ "torch.stack", "torch.mean", "torch.multiprocessing.get_start_method", "torch.autograd.set_grad_enabled", "torch.no_grad", "torch.multiprocessing.set_start_method", "torch.autograd.set_detect_anomaly", "torch.nn.ModuleDict", "torch.isfinite" ] ]
LemonNoel/Paddle
[ "1cb511d1488bb86ebb587330902840cb01c79c0d" ]
[ "python/paddle/tensor/math.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.finfo", "numpy.iinfo" ] ]
TheOpponent/st3-translation-notes
[ "c78d7c2347611c07677ec5e293bbd6351800f438" ]
[ "Scripts/convert_png_tiles.py" ]
[ "# This script reads a PNG file containing a single row of 26 x 26 tiles and outputs binary data.\n# NumPy and Pillow are required as dependencies.\n#\n# Specify an input PNG file and an optional output file as arguments.\n# If an output file is not given, the binary data will be written in the console.\n#\n# The o...
[ [ "numpy.vsplit", "numpy.hsplit", "numpy.empty", "numpy.right_shift" ] ]
JRC1995/SocialMediaNER
[ "236b22ded48f64516ebf0577c3b9d9d907db84e0" ]
[ "generate_eval_file.py" ]
[ "import numpy as np\nimport random\nfrom dataLoader.batch import batcher\nfrom transformers import BertTokenizerFast, ElectraTokenizerFast\nfrom configs.WNUT_configs import *\nfrom utils.ml_utils import *\nfrom utils.data_utils import *\nfrom utils.metric_utils import *\nimport argparse\nfrom tqdm import tqdm\nfrom...
[ [ "torch.load", "torch.manual_seed", "numpy.random.seed", "torch.cuda.is_available", "numpy.mean" ] ]
oliviermirat/Scientizen
[ "e06515acbdc2cc2dc22445489dec2df4af454920" ]
[ "scripts/oldScripts2019/3_analyzeDataKnee_Participant1.py" ]
[ "# This scripts assumes that the dataframe has been created and saved in data.txt\n\nimport pickle\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom dataFrameUtilities import addInsultIntensityColumns, getInsultAboveThreshold, getPainAboveThreshold, selectColumns,selectTime\nfrom skl...
[ [ "sklearn.preprocessing.MinMaxScaler", "matplotlib.pyplot.show", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots" ] ]
juanCastrillo/gluon2pytorch
[ "dc73055f0c74dbc45a70f21057fa161123826d86" ]
[ "tests/convert_softmax.py" ]
[ "import torch\nimport mxnet as mx\nimport numpy as np\nfrom gluon2pytorch import gluon2pytorch\n\n\nclass SoftmaxTest(mx.gluon.nn.HybridSequential):\n def __init__(self):\n super(SoftmaxTest, self).__init__()\n from mxnet.gluon import nn\n with self.name_scope():\n self.conv1 = nn...
[ [ "numpy.random.uniform", "torch.FloatTensor", "numpy.max" ] ]
mkennard-aquaveo/modflow6
[ "73a0553636362c90f7d134318e1f5d902dbdc4d3" ]
[ "autotest/test_gwf_lakobs01.py" ]
[ "# Test for checking lak observation input. The following observation types:\n# 'lak', 'wetted-area', and 'conductance,' require that ID2 be provided when\n# ID is an integer corresponding to a lake number and not BOUNDNAME.\n# See table in LAK Package section of mf6io.pdf for an explanation of ID,\n# ID2, and Obs...
[ [ "numpy.ones", "numpy.where", "numpy.zeros" ] ]
argsim/argsim
[ "e5407acf7e47f2bf517b0c580fcdee3654d31089" ]
[ "src/explore.py" ]
[ "import tensorflow as tf\nfrom model import vAe, decode\nimport util_sp as sp\nfrom util_io import load_txt\nimport numpy as np\n\n\ndef analyze(z, use_dim=[], seed=25):\n ''' z = np.array[2, dim], mu of two sentences'''\n ''' use_dim = list of int describing which dimension should be used '''\n\n # selec...
[ [ "numpy.load", "numpy.random.shuffle", "numpy.random.seed", "numpy.copy", "tensorflow.InteractiveSession", "tensorflow.train.Saver" ] ]
countBMB/BenjiRepo
[ "79d882263baaf2a11654ca67d2e5593074d36dfa" ]
[ "venv/Lib/site-packages/caffe2/python/onnx/backend.py" ]
[ "## @package onnx\n# Module caffe2.python.onnx.backend\n\n\"\"\"Backend for running ONNX on Caffe2\n\nTo run this, you will need to have Caffe2 installed as well.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_l...
[ [ "numpy.ones" ] ]
andreiaugustin/tinygrad
[ "c0c2c0b0414dec0862aa442c60e905f39958f572" ]
[ "accel/cherry/tinygrad/ops_cherry.py" ]
[ "import numpy as np\nfrom tinygrad.tensor import Function\nfrom extra.cherry import *\n\n# ************* unary ops *************\n\nclass ReLU(Function):\n def forward(ctx, input):\n ctx.save_for_backward(input)\n return cherry_unop(input, UnaryOps.RELU)\n\n def backward(ctx, grad_output):\n input, = ctx...
[ [ "numpy.zeros_like", "numpy.transpose", "numpy.zeros", "numpy.lib.stride_tricks.as_strided", "numpy.log" ] ]
kouroshHakha/fist
[ "328c098789239fd892e17edefd799fc1957ab637", "328c098789239fd892e17edefd799fc1957ab637" ]
[ "spirl/rl/components/agent.py", "spirl/data/block_stacking/src/demo_gen/block_demo_policy.py" ]
[ "import os\nimport torch\nimport torch.nn as nn\nimport numpy as np\nfrom contextlib import contextmanager\nfrom functools import partial\nfrom torch.optim import Adam, SGD\n\nfrom spirl.utils.general_utils import ParamDict, get_clipped_optimizer, AttrDict, prefix_dict, map_dict, \\\n ...
[ [ "numpy.arange", "numpy.stack", "numpy.concatenate" ], [ "numpy.sum", "numpy.zeros", "numpy.abs", "numpy.asarray", "numpy.random.rand", "numpy.array", "numpy.concatenate", "numpy.linalg.norm" ] ]
robert-anderson/pyscf
[ "cdc56e168cb15f47e8cdc791a92d689fa9b655af", "cdc56e168cb15f47e8cdc791a92d689fa9b655af" ]
[ "pyscf/nao/tddft_iter_x_zip.py", "pyscf/nao/m_overlap_lil.py" ]
[ "from __future__ import print_function, division\nfrom numpy import array, argmax\nfrom pyscf.nao import tddft_iter\n\n\nclass tddft_iter_x_zip(tddft_iter):\n \"\"\" Iterative TDDFT with a high-energy part of the KS eigenvectors compressed \"\"\"\n\n def __init__(self, **kw):\n from pyscf.nao.m_fermi_dirac imp...
[ [ "numpy.array", "numpy.argmax" ], [ "scipy.sparse.lil_matrix", "numpy.zeros" ] ]
ITNano/soundserver
[ "b84cbfd821987ad8af72a6c2677caa0b949abff6" ]
[ "audiostream.py" ]
[ "import numpy\nimport wave\n \nclass Audiostream(object):\n \n def __init__(self, volume_prio=1):\n self.volume_prio = volume_prio\n \n def get_data(self, frame_count, channels, width, rate):\n return \"\".join([\"\\x00\"]*frames*self.channels*self.width)\n \n def get_...
[ [ "numpy.array", "numpy.fromstring" ] ]
sksg/parallize
[ "58d211fd92a4cac97b1d7795932157b839e42b2b" ]
[ "parallize.py" ]
[ "import numpy as np\nfrom numpy.core.numerictypes import typecodes\nimport inspect\nimport functools\nimport re\nimport builtins\nimport os\nfrom concurrent.futures import ThreadPoolExecutor as thread_pool\nfrom concurrent.futures import ProcessPoolExecutor as process_pool\nfrom concurrent.futures import as_complet...
[ [ "numpy.empty", "numpy.dtype", "numpy.lib.stride_tricks._broadcast_shape", "numpy.asanyarray", "numpy.asarray", "numpy.lib.stride_tricks.as_strided", "numpy.broadcast_to", "numpy.ndindex" ] ]
StanfordVL/Lasersuite
[ "8b78c3d202f2a4b8712c5f228feaf5fae61f16e9" ]
[ "robosuite/models/robots/panda_robot.py" ]
[ "import numpy as np\nfrom .robot_model import RobotModel\nfrom ...utils.mjcf_utils import xml_path_completion\n\n\nclass Panda(RobotModel):\n \"\"\"Panda is a sensitive single-arm robot designed by Franka.\"\"\"\n\n def __init__(self, idn=0, bottom_offset=(0, 0, -0.913)):\n \"\"\"\n Args:\n ...
[ [ "numpy.array" ] ]
jiasenwu/gan
[ "f92aeca269365180125d4e4c57c53cbf5e679299" ]
[ "tensorflow_gan/examples/stargan_estimator/train_test.py" ]
[ "# coding=utf-8\n# Copyright 2019 The TensorFlow GAN 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 requi...
[ [ "numpy.eye", "numpy.zeros", "tensorflow.reduce_mean", "tensorflow.compat.v1.layers.flatten", "tensorflow.compat.v1.layers.dense", "tensorflow.test.main", "tensorflow.compat.v1.get_variable" ] ]
LuisCerdenoMota/SHERLOCK
[ "5fb52795d3ab44e27bc7dbc6f2c2e6c214995ba1" ]
[ "experimental/inject.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function, division, absolute_import\n\n#::: modules\nimport numpy as np\nimport os, sys\nimport ellc\nfrom transitleastsquares import catalog_info\nimport astropy.constants as ac\nimport astropy.units as u\nimport lightkurve as lk\nimp...
[ [ "numpy.cbrt", "pandas.DataFrame", "numpy.random.seed", "numpy.arange", "numpy.around" ] ]
kungfu-team/mindspore-bert
[ "71501cf52ae01db9d6a73fb64bcfe68a6509dc32", "71501cf52ae01db9d6a73fb64bcfe68a6509dc32" ]
[ "mindspore/nn/metrics/confusion_matrix.py", "mindspore/common/initializer.py" ]
[ "# Copyright 2021 Huawei Technologies Co., Ltd\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...
[ [ "numpy.sqrt", "numpy.sum", "numpy.bincount", "numpy.zeros", "numpy.argmax", "numpy.expand_dims", "numpy.isnan", "numpy.stack", "numpy.array" ], [ "numpy.random.uniform", "numpy.random.normal", "numpy.zeros", "scipy.stats.truncnorm.rvs" ] ]
Balavignesh/badminton-elo-dashboard
[ "df380afb26c89827111f7316df381408d7d19298" ]
[ "multiBatelo/multielo.py" ]
[ "import numpy as np\nfrom typing import Union, List, Callable\nimport logging\n\nfrom multiBatelo.score_functions import create_exponential_score_function\n\n\nDEFAULT_K_VALUE = 32\nDEFAULT_D_VALUE = 400\nDEFAULT_SCORING_FUNCTION_BASE = 1\n\n_default_logger = logging.getLogger(\"multielo.multielo\")\n\n\nclass Mult...
[ [ "numpy.bincount", "numpy.zeros", "numpy.argsort", "numpy.random.seed", "numpy.exp", "numpy.log", "numpy.fill_diagonal", "numpy.array" ] ]
squalidux/stable-baselines3
[ "72690b3ed0635c68f037b3dc121bd9987a6e82a8" ]
[ "stable_baselines3/sac/sac.py" ]
[ "from typing import Any, Dict, List, Optional, Tuple, Type, Union\n\nimport gym\nimport numpy as np\nimport torch as th\nfrom torch.nn import functional as F\n\nfrom stable_baselines3.common.buffers import ReplayBuffer\nfrom stable_baselines3.common.noise import ActionNoise\nfrom stable_baselines3.common.off_policy...
[ [ "torch.nn.functional.mse_loss", "torch.min", "torch.ones", "torch.no_grad", "numpy.prod", "numpy.mean" ] ]
pizzahan/lingvo
[ "9b85b7ba5d037701302efa807841c05223bc7d1d" ]
[ "lingvo/core/wpm_encoder.py" ]
[ "# -*- coding: utf-8 -*-\n# 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/LICE...
[ [ "tensorflow.size", "tensorflow.zeros", "tensorflow.equal", "tensorflow.shape", "tensorflow.random.uniform", "tensorflow.strings.unicode_split", "tensorflow.map_fn", "tensorflow.strings.split", "tensorflow.while_loop", "tensorflow.TensorArray", "tensorflow.concat", "...
igilitschenski/quaternion
[ "44dd138fa7e95e55d0ccd4a7620a3587cf314b4f" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n\n# Copyright (c) 2018, Michael Boyle\n# See LICENSE file for details: <https://github.com/moble/quaternion/blob/master/LICENSE>\n\n# Construct the version number from the date and time this python version was created.\nfrom os import environ\nfrom sys import platform\non_windows = ('win' in...
[ [ "numpy.__dict__.get", "numpy.get_include" ] ]
Samaretas/global-motion-estimation
[ "798b70ccc23ac6d6c9d25119db22d346c965faca" ]
[ "global_motion_estimation/test scripts/gradient descent tests/dummy.py" ]
[ "import numpy as np\nfrom scipy import optimize\n\n\ndef f(x, a): return x**3 - a\ndef fder(x, a): return 3 * x**2\n\n\nrng = np.random.default_rng()\nx = rng.standard_normal(100)\na = np.arange(-50, 50)\nvec_res = optimize.newton(f, x, fprime=fder, args=(a, ), maxiter=200)\nprint(vec_res)" ]
[ [ "numpy.arange", "scipy.optimize.newton", "numpy.random.default_rng" ] ]
AkihideHayashi/torchfes1
[ "83f01525e6071ffd7a884c8e108f9c25ba2b009b" ]
[ "torchfes/colvar/fix.py" ]
[ "import math\nfrom typing import Dict, Union, List\nimport torch\nfrom torch import nn, Tensor\nfrom .. import properties as p\n\n\ndef fix_msk(mol: Dict[str, Tensor], idx: Tensor):\n _, atm, dim = mol[p.pos].size()\n msk = torch.zeros([atm, dim], dtype=torch.bool, device=idx.device)\n msk[idx, :] = True\n...
[ [ "torch.zeros", "torch.ones", "torch.tensor" ] ]
akathpal/UMD-CMSC733-ComputerVision
[ "f5fa21a0ada8ab8ea08a6c558f6df9676570a2df" ]
[ "SfM/Traditional/ExtraCredit/ExtractCameraPose.py" ]
[ "import numpy as np\nimport sys\n\nsys.dont_write_bytecode = True\n\ndef ExtractCameraPose(E, K):\n\n U, S, V_T = np.linalg.svd(E)\n W = np.array([[0, -1, 0], [1, 0, 0], [0, 0, 1]])\n\n # print(\"E svd U\", U)\n # print(\"E svd S\", S)\n # print(\"E svd U[:, 2]\", U[:, 2])\n R = []\n C = []\n ...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.det", "numpy.linalg.svd" ] ]
RobinYaoWenbin/Python-CommonCode
[ "1ee714541f2fd9c8b96d018d3d4eb94f4edc812a" ]
[ "python业务代码/地图散点可视化/2/plot_city_machine.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Aug 7 09:36:45 2019\r\n\r\n@author: MyPC\r\n\"\"\"\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib \r\nimport math\r\nimport pymssql\r\nimport numpy as np\r\nimport copy\r\nimport re\r\nfrom sklearn import preprocessing\r\nfrom skl...
[ [ "pandas.read_excel" ] ]
jeremy43/autodp-1
[ "0a3626f6e1baaefb46715396998d1e8029a659bb" ]
[ "autodp/rdp_acct.py" ]
[ "\"\"\"\nThis file contains the implementation of the main class object: anaRDPacct --- an analytical moment accountant\nthat keeps track the effects of a hetereogeneous sequence of randomized algorithms using the RDP technique.\n\nIn particular it supports amplification of RDP by subsampling without replacement a...
[ [ "numpy.log", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.loglog", "numpy.linspace", "numpy.minimum", "numpy.ceil", "numpy.isposinf", "numpy.mod", "numpy.arange", "numpy.all", "numpy.max", "numpy.min", ...
deslay1/CAVE
[ "afcbecd0b9cb97276625c16a89cb6df141e6f6f2" ]
[ "test/test_utils/test_statistical_tests.py" ]
[ "import logging\nimport unittest\n\nimport numpy as np\n\nfrom cave.utils.statistical_tests import paired_permutation, paired_t_student\n\n\nclass TestStatisticalTests(unittest.TestCase):\n\n def setUp(self):\n self.logger = logging.getLogger(\"TestStatisticalTests\")\n\n def test_paired_permutation(se...
[ [ "numpy.random.RandomState" ] ]
zuston/elasticdl
[ "601609fd44f826a2f5ea209443124b2c9a2f9ccb" ]
[ "model_zoo/mnist/mnist_functional_api.py" ]
[ "# Copyright 2020 The ElasticDL 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 by ...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.reshape", "tensorflow.train.Int64List", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.keras.layers.Conv2D", "tensorflow.io.parse_single_example", "tensorflow.train.Features", "tensorflow.keras.layers.BatchNormal...
andrewdownie/BlendAway
[ "daf73b22c29dfa905fbe8e838188d4df5861ae5d" ]
[ "blend.py" ]
[ "import os\nimport sys\nimport numpy as np\nimport cv2\nimport statistics\nimport datetime\n\ndef getMedian(arr, x, y):\n values = []\n for a in arr:\n values.append(a[x][y])\n return statistics.median_grouped(values)\n\ndef getMean(arr, x, y):\n values = []\n for a in arr:\n values.app...
[ [ "numpy.zeros" ] ]
UrusuLambda/pix2pix-tensorflow
[ "ba40020706ad3a1fbefa1da7bc7a05b7b031fb9e" ]
[ "model.py" ]
[ "from __future__ import division\nimport os\nimport time\nfrom glob import glob\nimport tensorflow as tf\nimport numpy as np\nfrom six.moves import xrange\n\nfrom ops import *\nfrom utils import *\n\nclass pix2pix(object):\n def __init__(self, sess, image_size=256,\n batch_size=1, sample_size=1, ...
[ [ "tensorflow.summary.scalar", "tensorflow.nn.tanh", "tensorflow.summary.image", "tensorflow.reshape", "tensorflow.variable_scope", "tensorflow.abs", "tensorflow.concat", "tensorflow.get_variable_scope", "tensorflow.summary.merge", "tensorflow.summary.FileWriter", "tensor...
songwanguw/pytorch-lightning
[ "64da9c9d87ac1c106d94310c4d90668fbafbb2cf" ]
[ "pytorch_lightning/trainer/training_loop.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.cuda.empty_cache", "torch.cuda.amp.GradScaler", "numpy.cumsum", "numpy.argmax", "torch.cuda.device" ] ]
hnkulkarni/cs231aApproachingOdt
[ "07c68d787442243d653ae72a7e9473b4c3c5c6b4" ]
[ "tracking.py" ]
[ "# This file will track detections\nimport tqdm\nimport cv2\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nfrom matplotlib.ticker import NullLocator\nfrom cs231aApproachingOdt import utils as myutils\nfrom PIL import Image\nimport os\n\nimport torch\nimport torchvision.ops.boxes as bops\n\n...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.patches.Rectangle", "matplotlib.pyplot.close" ] ]
Captainr22/SAE
[ "f3e370604978a273eb1e1ffdbd342dee3de431c9" ]
[ "hotpotqa_utils_joint.py" ]
[ "import torch\nimport numpy as np\nimport json, sys, re, string\nimport collections\nfrom collections import Counter\nfrom collections import OrderedDict\n\n\ndef get_sp_pred(pred_sp_idx, data):\n \"\"\"get the prediction of supporting facts in original format\n \n Arguments:\n pred_sp_idx {[type]} ...
[ [ "torch.sigmoid", "numpy.argmax" ] ]
bettybhzhou/EasyMarkit_AI
[ "028824a0af246d232013246bf1784013921beec3" ]
[ "sigma_script.py" ]
[ "\"\"\"\n Winning Python script for EasyMarkit Hackathon by Team Sigma\n\"\"\"\n\n##Team Sigma - Members: Betty Zhou, Bailey Lei, Alex Pak\n\n# Usage: python sigma_script.py data/train.csv data/test.csv\n\n\n# import any necessary packages here\n#loading libraries\nimport argparse\nimport os\nimport pandas as pd...
[ [ "pandas.read_csv", "pandas.to_datetime", "sklearn.model_selection.train_test_split", "pandas.get_dummies" ] ]
khanfarhan10/PINTO_model_zoo
[ "4cad2e506d8c0fb604aa7b5f84115a840ab59ba1" ]
[ "10_mobilenetv3/06_mobilenet_v3_large_224_dm07/01_float32/02_weight_quantization.py" ]
[ "import tensorflow as tf\n\ntf.compat.v1.enable_eager_execution()\n\n# Weight Quantization - Input/Output=float32\nconverter = tf.lite.TFLiteConverter.from_saved_model('./saved_model')\nconverter.optimizations = [tf.lite.Optimize.OPTIMIZE_FOR_SIZE]\ntflite_quant_model = converter.convert()\nwith open('./mobilenet_v...
[ [ "tensorflow.compat.v1.enable_eager_execution", "tensorflow.lite.TFLiteConverter.from_saved_model" ] ]
TheSDK-blocks/f2_testbench
[ "6a263dbab6de1da980619c0ecf6d181342c7592b" ]
[ "f2_testbench/analyzers_mixin.py" ]
[ "#This is a mixin class for signal analyzers to be used by f2_system class\n#Todo: Analyzers should be a independent class\n#Last modification by Marko Kosunen, marko.kosunen@aalto.fi, 30.07.2018 18:09\nimport numpy as np\nimport scipy.signal as sig\nimport matplotlib as mpl \nmpl.use('Agg') #To enble plotting with...
[ [ "matplotlib.pyplot.stem", "matplotlib.pyplot.ylabel", "scipy.signal.welch", "numpy.amax", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.abs", "matplotlib.pyplot.xlim", "matplotlib.pyplot.title", "matplotlib.pyplot.suptitle", "matplotlib.use", "matplot...
multichannelsystems/McsPyDataTools
[ "45777d5955043cc6849ea2f01ea442aa19141edd" ]
[ "McsPyDataTools/McsPy/McsCMOS.py" ]
[ "\"\"\"\r\n McsCMOS\r\n ~~~~~~~\r\n\r\n Wrapper and Helper to access MCS CMOS Data within H5 Files \r\n \r\n :copyright: (c) 2018 by Multi Channel Systems MCS GmbH\r\n :license: see LICENSE for more details\r\n\"\"\"\r\n\r\nimport h5py\r\nimport numpy as np\r\n\r\nclass CMOSData(h5py.File):\r\n ...
[ [ "numpy.core.records.fromarrays" ] ]
EXYNOS-999/AWS_JPL_DRL
[ "ea9df7f293058b0ca2dc63753e68182fcc5380f5" ]
[ "DRL/log_analysis/numpy2png.py" ]
[ "import numpy as np\nfrom PIL import Image\nimport sys\n\ndef numpy_to_png(source, dest):\n image = Image.fromarray(np.load(source))\n image.save(dest,\"PNG\")\n\nif __name__ == \"__main__\":\n source = sys.argv[1]\n dest = source.split('.npy')[0] + '.png'\n print(source, \" to \", dest)\n numpy_to_png(source...
[ [ "numpy.load" ] ]
okdefinet/oknodes
[ "c74797f7d3b6a9ec690f0129ea5313d1afc2ae66" ]
[ "app.py" ]
[ "\"\"\"\nOpen Nodes web server\nCopyright (c) 2018 Opennodes / Blake Bjorn Anderson\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the...
[ [ "pandas.read_sql" ] ]
Derollez/PyAbel
[ "c8be4ed7e8e08ee026634b9e856fb473e58d7330" ]
[ "abel/tools/polar.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\nfrom scipy.ndimage import map_coordinates\nfrom scipy.ndimage.interpolation import shift\nfrom scipy.optimize imp...
[ [ "numpy.vstack", "numpy.arctan2", "numpy.flipud", "numpy.cos", "scipy.ndimage.map_coordinates", "numpy.sqrt", "numpy.sin", "numpy.meshgrid" ] ]
siddheshmhatre/cuml
[ "ed0e58c6b3ebfc17b944cdad7c04cd4af8860736" ]
[ "python/cuml/test/test_umap.py" ]
[ "# Copyright (c) 2019-2021, 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 applica...
[ [ "sklearn.neighbors.NearestNeighbors", "numpy.zeros", "sklearn.manifold.trustworthiness", "numpy.abs", "sklearn.datasets.load_wine", "numpy.random.RandomState", "sklearn.cluster.KMeans", "numpy.isnan", "sklearn.datasets.load_digits", "sklearn.datasets.make_blobs", "sklea...
kaylani2/machineLearning
[ "692623abf6fe02bde6c7da6c2f8c0ec526a3e8f8" ]
[ "src/specific_models/federated/single_machine_simulation_flower/single_machine_simulation.py" ]
[ "import os\nimport time\nfrom multiprocessing import Process\nfrom typing import Tuple\n\nimport flwr as fl\nimport numpy as np\nimport tensorflow as tf\nfrom flwr.server.strategy import FedAvg\n\nimport dataset\n\n# generate random integer values\nfrom random import seed\nfrom random import randint\n\n# Make Tenso...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.metrics.CategoricalAccuracy", "tensorflow.keras.metrics.MeanSquaredError", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow....
gajen105/video-servillance-analysis-sysytem
[ "c79f9010aa7c2fe00297fb0370b0635603faf135" ]
[ "classify.py" ]
[ "import glob\nimport datetime\nimport inference\nimport numpy as np\nflist = []\ndef run_classifier():\n flist = []\n list1 = glob.glob(\"./images/*.jpg\")\n list1.sort()\n print(\"Printing the time of Interesting Events.....\\n\\n\")\n temp = str(inference.run_inference_on_image(...
[ [ "numpy.array" ] ]
oscarkey/multitask-learning
[ "c4503c044ca7a29bebd4e70e9e030524654e5d00" ]
[ "multitask-learning/cityscapestask/decoders.py" ]
[ "\"\"\"Decoder portion of the model.\"\"\"\n\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\n\ndef _build_base_decoder():\n \"\"\"Builds the base decoder shared by all three decoder types.\"\"\"\n return nn.Sequential(nn.Conv2d(in_channels=1280, out_channels=256, kernel_size=(3, 3), st...
[ [ "torch.nn.BatchNorm2d", "torch.nn.Conv2d", "torch.zeros", "torch.nn.ReLU", "torch.nn.functional.interpolate" ] ]
PatrickPrakash/lipreading
[ "6380508ba3ffad64fc01ce10a5f43e4da0f652fd" ]
[ "src/decoder/decoder.py" ]
[ "import numpy as np\nimport editdistance\n\n\nclass Decoder():\n def __init__(self, vocab):\n self.vocab_list = [char for char in vocab]\n\n def predict(self, batch_size, logits, y, lengths, y_lengths, n_show=5):\n decoded = self.decode(logits, lengths)\n\n cursor = 0\n gt = []\n ...
[ [ "numpy.mean" ] ]
luksfarris/pydeeprecsys
[ "0409ca220a235bb65ccf72d9077aaecf108722bb" ]
[ "pydeeprecsys/rl/agents/rainbow.py" ]
[ "from numpy.random import RandomState\nfrom typing import Any, Optional, List\nfrom numpy import arange\nfrom copy import deepcopy\nfrom pydeeprecsys.rl.neural_networks.dueling import DuelingDDQN\nfrom pydeeprecsys.rl.experience_replay.priority_replay_buffer import (\n PrioritizedExperienceReplayBuffer,\n)\nfrom...
[ [ "numpy.random.RandomState", "numpy.arange" ] ]
MuAuan/cheating_DL
[ "e8c543d83c304ca072b479cf34fe0a07b58ec6e3" ]
[ "grad-cam_5category.py" ]
[ "#grad_cam\n#[keras-grad-cam/grad-cam.py](https://github.com/jacobgil/keras-grad-cam/blob/master/grad-cam.py)\n\nfrom keras.applications.vgg16 import (VGG16, preprocess_input, decode_predictions)\nfrom keras.models import Model\nfrom keras.preprocessing import image\nfrom keras.layers.core import Lambda\nfrom keras...
[ [ "numpy.ones", "tensorflow.python.framework.ops.RegisterGradient", "numpy.squeeze", "numpy.float32", "tensorflow.zeros_like", "numpy.uint8", "tensorflow.cast", "tensorflow.gradients", "numpy.expand_dims", "numpy.clip", "tensorflow.get_default_graph", "numpy.min", ...
tjd2002/spikeforest2
[ "2e393564b858b2995aa2ccccd9bd73065681b5de", "2e393564b858b2995aa2ccccd9bd73065681b5de" ]
[ "gui/sfbrowser/sfbrowser.py", "spikeforest_analysis/compare_sortings_with_truth.py" ]
[ "import vdomr as vd\nimport spikeforest as sf\nfrom cairio import client as ca\nimport pandas as pd\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n\nclass AccuracyPlot(vd.components.Pyplot):\n def __init__(self, snrs, accuracies):\n vd.components.Pyplot.__init__(self)\n self._snrs = s...
[ [ "numpy.array", "matplotlib.pyplot.scatter", "numpy.count_nonzero" ], [ "pandas.DataFrame" ] ]
mspp-data-studio-2021/aptitude-analysis
[ "90a7fc8655650f8166d530d325b963b93a42f311" ]
[ "code/plots/plots_exploratory.py" ]
[ "\"\"\"This script creates some informative graphs on subgroups of income quartile, gender, and race.\"\"\"\n# %%\nimport os\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom pathlib import Path\n\n\n# %%\n# Set up folder path\ncode_folder = Path(os.path.abspath(''))\nprint(code_folder)\nproject_dir = o...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.gca", "matplotlib.pyplot.figure" ] ]
shromonag/active_testing
[ "ca9c8f909f6b0f4e7b1affda6f9333e0d0b6c04b" ]
[ "adversarial_testing/test_module.py" ]
[ "'''\nThis file defines the testing module. This needs the following:\n1. The system under test\n2. The specification or the function which we are trying to minimize\n3. Domains of the uncertainities\n'''\n\nfrom .optimizers import *\nfrom .func_tree import *\nfrom .utils import *\nfrom sklearn.decomposition import...
[ [ "sklearn.decomposition.KernelPCA" ] ]
SonicZedt/ColorCount
[ "55fee92a7858c504b5a135b007f2065c2ec0a1be" ]
[ "image_data.py" ]
[ "import requests\nimport numpy as np\nimport collections\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas\nfrom PIL import Image\nfrom io import BytesIO\n\nclass Image_Data:\n image = None\n\n @property\n def Array(self) -> np.ndarray:\n \...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "matplotlib.pyplot.barh", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.backends.backend_agg.FigureCanvasAgg", "matplotlib.pyplot.xlabel" ] ]