repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
latonaio/detect-abnormal-set-of-temperatures
[ "e5cda1156e23f77f0feb16b56e3624807592fafb" ]
[ "src/detect-abnormal-temps/calc_temperature.py" ]
[ "# coding: utf-8\n\n# Copyright (c) 2019-2020 Latona. All rights reserved.\n\nimport os\nimport sys\n\ntry:\n from aion.logger import lprint\nexcept:\n lprint = print\n\nimport numpy as np\nimport cv2\n\n# CONST PARAMETER\nDETECT_ABNORMAL_RATIO = 0.3\nABNORMAL_THRESHOLD_BASE = 38\nABASE = ABNORMAL_THRESHOLD_B...
[ [ "numpy.count_nonzero", "numpy.loadtxt", "numpy.interp" ] ]
yimingchen95/veidt
[ "90f201f856d2f71c578f74b7391c0c9ff284986b" ]
[ "veidt/rfxas/tests/test_core.py" ]
[ "\nfrom veidt.rfxas.core import XANES\nfrom veidt.rfxas.prediction import CenvPrediction\nimport pandas as pd\nimport os, unittest\nimport warnings\n\ncomp_test_df_path = os.path.join(os.path.dirname(__file__), 'comp_spectra_test.pkl')\ncomp_test_df = pd.read_pickle(comp_test_df_path)\nFe_tsv = os.path.join(os.path...
[ [ "pandas.read_pickle" ] ]
AurelianTactics/rl-baselines3-zoo
[ "ef8f7350108568a8b199efa56a24eba2f104db54" ]
[ "utils/exp_manager.py" ]
[ "import argparse\nimport os\nimport time\nimport warnings\nfrom collections import OrderedDict\nfrom pprint import pprint\nfrom typing import Any, Callable, Dict, List, Optional, Tuple\n\nimport gym\nimport numpy as np\nimport optuna\nimport yaml\nfrom optuna.integration.skopt import SkoptSampler\nfrom optuna.prune...
[ [ "numpy.ones", "numpy.zeros" ] ]
jonathanfrawley/PyAutoArray_copy
[ "c21e8859bdb20737352147b9904797ac99985b73", "c21e8859bdb20737352147b9904797ac99985b73" ]
[ "test_autoarray/structures/grids/two_d/test_sparse_util.py", "test_autoarray/inversion/test_regularization.py" ]
[ "import autoarray as aa\r\nimport os\r\n\r\nimport numpy as np\r\n\r\n\r\nclass TestUnmaskedSparseForSparse:\r\n def test__mask_full_false__image_mask_and_pixel_centres_fully_overlap__each_sparse_maps_to_unmaked_sparse(\r\n self,\r\n ):\r\n\r\n ma = aa.Mask2D.manual(\r\n mask=np.array...
[ [ "numpy.array" ], [ "numpy.array" ] ]
zhuzhenyuan/uiautomator2
[ "87da38153c05823ba8ccfadc9ba9ae6d22d97fd8" ]
[ "uiautomator2/ext/perf/__init__.py" ]
[ "# coding: utf-8\n#\n\nfrom __future__ import absolute_import, print_function\n\nimport threading\nimport re\nimport time\nimport datetime\nimport csv\nimport sys\nimport atexit\nfrom collections import namedtuple\n\n_MEM_PATTERN = re.compile(r'TOTAL[:\\s]+(\\d+)')\n# acct_tag_hex is a socket tag\n# cnt_set==0 are ...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.ticker.NullFormatter", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.clf", "pandas.read_csv", "matplotlib.pyplot.subplot" ] ]
pevdh/openpilot
[ "fca82ba503a663ec97b7ba89c2c3da80aef739b2" ]
[ "selfdrive/debug/internal/design_lqr.py" ]
[ "#!/usr/bin/env python3\nimport numpy as np\nimport control\n\ndt = 0.01\nA = np.array([[ 0. , 1. ], [-0.78823806, 1.78060701]])\nB = np.array([[-2.23399437e-05], [ 7.58330763e-08]])\nC = np.array([[1., 0.]])\n\n\n# Kalman tuning\nQ = np.diag([1, 1])\nR = np.atleast_2d(1e5)\n\n(_, _, L) ...
[ [ "numpy.array", "numpy.diag", "numpy.atleast_2d" ] ]
rohankumardubey/npx
[ "3dc43cbf765a748f5197286ed70f5cbccf11e2bf" ]
[ "tests/test_unique.py" ]
[ "import numpy as np\n\nimport npx\n\n\ndef test_unique_tol():\n a = [0.1, 0.15, 0.7]\n\n a_unique = npx.unique(a, 2.0e-1)\n print(a_unique)\n assert np.all(a_unique == [0.1, 0.7])\n\n a_unique, inv = npx.unique(a, 2.0e-1, return_inverse=True)\n assert np.all(a_unique == [0.1, 0.7])\n assert np....
[ [ "numpy.all" ] ]
jakeybob/brexit-maps
[ "649479d9e9a0eaf94599d73844ca0d44eee4bd75" ]
[ "plot4.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport mapMisc as mapMisc\nfrom sklearn import cluster\nimport fiona\nimport matplotlib.patches as patches\nfrom matplotlib.lines import Line2D\n\n\nGBRshpfile = 'data/boundaryline/district_borough_unitary_region.shp'\nNIshpfile = 'data/OSNI...
[ [ "matplotlib.pyplot.savefig", "sklearn.cluster.KMeans", "numpy.shape", "matplotlib.pyplot.figure", "numpy.argsort", "pandas.concat", "numpy.unique" ] ]
thieu1995/permetrics
[ "b00ff1786a765e88006fd2a695fbdf342191cc6b", "b00ff1786a765e88006fd2a695fbdf342191cc6b" ]
[ "examples/regression/SMAPE.py", "permetrics/singleloss.py" ]
[ "#!/usr/bin/env python\n# ------------------------------------------------------------------------------------------------------%\n# Created by \"Thieu Nguyen\" at 11:01, 19/07/2020 %\n# ...
[ [ "numpy.array" ], [ "numpy.isnan", "numpy.log", "numpy.round", "numpy.any", "numpy.isfinite", "numpy.abs" ] ]
carlogrisetti/ludwig
[ "5c0887f14867e1577e0ddc3806c5cf7a781fb665" ]
[ "ludwig/features/set_feature.py" ]
[ "#! /usr/bin/env python\n# coding=utf-8\n# Copyright (c) 2019 Uber Technologies, Inc.\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/LICENS...
[ [ "torch.greater_equal", "torch.sigmoid", "torch.Size" ] ]
elias-1/NiftyNet
[ "05cd2ffbff5043d9a40b524a6d72f6bd5cd072d2" ]
[ "niftynet/layer/crop.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom niftynet.layer import layer_util\nfrom niftynet.layer.base_layer import Layer\n\n\nclass CropLayer(Layer):\n \"\"\"\n This class defines a cropping operation:\n Removing `...
[ [ "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.constant", "tensorflow.nn.convolution", "numpy.hstack", "tensorflow.unstack" ] ]
Taghurei/DreamBackend
[ "ca73adb19010f8ac3a12156659066730128883ab" ]
[ "Backend/src/FunctionML.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import ensemble\nfrom sklearn import metrics\nfrom statistics import mean\n\ndef etudeRelationSigne(df_knockouts,df_wildtype,v=.12):\n m = len(df_knockouts.values)\n mat = np.zeros((m,m))\n\n for i in range(m):\n ...
[ [ "numpy.sign", "numpy.zeros" ] ]
mesnardo/petibm-rollingpitching
[ "39f7ed9b88973727bed6955e31d99754d7627c9f" ]
[ "runs/independence/scripts/plot_velocity_profiles_compare_dx_dt.py" ]
[ "\"\"\"Plot profiles of the velocity at different locations in the x direction.\"\"\"\n\nfrom matplotlib import pyplot\nimport pathlib\n\nimport rodney\n\n\ndef get_velocity_profiles(datadir,config, time, xlocs):\n \"\"\"Get the velocity profiles at given time and x locations.\"\"\"\n profiles = {'u': {'locs'...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", "matplotlib.pyplot.rc" ] ]
michaelriedl/alpha-transform
[ "add5818b168551cb0c2138c65101c9cdac2bf3d9", "add5818b168551cb0c2138c65101c9cdac2bf3d9" ]
[ "alpha_transform/MotherShearlets.py", "alpha_transform/__init__.py" ]
[ "#!/usr/bin/env python3\nr\"\"\"\nThe classes, functions and objects in this module make it (comparatively)\neasy to define custom generating functions which act as \"Mother shearlets\".\n\n.. warning::\n Implementing custom \"Mother shearlets\" is a complex task and thus should\n only be done if really neede...
[ [ "numpy.greater_equal", "numpy.less_equal", "numpy.abs", "numpy.greater" ], [ "numpy.true_divide", "numpy.load", "numpy.min", "numpy.broadcast_to", "numpy.max", "numpy.linalg.norm", "numpy.empty", "numpy.prod", "numpy.arange", "numpy.sqrt", "numpy.isf...
semperparatusalpha/Restaurant-chatbot
[ "6b01a9395ff08873d3f0572edd09db8d7aac9d2b" ]
[ "helper_scripts/tsne_visualizer.py" ]
[ "from sklearn.manifold import TSNE\nimport json\nimport numpy as np\nfrom sklearn.cluster import KMeans\n\n# embedded data has fasttext vectors of the sentences\nwith open(\"embedded_data_short.json\") as file:\n data = json.load(file)\n\nX = []\n\nfor intent in data['intents']:\n\n for pattern in intent['pat...
[ [ "numpy.array", "sklearn.cluster.KMeans" ] ]
HEXRD/hexrdgui
[ "d92915463f237e0521b5830655ae73bc5bcd9f80" ]
[ "hexrd/ui/overlays/rotation_series.py" ]
[ "import numpy as np\n\nfrom hexrd import constants\n\nfrom hexrd.ui.constants import ViewType\n\n\nclass RotationSeriesSpotOverlay:\n def __init__(self, plane_data, instr,\n crystal_params=None,\n eta_ranges=None,\n ome_ranges=None,\n ome_period=Non...
[ [ "numpy.array", "numpy.tile", "numpy.degrees", "numpy.hstack", "numpy.linspace" ] ]
harisankarh/NeMo
[ "27bfb1aed24a786626e1c27c37417ebcd226ca8a", "27bfb1aed24a786626e1c27c37417ebcd226ca8a" ]
[ "collections/nemo_nlp/nemo_nlp/callbacks/joint_intent_slot.py", "collections/nemo_nlp/nemo_nlp/data/datasets/token_classification.py" ]
[ "# Copyright (c) 2019 NVIDIA Corporation\nimport os\nimport random\nimport time\n\nimport matplotlib\nfrom matplotlib import pyplot as plt\nimport numpy as np\nfrom sklearn.metrics import confusion_matrix, classification_report\n\nfrom nemo.utils.exp_logging import get_logger\nmatplotlib.use(\"TkAgg\")\n\n\nlogger ...
[ [ "matplotlib.use", "sklearn.metrics.confusion_matrix", "numpy.asarray", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "sklearn.metrics.classification_report", "matplotlib.pyplot.ylabel" ], [ "numpy.array" ] ]
aschwa/happy_city_tweets
[ "80a240492860a6cda48f75b825cb0b54cc369c8b" ]
[ "src/scripts/label_park_tweets/park_split_s.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport json\nimport argparse\nfrom pathlib import Path\nimport geopandas as gpd\nimport pandas as pd\nfrom shapely.geometry import Point\nfrom geopandas.tools import sjoin\nfrom pyproj import Proj, transform\n\n\ndef parse_args():\n parser = argparse.ArgumentParse...
[ [ "pandas.read_json" ] ]
amulyahwr/acl2018
[ "53521950397f79e47738bb7177ad664b7dce38e5" ]
[ "treelstm_dep_attn/mda/main.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport random\nimport logging\n\nimport torch.optim as optim\n\n# IMPORT CONSTANTS\nimport Constants\n# NEURAL NETWORK MODULES/LAYERS\nfrom model import *\n# DATA HANDLING CLASSES\nfrom tree import Tree\nfrom vocab import Vocab\n#...
[ [ "torch.optim.Adadelta", "torch.optim.Adam", "torch.optim.Adagrad", "torch.optim.SGD" ] ]
braysia/covertrace
[ "cb3f91964bd7b524eb10bfce972136eb921ab689" ]
[ "covertrace/utils/single_frame_cleaning.py" ]
[ "from __future__ import division\nimport numpy as np\nfrom collections import OrderedDict\nfrom covertrace.data_array import Sites, DataArray\n\ndef modify_prop(func):\n def wrapper(arr, **args):\n if isinstance(arr, OrderedDict):\n for key, value in arr.iteritems():\n bool_arr =...
[ [ "numpy.nanpercentile", "numpy.max", "numpy.expand_dims" ] ]
leonbett/debuggingbook
[ "ae1fa940c306160429232fbc93a7a7f14b44efb7" ]
[ "notebooks/shared/ipypublish/scripts/ipynb_latex_setup.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nSome setup for improved latex/pdf output\n\nat top of workbook, use\n\n from ipynb_latex_setup import *\n\n\"\"\"\n\nfrom __future__ import division as _division\n# Py2/Py3 compatibility\n# =====================\nfrom __future__ import print_function as _print_function\n\n# PYTHON...
[ [ "pandas.set_option" ] ]
brigaldies/search_with_machine_learning_course
[ "ae55c88d0b22a396fe830a587a86aee11e66a366" ]
[ "week3/__init__.py" ]
[ "import os\n\nfrom flask import Flask\nfrom flask import render_template\nimport pandas as pd\nimport fasttext\nfrom pathlib import Path\n\ndef create_app(test_config=None):\n # create and configure the app\n app = Flask(__name__, instance_relative_config=True)\n \n if test_config is None:\n # lo...
[ [ "pandas.read_csv" ] ]
FirefoxMetzger/ropy
[ "ee6f1d3451a3c61a6fa122cc42efc4dd67afc9c9" ]
[ "skbot/ignition/sdformat/generic_sdf/joint.py" ]
[ "import warnings\nfrom typing import List, Union, Dict, Any, Tuple\nfrom itertools import chain\nimport numpy as np\n\nfrom .base import (\n BoolElement,\n ElementBase,\n FloatElement,\n Pose,\n StringElement,\n vector3,\n should_warn_unsupported,\n)\nfrom .sensor import Sensor\nfrom .frame imp...
[ [ "numpy.clip" ] ]
xiedotscene/Open3D
[ "483f6682d04e447a267d920bf48b9e3a91b56e7b" ]
[ "src/Python/Tutorial/Basic/rgbd_tum.py" ]
[ "# Open3D: www.open3d.org\n# The MIT License (MIT)\n# See license file or visit www.open3d.org for details\n\n#conda install pillow matplotlib\nfrom py3d import *\nimport matplotlib.pyplot as plt\n\n\nif __name__ == \"__main__\":\n\tprint(\"Read TUM dataset\")\n\tcolor_raw = read_image(\"../../TestData/RGBD/other_f...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.pyplot.title", "matplotlib.pyplot.subplot" ] ]
faezakamran/sentence-transformers
[ "2158fff3aa96651b10fe367c41fdd5008a33c5c6" ]
[ "examples/unsupervised_learning/query_generation/example_query_generation.py" ]
[ "import torch\nimport numpy as np\nimport random\nfrom transformers import T5Tokenizer, T5ForConditionalGeneration\n\n#Set all seeds to make output deterministic\ntorch.manual_seed(0)\nnp.random.seed(0)\nrandom.seed(0)\n\n\n#Paragraphs for which we want to generate queries\nparagraphs = [\n\"Python is an interprete...
[ [ "torch.manual_seed", "torch.no_grad", "torch.cuda.is_available", "numpy.random.seed" ] ]
anbasile/arxiv2018-bayesian-ensembles
[ "52e2741540ce0466666aaca9fe9dd148c144123a", "52e2741540ce0466666aaca9fe9dd148c144123a" ]
[ "src/taggers/lample_lstm_tagger/optimization.py", "src/experiments/EMNLP2019/error_analysis.py" ]
[ "import numpy as np\nimport theano\nimport theano.tensor as T\n\nfloatX = theano.config.floatX\ndevice = theano.config.device\n\n\nclass Optimization:\n\n def __init__(self, clip=None):\n \"\"\"\n Initialization\n \"\"\"\n self.clip = clip\n\n def get_gradients(self, cost, params):...
[ [ "numpy.float32", "numpy.zeros" ], [ "numpy.concatenate", "numpy.array", "numpy.zeros_like", "numpy.savetxt", "numpy.zeros", "numpy.sum", "numpy.genfromtxt", "numpy.ones", "numpy.where", "numpy.arange", "numpy.cumsum", "numpy.in1d", "numpy.argwhere", ...
ruohoruotsi/nevergrad
[ "68ec2ebddcc388b0fea5bc274c6f7ef098e34589" ]
[ "nevergrad/benchmark/test_plotting.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom . import plotting # pylint: disable=wrong-import-position, wrong-import-order\nfrom unittest.mock import ...
[ [ "matplotlib.use", "numpy.testing.assert_equal", "pandas.DataFrame", "numpy.testing.assert_array_equal", "numpy.identity" ] ]
BenjaminMidtvedt/DeepTrack-2.0
[ "64245f31e63011fb48d38f211134774bbce28cf4" ]
[ "deeptrack/benchmarks/test_image.py" ]
[ "import sys\nimport numpy as np\nimport itertools\nimport deeptrack as dt\nimport pytest\nimport itertools\nimport cupy as cp\n\nu = dt.units\n\n\ndef create_pipeline(elements=1024):\n value = dt.Value(np.zeros((elements,)))\n value = value + 14\n value = value * (np.ones((elements,)) * 2)\n value = val...
[ [ "numpy.ones", "numpy.random.randn", "numpy.zeros" ] ]
jiahuei/tf-sparse-captioning
[ "9d7b8ecdd44fb1541500ca4f920d6c94fd15bad1" ]
[ "common/nets/i3d_test.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 required...
[ [ "tensorflow.argmax", "tensorflow.random_uniform", "tensorflow.Graph", "tensorflow.test.main", "tensorflow.global_variables_initializer" ] ]
jurajHasik/peps-torch
[ "bc5068b2026e670a2795fc3fc060a3313bc1e3fb" ]
[ "optim/ad_optim.py" ]
[ "import time\nimport json\nimport logging\nlog = logging.getLogger(__name__)\nimport torch\n#from memory_profiler import profile\nimport config as cfg\n\ndef store_checkpoint(checkpoint_file, state, optimizer, current_epoch, current_loss,\\\n verbosity=0):\n r\"\"\"\n :param checkpoint_file: target file\n ...
[ [ "torch.optim.LBFGS", "torch.load" ] ]
match4healthcare/match4healthcare
[ "acf69e3b781d715f0a947c2a9df6646e94f1ca6b" ]
[ "backend/apps/accounts/views_staff.py" ]
[ "from django.contrib.admin.views.decorators import staff_member_required\nfrom django.contrib.auth.decorators import login_required\nfrom django.shortcuts import render\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.ticker import MaxNLocator\nimport mpld3\n\nfrom .db_stats import DataBaseStats...
[ [ "matplotlib.use", "matplotlib.ticker.MaxNLocator", "matplotlib.pyplot.subplots" ] ]
miguelggaspar/neuronalFEM
[ "78e001b4306f39bf7e5d67361c67182a6a9b80e2" ]
[ "1D/dataset/functions.py" ]
[ "# function that returns [deps/dt, dX/dt, dR/dt]\nimport math\nimport numpy as np\nfrom scipy.integrate import odeint\n\n\nclass viscoPlastic1D:\n\n def __init__(self, K, n, H, D, h, d):\n self.K = K\n self.n = n\n self.H = H\n self.D = D\n self.h = h\n self.d = d\n\n# f...
[ [ "numpy.sign", "scipy.integrate.odeint", "numpy.empty_like" ] ]
grantsrb/langpractice
[ "59cf8f53b85fa8b4d639ffc6e175ec22c0d2362c" ]
[ "langpractice/utils/analysis.py" ]
[ "import torch\nimport os\nimport pandas as pd\nimport langpractice.utils.save_io as lpio\nfrom tqdm import tqdm\n\ndef get_stats_dataframe(model_folders,\n names=None,\n incl_hyps=False,\n verbose=False):\n \"\"\"\n Sorts through all checkpo...
[ [ "pandas.DataFrame" ] ]
morrislab/plos-medicine-joint-patterns
[ "cfdc6dd4854ec33e7e2efbf36d648b65d278df33" ]
[ "scripts/validation_projections/compare_frequencies.py" ]
[ "\"\"\"\nCompares frequencies between the validation and discovery cohorts.\n\nFor each patient group, the Euclidean distance is used.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\nfrom click import *\nfrom logging import *\n\n\n@command()\n@option(\n '--validation-input',\n required=True,\n help='...
[ [ "pandas.read_csv" ] ]
kshitijd20/pyrsa
[ "3090d88362b26e6b2ee807e62d483a0158530e2a" ]
[ "tests/test_inference.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 10 10:00:26 2020\n\n@author: heiko\n\"\"\"\n\nimport unittest\nimport numpy as np\n\n\nclass TestBootstrap(unittest.TestCase):\n \"\"\" bootstrap tests\n \"\"\"\n\n def test_bootstrap_sample(self):\n from pyrsa.inference im...
[ [ "numpy.all", "numpy.array", "numpy.random.rand" ] ]
noabauma/Mirheo
[ "bf7979bfbbf402d33c26ac5dc879f880e78e7017" ]
[ "tests/ic/uniform.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport mirheo as mir\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--domain\", type=float, nargs=3, default=[4., 2., 3.])\nargs = parser.parse_args()\n\nranks = (1, 1, 1)\ndomain = args.domain\ndensity = 8\n\nu = mir.Mirheo(ranks, tuple(...
[ [ "numpy.savetxt" ] ]
yuleiniu/introd
[ "a40407c7efee9c34e3d4270d7947f5be2f926413" ]
[ "css/dataset.py" ]
[ "from __future__ import print_function\r\nfrom __future__ import unicode_literals\r\n\r\nimport os\r\nimport json\r\nimport cPickle\r\nfrom collections import Counter\r\n\r\nimport numpy as np\r\nimport utils\r\nimport h5py\r\nimport torch\r\nfrom torch.utils.data import Dataset\r\nfrom tqdm import tqdm\r\nfrom ran...
[ [ "torch.zeros", "numpy.array", "torch.from_numpy" ] ]
coreyauger/daytrader-utils
[ "cdb5b4b7f32e75814486a8e186a8fd9b35dfd8a7" ]
[ "label_dist.py" ]
[ "\nimport numpy as np\nimport os\nimport dtdata as dt\nfrom sklearn.neighbors import NearestNeighbors\nfrom sklearn.decomposition import PCA\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nsns.set(color_codes=True)\n\nplt.rcParams['interactive'] == True\n\n# fix random seed for reproducibility\nnp.random.s...
[ [ "numpy.random.seed", "matplotlib.pyplot.show", "numpy.sort" ] ]
lisc119/Soiling-Loss-Analysis
[ "979424a9b355a0ad6196492d105d1905844cd238" ]
[ "src/scripts/calc_gaps.py" ]
[ "import pandas as pd\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n# Get times that fall within one SD of mean in distribution\ndef get_1sd_times(df_std, sd = 1):\n mean = df_std.mean()\n lb = mean - (df_std.std() * sd)\n ub = mean + (df_std.std() * sd)\n try: \n temp = df_std.to_f...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.style.use", "matplotlib.pyplot.subplots", "pandas.Series" ] ]
LiGuihong/Capsule
[ "c445f7d5f4357e4d60ea87fe64865192ba051023" ]
[ "main_v2.py" ]
[ "import os\nimport sys\nimport numpy as np\nimport tensorflow as tf\nfrom tqdm import tqdm\n\nfrom config import cfg\nfrom utils import load_data\nfrom capsNet import CapsNet\n\n\ndef save_to():\n if not os.path.exists(cfg.results):\n os.mkdir(cfg.results)\n if cfg.is_training:\n loss = cfg.resu...
[ [ "numpy.isnan", "tensorflow.train.latest_checkpoint", "tensorflow.train.Supervisor", "tensorflow.logging.info", "tensorflow.contrib.tfprof.ProfileContext", "tensorflow.ConfigProto", "tensorflow.app.run" ] ]
Ynjxsjmh/Tensorflow-2-Reinforcement-Learning-Cookbook
[ "aa27bbbcc532e5e8b239aa019c3ca1e0bc2cf059" ]
[ "Chapter06/2_call_to_action_agent.py" ]
[ "#!/usr/bin/env python\n# Agent training script for completing call-to-action tasks on websites\n# Chapter 6, TensorFlow 2 Reinforcement Learning Cookbook | Praveen Palanisamy\n\nimport argparse\nimport os\nfrom datetime import datetime\n\nimport gym\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.ker...
[ [ "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "numpy.mean", "tensorflow.clip_by_value", "tensorflow.keras.initializers.he_normal", "tensorflow.keras.backend.set_floatx", "numpy.zeros_like", "numpy.random.normal", "tensorflow.GradientTape", "tensorflow.ma...
youdar/work
[ "d5f32015e7be1d58ede255eeadbd1d12acb3f270" ]
[ "work/Clashes/Old work/clash_draw.py" ]
[ "from __future__ import division\nimport numpy as nm\nimport matplotlib.pyplot as plt\n\nclass draw_circle(object):\n def __init__(self,x,y,r,col,opt):\n '''\n \n '''\n theta = range(start=0, stop=nm.pi, step=0.1)\n \n \n \ndef run():\n fig = plt.figure()\n ...
[ [ "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlim", "matplotlib.pyplot.figure" ] ]
2010019970909/design_of_experiments
[ "72030c2916f938637c86302b311eab25dd52cbe3" ]
[ "src/design_of_experiments.py" ]
[ "\"\"\"\nThe aim of this script is to automate some process in\nthe Design of experiments (DoE) workflow.\n\"\"\"\n__author__ = \"Vincent STRAGIER\"\n\n# Maths modules\nfrom itertools import permutations, combinations\nfrom scipy.special import erfinv\nimport numpy as np\n\n# Plotting module\nimport matplotlib.pypl...
[ [ "numpy.array", "numpy.dot", "matplotlib.pyplot.subplots", "numpy.multiply", "numpy.arange", "scipy.special.erfinv", "numpy.abs", "numpy.sqrt", "matplotlib.pyplot.show", "numpy.log2" ] ]
yuanyuan0057/ReAgent
[ "b43ceca1fe83458e2f7ea1cf8d9c447cddb7f202" ]
[ "reagent/training/c51_trainer.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nfrom typing import List\n\nimport reagent.types as rlt\nimport torch\nfrom reagent.core.configuration import resolve_defaults\nfrom reagent.core.dataclasses import field\nfrom reagent.optimizer import Optimizer__Unio...
[ [ "torch.no_grad", "torch.linspace", "torch.full_like", "torch.zeros_like", "torch.argmax" ] ]
HFTshoon/deep-learning-from-scratch
[ "c7c85abb33fbb710f055daec6d2c31322401fa02" ]
[ "exercise/ch04/loss_functions.py" ]
[ "import numpy as np\n\ndef sum_squares_error(y,t):\n\treturn 0.5*np.sum((y-t)**2)\n\n\"\"\"\ndef cross_entropy_error(y,t)\n\tdelta=1e-7\n\treturn -np.sum(t*np.log(y+delta))\n\"\"\"\n\ndef cross_entropy_error(y,t):\n\tif y.ndim==1:\n\t\tt=t.reshape(1,t.size)\n\t\ty=y.reshape(1,y.size)\n\n\tbatch_size=y.shape[0]\n\td...
[ [ "numpy.sum", "numpy.arange" ] ]
VectorInstitute/DANER
[ "2b5feadda6c1d35ab7be09277339c490396bc49e" ]
[ "backend/models/huggingface_model.py" ]
[ "from typing import List\nfrom copy import deepcopy\n\nimport spacy\nimport torch\n\nuse_cuda = torch.cuda.is_available()\nDEFAULT_LABEL = ['O', 'B-PER', 'I-PER', 'B-ORG',\n 'I-ORG', 'B-LOC', 'I-LOC', 'B-MISC', 'I-MISC']\nBIO_MAP = {\n \"B\": 3,\n \"I\": 1,\n \"O\": 2\n}\n\nnlp = spacy.load...
[ [ "torch.cuda.is_available" ] ]
aribornstein/ignite-learning-paths
[ "cb7415d3bb26d8e6dbda1cf94c4e78578130f97a" ]
[ "aiml/aiml21/code/explore.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Explore Dataset \n\n# We will explore the **data_train.csv dataset** from the Tailwind Traders support team department. \n# \n# This is historical data about the features of each support ticket submitted. This data could unlock insights to help the support team become ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.pie", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "numpy.sort", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.bar", "matplotlib.pyplot.xticks...
Therealchainman/Algorithms-for-Automated-Driving
[ "dfa55498e5ab6e26307b5e1ce8fce695fb4e6ec5" ]
[ "code/util/carla_util.py" ]
[ "import carla\r\nimport pygame\r\n\r\nimport queue\r\nimport numpy as np\r\n\r\ndef carla_vec_to_np_array(vec):\r\n return np.array([vec.x,\r\n vec.y,\r\n vec.z])\r\n\r\nclass CarlaSyncMode(object):\r\n \"\"\"\r\n Context manager to synchronize output from different ...
[ [ "numpy.array", "numpy.reshape", "numpy.dtype" ] ]
IPL-UV/LatentGranger
[ "78d25621f94f338c3c1957a216679c94b2d9b764" ]
[ "explain.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# BSD 3-Clause License (see LICENSE file)\n# Copyright (c) Image and Signaling Process Group (ISP) IPL-UV 2021\n# All rights reserved.\n\n\"\"\"\nExplain latent space of LatentGranger\n\"\"\"\n\nimport os\nimport git\nimport numpy as np\nimport argparse, yaml\nfro...
[ [ "torch.zeros", "numpy.zeros", "torch.amax", "numpy.mean", "torch.amin", "torch.std_mean", "torch.mean", "torch.reshape" ] ]
kate-sann5100/tutorials
[ "49e78ffeb7b0a473c9a74112ee4020610c5659e7", "49e78ffeb7b0a473c9a74112ee4020610c5659e7" ]
[ "3d_classification/ignite/densenet_training_dict.py", "modules/engines/gan_training.py" ]
[ "# Copyright 2020 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to i...
[ [ "numpy.array", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss" ], [ "torch.cuda.is_available", "torch.nn.BCELoss", "torch.nn.Sigmoid" ] ]
DonnieKim411/apex
[ "fb00a5a1d569c7b118aa672b3dacac3663ca3911" ]
[ "apex/contrib/multihead_attn/fast_self_multihead_attn_norm_add_func.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import Parameter\nimport torch.nn.functional as F\nfrom torch.autograd.variable import Variable\n\nimport fast_self_multihead_attn_norm_add\n\nclass FastSelfAttnNormAddFunc(torch.autograd.Function) :\n @staticmethod\n def forward(ctx, use_time_mask, is_train...
[ [ "torch.tensor" ] ]
garrett-yoon/amr-uti-stm
[ "440759e466ac9c31a2bbcea571aca3084fa44464" ]
[ "analysis_utils/best_case_baseline_utils.py" ]
[ "import pandas as pd\nimport os\nimport sys\n\nsys.path.append('../../')\nfrom models.indirect.policy_learning_thresholding import get_iat_broad\nfrom utils.evaluation_utils import calculate_ci\n\ndef get_best_case_idsa_baseline(resist_df,\n switch_props,\n ...
[ [ "pandas.DataFrame" ] ]
yynst2/basenji
[ "6d7cc6e2fecade5cd9a66ab29452131dcb1d618e" ]
[ "bin/basenji_sad_ref.py" ]
[ "#!/usr/bin/env python\n# Copyright 2017 Calico LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "pandas.read_table", "numpy.percentile", "numpy.copy", "tensorflow.Session", "tensorflow.train.Saver", "numpy.min", "tensorflow.data.Dataset.from_generator", "tensorflow.Dimension", "numpy.arange", "numpy.log2" ...
Tak-Man/ML-rapid-text-labeling
[ "c5fa5439bfcd3ba652be1dfdd101831fbd02d9d4" ]
[ "web-testing/simulation_results/selenium recommended texts/007/web_automate2.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Oct 23 08:58:37 2021\n\n@author: michp-ai\n\"\"\"\n\n# This script is web automation for the Capstone project on ML rapid text labeling\n# Before running this script in a different console start the web server by running main.py for the web app\n# This is a simple de...
[ [ "pandas.DataFrame", "sklearn.metrics.accuracy_score" ] ]
vsaase/dicom2nifti
[ "6722420a7673d36437e4358ce3cb2a7c77c91820" ]
[ "dicom2nifti/convert_siemens.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\ndicom2nifti\n\n@author: abrys\n\"\"\"\nimport os\nimport re\nimport traceback\n\nimport logging\nimport nibabel\nimport numpy\n\nfrom pydicom.tag import Tag\n\nimport dicom2nifti.common as common\nimport dicom2nifti.convert_generic as convert_generic\nfrom dicom2nifti.exceptions im...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.zeros", "numpy.shape", "numpy.transpose", "numpy.cross" ] ]
DinoMan/dino-tk
[ "b3937b816667f8c2d7bb0751a7107a6d78a222e1" ]
[ "dtk/metrics/image.py" ]
[ "from skimage.color import rgb2grey\nfrom scipy import fftpack\nimport numpy as np\nimport numpy.ma as ma\n\n\ndef _dict_divide_(dividends, divisors):\n ret = dict()\n for key, dividend in dividends.items():\n ret[key] = dividend / divisors.get(key, 1)\n return ret\n\n\ndef _get_hashable_key_(key):\...
[ [ "numpy.logical_or", "scipy.fftpack.fftshift", "numpy.sum", "numpy.rollaxis", "numpy.logical_and", "numpy.ma.masked_array", "numpy.abs", "numpy.all", "scipy.fftpack.fft2" ] ]
tonyyang-svail/elasticdl
[ "f7d266cf600c7205d68f59447abd55eff222ac2b" ]
[ "elasticdl/python/common/model_handler.py" ]
[ "import abc\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.feature_column import feature_column_v2 as fc_lib\n\nfrom elasticdl.python.common.constants import DistributionStrategy\nfrom elasticdl.python.common.log_utils import default_logger as logger\nfrom elasticdl.python.common.save_utils ...
[ [ "tensorflow.python.feature_column.feature_column_v2.embedding_column", "numpy.zeros", "tensorflow.keras.layers.DenseFeatures", "tensorflow.keras.layers.Embedding", "tensorflow.keras.backend.clear_session", "tensorflow.keras.models.clone_model", "tensorflow.keras.initializers.serialize"...
QinganZhao/Introduction-to-Machine-Learning
[ "57edb519aaff3851e94c1917c9556180e0bb281a", "57edb519aaff3851e94c1917c9556180e0bb281a" ]
[ "Boosting and CNN/CNN/viz_features.py", "SVM and kNN/world_values_pipelines.py" ]
[ "from sklearn.metrics import confusion_matrix\nimport matplotlib.pyplot as plt\nimport random\nimport cv2\nimport IPython\nimport numpy as np\n\n\n\nclass Viz_Feat(object):\n\n\n def __init__(self,val_data,train_data, class_labels,sess):\n\n self.val_data = val_data\n self.train_data = train_data\n...
[ [ "numpy.array", "numpy.zeros" ], [ "sklearn.linear_model.Lasso", "sklearn.preprocessing.StandardScaler", "sklearn.neighbors.KNeighborsClassifier", "sklearn.linear_model.Ridge", "sklearn.preprocessing.RobustScaler", "sklearn.svm.SVC", "sklearn.tree.DecisionTreeClassifier", ...
BrianTillman/captum
[ "edf41d31bd12bd38846b1214ade0ad897063a4d4" ]
[ "captum/insights/api.py" ]
[ "#!/usr/bin/env python3\nfrom collections import namedtuple\nfrom typing import Callable, Iterable, List, NamedTuple, Optional, Tuple, Union\n\nimport torch\nfrom captum.attr import IntegratedGradients\nfrom captum.attr._utils.batching import _batched_generator\nfrom captum.attr._utils.common import _run_forward, s...
[ [ "torch.norm", "torch.tensor" ] ]
RicardLake/FedDetection
[ "a4004593a4d07126447db73b98b53a7e56e0472b" ]
[ "experiments/distributed/detection/transforms.py" ]
[ "import torch\r\nimport torchvision\r\n\r\nfrom torch import nn, Tensor\r\nfrom torchvision.transforms import functional as F\r\nfrom torchvision.transforms import transforms as T\r\nfrom typing import List, Tuple, Dict, Optional\r\n\r\n\r\ndef _flip_coco_person_keypoints(kps, width):\r\n flip_inds = [0, 2, 1, 4...
[ [ "torch.rand", "torch.jit.is_scripting", "torch.randperm", "torch.tensor" ] ]
sarveshbhatnagar/sparse
[ "73d5a2f61da5ad45a501f37279c1784f65001dc3" ]
[ "sparse/tests/test_coo.py" ]
[ "import contextlib\nimport operator\nimport pickle\nimport sys\nfrom functools import reduce\n\nimport numpy as np\nimport pytest\nimport scipy.sparse\nimport scipy.stats\n\nimport sparse\nfrom sparse import COO\nfrom sparse._settings import NEP18_ENABLED\nfrom sparse._utils import assert_eq, random_value_array, ht...
[ [ "numpy.int8", "numpy.isclose", "numpy.random.rand", "numpy.random.choice", "numpy.copy", "numpy.resize", "numpy.where", "numpy.outer", "numpy.random.random", "numpy.issubdtype", "numpy.dtype", "numpy.full_like", "numpy.concatenate", "numpy.full", "numpy....
ZaydH/malware_gan
[ "ea3f4e5139e6343c26273db0299a4b9d96d814af" ]
[ "malgan/discriminator.py" ]
[ "# -*- coding: utf-8 -*-\nr\"\"\"\n malgan.discriminator\n ~~~~~~~~~~~~~~~~~\n\n Discriminator (i.e., substitute detector) block for MalGAN.\n\n Based on the paper: \"Generating Adversarial Malware Examples for Black-Box Attacks Based on GAN\"\n By Weiwei Hu and Ying Tan.\n\n :version: 0.1.0\n ...
[ [ "torch.nn.Sequential", "torch.nn.Linear", "torch.clamp", "torch.nn.Sigmoid" ] ]
gpageinin/puzzle
[ "7aa12751bc0cb4d22aa91c2dd5b5fbc84ff65686" ]
[ "train.py" ]
[ "import gym\nimport numpy as np\nimport torch\nimport torch.optim as opt\nfrom tqdm import tqdm\n\nimport gym_puzzle\nfrom agent import Agent\n\n\n# ハイパーパラメータ\nHIDDEN_NUM = 128 # エージェントの隠れ層のニューロン数\nEPISODE_NUM = 10000 # エピソードを何回行うか\nMAX_STEPS = 1000 # 1エピソード内で最大何回行動するか\nGAMMA = .99 # 時間割引率\n\nenv = gym.make('pu...
[ [ "torch.eye", "torch.no_grad", "torch.tensor" ] ]
awesome-archive/Paddle
[ "7bfcea5da0cc31d71c6f445c132cd673eb16bd2e" ]
[ "python/paddle/vision/ops.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 ...
[ [ "numpy.prod" ] ]
ishine/Mutiband-HIFIGAN
[ "6eeab0fbb17c83f6afe3d933553a996c9499c988" ]
[ "stftloss.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright 2019 Tomoki Hayashi\n# MIT License (https://opensource.org/licenses/MIT)\n\n\"\"\"STFT-based Loss modules.\"\"\"\n\nimport torch\nimport torch.nn.functional as F\n\nfrom distutils.version import LooseVersion\n\nis_pytorch_17plus = LooseVersion(torch.__version__) >= LooseVers...
[ [ "torch.nn.ModuleList", "torch.norm", "torch.clamp", "torch.log", "torch.stft" ] ]
ajaybhaga/MGSim
[ "adf0bb4a8af42a4b42bc47a2d191a7c40ceab459" ]
[ "test_perf.py" ]
[ "#import tensorflow as tf\n#import tensorflow as tf; print(tf.__version__); tf.test.is_gpu_available(cuda_only=False,min_cuda_compute_capability=None)\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\n\n\nimport time\ncpu_times = []\nsizes = [1, 10, 100, 500, 1000, 2000, 3000, 4000, 5000, 8000, 10000]\n...
[ [ "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.disable_v2_behavior", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.reset_default_...
tsommerfeld/Psi4_to_OLDMOS
[ "5ed66db6ea5b1da7af66c0ad9bd9990066aa04e4" ]
[ "lib/.ipynb_checkpoints/SO_aux-checkpoint.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jan 2 12:13:12 2022\n\n@author: Thomas Sommerfeld\n\nClass for dealing with Psi4 to Cfour SO mapping/transformation\n\n\"\"\"\n\nimport numpy as np\n\nclass SymOrbs:\n \"\"\" \n SOs for one irrep \n each SO is a column; each ...
[ [ "numpy.nonzero", "numpy.zeros" ] ]
mcerruti/gammapy
[ "544f33dd0f43bccfa0a8e9810f166d3730437ae2" ]
[ "gammapy/maps/tests/test_hpxnd.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_allclose\nfrom astropy import units as u\nfrom astropy.coordinates import SkyCoord\nfrom astropy.io import fits\nfrom regions import CircleSkyRegion\nfrom gammapy.maps import HpxGeom...
[ [ "numpy.max", "numpy.testing.assert_allclose", "numpy.ones_like", "numpy.sum", "numpy.nansum", "numpy.ones", "numpy.random.uniform", "numpy.arange", "numpy.logspace" ] ]
KSomi/models
[ "cc6c45ca6b701426d35bbbab104ad32a2e80a3cf" ]
[ "research/deeplab/evaluation/panoptic_quality_test.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 requi...
[ [ "numpy.array", "numpy.zeros_like", "numpy.zeros", "numpy.testing.assert_array_equal", "numpy.testing.assert_array_almost_equal" ] ]
andyjpaddle/Paddle
[ "7a0cc0a99996d6449256b08d4c7e4360d8fdd724" ]
[ "python/paddle/fluid/tests/unittests/interpreter/test_standalone_executor.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...
[ [ "numpy.array", "numpy.ones", "numpy.array_equal" ] ]
mjziebarth/gmt-python-extensions
[ "a6a42b0d2ae123117c780d4ce3f93563ad3ad4d8" ]
[ "gmt_extensions/grid.py" ]
[ "# A grid class.\n#from scipy.interpolate import SmoothSphereBivariateSpline\nfrom scipy.interpolate import LinearNDInterpolator,NearestNDInterpolator\nfrom tempfile import NamedTemporaryFile\nimport numpy as np\nimport gmt\nfrom os import remove\nfrom shutil import copyfile\nfrom math import gcd\n\ndef same_shape(...
[ [ "numpy.logical_or", "numpy.count_nonzero", "numpy.array", "numpy.array_equal", "numpy.savetxt", "numpy.zeros", "scipy.interpolate.NearestNDInterpolator", "numpy.round", "numpy.sin", "scipy.interpolate.LinearNDInterpolator", "numpy.isnan", "numpy.issorted", "nump...
alexban94/msci_project
[ "6f449e1462d0634ca6623f835c074702ed05054e" ]
[ "code/evaluation.py" ]
[ "import os\nimport sys\nimport math\n\nimport numpy as np\nfrom PIL import Image\nimport scipy.linalg\n\nimport chainer\nimport chainer.cuda\nfrom chainer import Variable\nfrom chainer import serializers\nfrom chainer import cuda\nimport chainer.functions as F\n\nsys.path.append(os.path.dirname(__file__))\nsys.path...
[ [ "numpy.concatenate", "numpy.array", "numpy.dot", "numpy.asarray", "numpy.random.seed", "numpy.sum", "numpy.load", "numpy.real", "numpy.mean", "numpy.std", "numpy.arange", "numpy.linalg.svd", "numpy.clip" ] ]
hristog/distributed
[ "25a2867e8e950d9cb51b071337ffc43ddaf0bb52" ]
[ "distributed/protocol/numpy.py" ]
[ "import math\nimport numpy as np\n\nfrom .serialize import dask_serialize, dask_deserialize\nfrom . import pickle\n\nfrom ..utils import log_errors\n\n\ndef itemsize(dt):\n \"\"\"Itemsize of dtype\n\n Try to return the itemsize of the base element, return 8 as a fallback\n \"\"\"\n result = dt.base.item...
[ [ "numpy.ascontiguousarray", "numpy.ndarray", "numpy.require", "numpy.ma.masked_array", "numpy.dtype" ] ]
Bhare8972/LOFAR-LIM
[ "89f25be8c02cb8980c2e237da3eaac279d40a06a" ]
[ "LIM_scripts/examples/histogram_planewave_fits.py" ]
[ "#!/usr/bin/env python3\n\n\nfrom os import mkdir\nfrom os.path import isdir\n\nfrom pickle import load\n\nfrom matplotlib import pyplot as plt\nimport numpy as np\n\nfrom LoLIM.make_planewave_fits import planewave_fits\nfrom LoLIM.IO.raw_tbb_IO import filePaths_by_stationName\nfrom LoLIM.utilities import v_air, p...
[ [ "numpy.average", "matplotlib.pyplot.savefig", "matplotlib.pyplot.hist", "matplotlib.pyplot.close" ] ]
tntek/G2KD
[ "28bfc5420b319a1ab1ce6d0374906f3bf0b93c36" ]
[ "G2KD_VIT/loss.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport math\nimport torch.nn.functional as F\nimport pdb\n\ndef Entropy(input_):\n bs = input_.size(0)\n epsilon = 1e-5\n entropy = -input_ * torch.log(input_ + epsilon)\n entropy = torch.sum(entropy, dim=1)\n...
[ [ "torch.cuda.is_available", "torch.eye", "torch.exp", "torch.nn.CrossEntropyLoss", "torch.sum", "torch.unbind", "torch.nn.BCELoss", "torch.device", "numpy.array", "torch.nn.functional.one_hot", "torch.log_softmax", "torch.max", "torch.clamp", "torch.nn.functi...
Ariyl/AerialDetection
[ "dc3384ff42d06e0ba9c9df2e2d053d8df7d1b726" ]
[ "tools/test_mRI.py" ]
[ "import argparse\nimport os\nimport os.path as osp\nimport shutil\nimport tempfile\n\nimport mmcv\nimport torch\nimport torch.distributed as dist\nfrom mmcv.runner import load_checkpoint, get_dist_info\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\n\nfrom mmdet.apis import init_dist\nfrom mmd...
[ [ "torch.no_grad", "torch.distributed.barrier", "torch.full", "torch.distributed.broadcast" ] ]
JunMa11/MICCAI2020-Refuge2
[ "b6aed222f47146c739f7a6f64da5653f02e683cc" ]
[ "predict_Fovea_seg_stage1.py" ]
[ "import os\r\nimport numpy as np\r\nimport torch\r\nimport math\r\nimport segmentation_models_pytorch as smp\r\nimport pickle\r\nimport cv2\r\nimport argparse\r\nfrom utils import remove_small_areas, keep_large_area\r\nfrom skimage import exposure, io\r\nimport torch.nn as nn\r\nfrom skimage.measure import *\r\nimp...
[ [ "torch.sigmoid", "numpy.zeros", "numpy.ascontiguousarray", "pandas.DataFrame", "torch.no_grad", "torch.from_numpy", "torch.load", "numpy.flip" ] ]
gboeing/pylogit
[ "ac6b5ad988cb62443727ae70fcbcc7a3b47592ac" ]
[ "tests/test_nested_logit.py" ]
[ "\"\"\"\nTests for the nested_logit.py file. These tests do not include tests of\nthe functions that perform the mathematical calculations necessary to estimate\nthe Nested Logit model.\n\"\"\"\nimport warnings\nimport unittest\nfrom collections import OrderedDict\n\nimport numpy as np\nimport numpy.testing as npt\...
[ [ "numpy.concatenate", "numpy.testing.assert_allclose", "numpy.array", "numpy.zeros", "numpy.arange" ] ]
SHMAKI/2021_TamoxifenResistance
[ "637a3e30222983d9bcb9881544ec613a7a2a99a3" ]
[ "Figure_4/biomass/ga/ga_continue.py" ]
[ "import time\nimport numpy as np\n\nfrom biomass.exec_model import ExecModel\nfrom .rcga import (UnimodalNormalDistributionXover,\n DistanceIndependentDiversityControl)\n\nclass GeneticAlgorithmContinue(ExecModel):\n def __init__(self, model, max_generation, allowable_error, p0_bounds):\n ...
[ [ "numpy.full", "numpy.empty", "numpy.random.choice", "numpy.isfinite", "numpy.clip", "numpy.argsort", "numpy.log10" ] ]
cipherhacker/Pluto-Blink-Monitoring
[ "8e927690a2420e3500457d412413614f24735ab9" ]
[ "plt.py" ]
[ "import tkinter as tk\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\nimport pandas as pd\nfrom pandas import DataFrame\nimport numpy as np\nimport time\n\nroot= tk.Tk()\n\n\nfileInstance = open('demofile.txt', 'r')\ntext = fileInstance.read().split(\",\")\n\ntext_...
[ [ "matplotlib.pyplot.Figure", "pandas.DataFrame", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg" ] ]
nikon-petr/kohonen
[ "c23ae3032c58681040fe023bfa395d1ff9989876" ]
[ "core/net_neighboring_calculator.py" ]
[ "import pprint\n\nimport numpy as np\n\nfrom core.net_errors import NetIsNotInitialized\n\n\ndef calculate_average_neighboring(net_object):\n if net_object.net is None:\n raise NetIsNotInitialized()\n\n net = net_object.net\n\n zero_weights = np.zeros((net_object.config[0]))\n\n weights = np.ma.a...
[ [ "numpy.ndindex", "numpy.reshape", "numpy.zeros", "numpy.nanmean", "numpy.all", "numpy.insert" ] ]
HarryMellsop/chept-neural-chess
[ "656cb385e69d21c28117ef1fd0ecc671e01f1c1d" ]
[ "evaluate_commentary.py" ]
[ "import chess\nimport argparse\nimport questionary\nimport os\nimport json\nimport numpy as np\nimport torch\nfrom tqdm import tqdm\nimport model\nimport utils\nimport pickle\nimport chess.engine\nimport nltk\n\nfrom nltk.translate.bleu_score import SmoothingFunction\n\nMASK_CHAR = u\"\\u2047\"\nengine = chess.engi...
[ [ "torch.device", "numpy.mean", "torch.cuda.current_device", "torch.cuda.is_available", "torch.tensor" ] ]
kvathupo/qfs-optimization
[ "e1d2c3f885ad422a0d1ad91b3a50c96f7ce183fa" ]
[ "MEAN_VAR-yahoo-visual/MV_yahoo_visual.py" ]
[ "# Note:\r\n#\r\n# When making edits, please adhere to PEP8 style guidelines and avoid\r\n# exceeding 75 characters in one line.\r\n#\r\n\r\nimport sys\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\n#\r\n# Importing bokeh functions\r\n#\r\nfrom bokeh.plotting import figure, output_file, show, ColumnDataSource\...
[ [ "pandas.DataFrame", "pandas.read_csv", "numpy.linalg.inv" ] ]
HermannLizard/pipcook-plugin-pytorch-yolov5-model-train
[ "04760b0301ea091af675e868b2a803674a3ca670" ]
[ "__init__.py" ]
[ "import os\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__)))\n\nimport yaml\nimport logging\nimport torch\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lr_scheduler\nfrom torch.cuda import amp\nfrom tools.datasets import create_dataloader, preprocess\nfrom tqdm import tqdm\nim...
[ [ "numpy.concatenate", "torch.zeros", "numpy.array", "torch.cuda.amp.autocast", "numpy.zeros", "torch.save", "torch.optim.SGD", "numpy.interp", "torch.cuda.device_count", "torch.cuda.is_available", "torch.tensor", "torch.cuda.amp.GradScaler", "torch.cuda.memory_re...
GEOS-ESM/GMAO_Shared
[ "022af23abbc7883891006b57379be96d9a50df23", "022af23abbc7883891006b57379be96d9a50df23" ]
[ "GEOS_Util/coupled_diagnostics/analysis/clim/precip.py", "GEOS_Util/coupled_diagnostics/verification/levitus/s_profile.py" ]
[ "#!/usr/bin/env python\n\nimport matplotlib\nmatplotlib.use('Agg')\n\nimport os, sys\nfrom importlib import import_module\nimport netCDF4 as nc\nimport scipy as sp\nimport matplotlib.pyplot as pl\nfrom matplotlib import colors\nfrom mpl_toolkits.basemap.cm import s3pcpn_l, sstanom\nimport g5lib.plotters as ptrs\nfr...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.colors.Normalize", "matplotlib.pyplot.clf" ], [ "matplotlib.ticker.MultipleLocator", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplo...
qiushuiai/RLs
[ "a612ecaf3a47bdcbb412250a3bfdfa579578a183" ]
[ "rls/algos/single/tac.py" ]
[ "#!/usr/bin/env python3\r\n# encoding: utf-8\r\n\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport tensorflow_probability as tfp\r\n\r\nfrom rls.algos.base.off_policy import Off_Policy\r\nfrom rls.utils.tf2_utils import (tsallis_squash_rsample,\r\n gaussian_entropy,\r\n ...
[ [ "tensorflow.exp", "tensorflow.square", "tensorflow.multiply", "tensorflow.minimum", "tensorflow.GradientTape", "numpy.log", "tensorflow.argmax", "tensorflow.one_hot", "tensorflow.Variable", "tensorflow.math.log", "tensorflow.nn.softmax", "tensorflow.device", "te...
lzzppp/DERT
[ "e1f9ee2489f76e2ed741d6637fd2b1e8bb225fb6" ]
[ "text_er/MCAN_hier/model/_utils.py" ]
[ "import pdb\n\nimport six\n\nimport deepmatcher as dm\nimport torch\n\nfrom deepmatcher.batch import AttrTensor\n\n\ndef sequence_mask(lengths, max_len=None):\n batch_size = lengths.numel()\n max_len = max_len or lengths.max()\n return (torch.arange(0, max_len).type_as(lengths).repeat(batch_size, 1).lt(\n ...
[ [ "torch.arange" ] ]
Bradan/deepwriting
[ "1c2a9d030d691c88dfc70483adcccb671a313512" ]
[ "tf_train_hw_classification.py" ]
[ "import pickle\nimport json\nimport sys\nimport time\nimport os\nimport argparse\n\nimport tensorflow as tf\nfrom tensorflow.python.ops import math_ops\nfrom tensorflow.python.framework import dtypes\n\nfrom tf_dataset_hw import *\nfrom tf_data_feeder import *\nfrom tf_models_hw_classification import *\nfrom utils ...
[ [ "tensorflow.train.start_queue_runners", "tensorflow.clip_by_norm", "tensorflow.clip_by_value", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "tensorflow.set_random_seed", "tensorflow.trainable_variables", "tensorflow.train.latest_checkpoint", ...
yizhou-wang/RODNet
[ "389ff84ce4b111b36306dd22a49d3c64bded64ac" ]
[ "tools/train.py" ]
[ "import os\nimport time\nimport json\nimport argparse\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim.lr_scheduler import StepLR\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom cruw import CRUW\n\nfrom rodnet.datasets.CRDatase...
[ [ "torch.optim.lr_scheduler.StepLR", "torch.nn.MSELoss", "torch.save", "torch.utils.data.DataLoader", "torch.load", "torch.nn.BCELoss", "torch.utils.tensorboard.SummaryWriter" ] ]
Malga-Vision/fastervideo
[ "34e212fe04398262e5dac7f74ac4c2365fc1e03f" ]
[ "detectron2/data/build.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport bisect\nimport copy\nimport itertools\nimport logging\nimport numpy as np\nimport pickle\nimport torch.utils.data\nfrom fvcore.common.file_io import PathManager\nfrom tabulate import tabulate\nfrom termcolor import colored\n\nfrom detec...
[ [ "numpy.histogram", "numpy.array", "numpy.zeros", "numpy.random.randint", "numpy.arange" ] ]
gplatono/StructureLearning
[ "85e7174e12b88f83309ea8a8fb8e8e5e54325842" ]
[ "voxelnet.py" ]
[ "import bpy\nimport torch\nimport numpy as np\n\nobjects = bpy.context.scene.objects\n\ndef get_centroids():\n\treturn [np.array(obj.location) for obj in objects]\n\n#print (get_centroids())\n\ndef perturb(struct, size):\n\tperturbed = []\n\tamplitude = size / 5\n\tfor point in struct:\n\t\tperturb = np.random.mult...
[ [ "numpy.array", "numpy.random.randint", "numpy.random.multivariate_normal" ] ]
d294270681/bert4keras
[ "18451a81761cc0d6c206ff5b64cfe47080f8273b" ]
[ "bert4keras/snippets.py" ]
[ "#! -*- coding: utf-8 -*-\n# 代码合集\n\nimport six\nimport logging\nimport numpy as np\nimport re\nimport sys\nfrom collections import defaultdict\nimport json\nimport tensorflow as tf\nfrom bert4keras.backend import K, keras\n\n_open_ = open\nis_py2 = six.PY2\n\nif not is_py2:\n basestring = str\n\n\ndef to_array(...
[ [ "numpy.exp", "numpy.apply_along_axis", "numpy.cumsum", "numpy.concatenate", "numpy.empty", "numpy.log", "tensorflow.get_default_graph", "numpy.argmax", "numpy.arange", "numpy.pad", "numpy.array", "numpy.zeros", "numpy.roll", "numpy.shape", "numpy.random....
hc07180011/IQA-testing
[ "29b0c61a4dafa57203098811190f7152c1a9bf33" ]
[ "IQA/index/colourcast.py" ]
[ "import cv2 as cv\nimport numpy as np\n\n\nclass ColourCast:\n\n def __init__(self, img_input: np.ndarray) -> None:\n self.img_input = img_input\n\n def color_cast(self):\n # RGB to La*b*\n img_float = self.img_input.astype(np.float32) / 255.0\n\n np_R = img_float[:, :, 2]\n ...
[ [ "numpy.var", "numpy.sqrt" ] ]
startable/pdtable
[ "693af4f4d49a27f54c79887a42a0b1a1b68d77a9" ]
[ "pdtable/io/parsers/columns.py" ]
[ "\"\"\"Machinery to parse columns in accordance with their unit indicator.\n\nParsers to convert column values of uncontrolled data types into values with a data type\nconsistent with the intended representation given the column's unit indicator.\n\nA data-type-specific parser is implemented for each of the allowab...
[ [ "pandas.to_datetime", "numpy.array" ] ]
JoeMWatson/trajopt
[ "8b98718721e0c373cd7dc01a35f42447c1134713" ]
[ "trajopt/ilqr/ilqr.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# @Filename: ilqr\n# @Date: 2019-06-23-14-00\n# @Author: Hany Abdulsamad\n# @Contact: hany@robot-learning.de\n\nimport autograd.numpy as np\n\nfrom trajopt.ilqr.objects import AnalyticalLinearDynamics, AnalyticalQuadraticCost\nfrom trajopt.ilqr.objects import Quadra...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplot", "matplotlib.pyplot.figure" ] ]
HugoBourdon/flatland-project
[ "bd459517c7774ecd0072969f7d548a084bc3b580" ]
[ "model.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\n\nclass PolicyNetwork(nn.Module):\n\n def __init__(self, state_size, action_size, hidsize1=128, hidsize2=128):\n super(PolicyNetwork, self).__init__()\n\n self.fc1 = nn.Linear(state_size, hidsize1)\n self.fc2 = nn.Linear(hidsize1, hids...
[ [ "torch.nn.Linear" ] ]
1512159/tf-faster-rcnn-medico
[ "94c5cff76ef7bd271de050a8de53bd0145c6c8ec" ]
[ "tools/medico_classify.py" ]
[ "#!/usr/bin/env python\n\n# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Xinlei Chen, based on code from Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"\nDemo script s...
[ [ "matplotlib.use", "matplotlib.pyplot.colorbar", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "tensorflow.Session", "tensorflow.train.Saver", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "tensorflow.ConfigP...
albertogaspar/dts
[ "9fcad2c672cdcf5d2c6bd005dae05afc65f97e58" ]
[ "dts/utils/utils.py" ]
[ "import keras.backend as K\nimport numpy as np\nimport pandas as pd\nfrom datetime import time, datetime\nimport tensorflow as tf\nfrom argparse import ArgumentParser\n\n\ndef get_flops(model):\n run_meta = tf.RunMetadata()\n opts = tf.profiler.ProfileOptionBuilder.float_operation()\n\n # We use the Keras ...
[ [ "tensorflow.profiler.ProfileOptionBuilder.float_operation", "pandas.DatetimeIndex", "numpy.random.shuffle", "tensorflow.RunMetadata", "numpy.arange" ] ]
AlexInJar/Explore_OT
[ "da9951ea98f728ec350bfcc7051537bdf0b21a64" ]
[ "networksimplex/Extremal.py" ]
[ "import numpy as np \nimport random \n\n\nclass extrema:\n\n def __init__(self, a, b):\n '''\n a, b are the row and column sum constraints\n '''\n self.a = a\n self.b = b\n self.P = None\n\n def NWC(self):\n P = np.zeros((len(self.a),len(self.b)))\n nR =...
[ [ "numpy.abs" ] ]
williamd4112/curiosity_baselines
[ "45939f3f24c53cfff5153ef012486a6a058660be" ]
[ "rlpyt/utils/logging/context.py" ]
[ "import datetime\nimport json\nimport os\nimport os.path as osp\nfrom contextlib import contextmanager\ntry:\n from torch.utils.tensorboard.writer import SummaryWriter\nexcept ImportError:\n print(\"Unable to import tensorboard SummaryWriter, proceeding without.\")\n\nfrom rlpyt.utils.logging import logger\n\...
[ [ "torch.utils.tensorboard.writer.SummaryWriter" ] ]