repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
rmholdergeo/batchRCLC
[ "ebcdb37fc2e6f96a8f44428198409055dbcee238" ]
[ "batchRCLC_v2.py" ]
[ "# last edited by Robert Holder on 21 May 2021\r\n\r\n# ##### Background on the develompent of this code ######\r\n# The version of the RCLC algorithm used in this code is a modified version of Tom Chacko's 1996\r\n# original. The modifications have been made by Chris McFarlane (04-97), David Pattison (05-9...
[ [ "numpy.array" ] ]
kmkurn/uxtspwsd
[ "ea4da18cec023d0dc487ee061861e6715edc2e85", "ea4da18cec023d0dc487ee061861e6715edc2e85" ]
[ "run_pptx.py", "analyze_chart_tagging.py" ]
[ "#!/usr/bin/env python\n\n# Copyright (c) 2021 Kemal Kurniawan\n\nfrom itertools import chain\nfrom pathlib import Path\nimport os\nimport pickle\n\nfrom einops import rearrange\nfrom gensim.models.keyedvectors import KeyedVectors\nfrom rnnr import Event, Runner\nfrom rnnr.attachments import EpochTimer, MeanReducer...
[ [ "torch.zeros", "torch.load", "torch.tensor", "torch.no_grad", "torch.cuda.is_available" ], [ "torch.zeros_like", "torch.cuda.is_available", "torch.tensor" ] ]
richouzo/cs6471-project
[ "499d00f113dad81f6dfe32f47fce09e2a2bfe16c" ]
[ "src/training/train_utils.py" ]
[ "import time\nimport numpy as np\n\nimport tqdm\nimport copy\n\nimport torch\nimport torch.nn as nn\n\nfrom sklearn.metrics import f1_score\n\nfrom src.utils.utils import SAVED_MODELS_PATH\n\ndef train_model(model, criterion, optimizer, dataloaders, history_training, \n scheduler=None, num_epochs=10,...
[ [ "torch.nn.Softmax", "torch.nn.CrossEntropyLoss", "torch.sigmoid", "numpy.arange", "torch.nn.BCELoss", "torch.nn.BCEWithLogitsLoss", "torch.set_grad_enabled", "torch.where", "sklearn.metrics.f1_score", "torch.argmax" ] ]
nadanai263/CellFreeSim
[ "c5f91ca8d56aecd5d6638f443bbfd329d14f6834" ]
[ "scripts/libraryplot.py" ]
[ "# libraryplot.py\n# Plots entire model library\n\n# Interactive, fast cythonized ODE solver which\n# accepts Antimony/SBML model files as inputs\n# N. Laohakunakorn, LBNC, EPFL\n# V1.0, 2019\n\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport tellurium as te # 2.1.5\nimport numpy...
[ [ "matplotlib.pyplot.plot", "matplotlib.use", "matplotlib.pyplot.savefig" ] ]
gramhagen/intake
[ "de4cbb5df78881dc166b1f02743d22067f2bbd78" ]
[ "intake/source/tests/test_npy.py" ]
[ "#-----------------------------------------------------------------------------\n# Copyright (c) 2012 - 2018, Anaconda, Inc. and Intake contributors\n# All rights reserved.\n#\n# The full license is in the LICENSE file, distributed with this software.\n#--------------------------------------------------------------...
[ [ "numpy.stack", "numpy.save", "numpy.random.randint" ] ]
tipt0p/periodic_behavior_bn_wd
[ "8d77bfc21cd011cd3d705042c2b51735ec2b8b7d" ]
[ "nb_utils.py" ]
[ "import numpy as np\nimport torch\nimport matplotlib.pyplot as plt\nimport os\nimport nets as models\n\n\ndef get_model_str(lr, wd, ep, add_str=None):\n wd_str = f\"{wd:.0e}\".replace('0', '') if wd > 0.0 else str(wd)\n add_str = ('-' + add_str) if add_str is not None else \"\"\n return f\"lr_{lr}-wd_{wd_s...
[ [ "matplotlib.pyplot.legend", "numpy.ones_like", "numpy.sqrt", "matplotlib.pyplot.title", "torch.load", "matplotlib.pyplot.xscale", "numpy.load", "matplotlib.pyplot.yscale", "matplotlib.pyplot.subplots", "matplotlib.pyplot.loglog", "matplotlib.pyplot.savefig", "matplo...
chikoungoun/OpenIntro
[ "12ce09cc169fdf0458e504b97b8db472ad84df4b" ]
[ "Chapter 3/Annexes/Percentile_compute.py" ]
[ "\"\"\" Code to compute the percentile from a Z-score using it's general equation\n\"\"\"\n\nimport numpy as np\nimport math\nfrom scipy import integrate\n\n\n\n\n#Z-score for testing\nz=1.25\n#The negative infinity\nninf = np.NINF\n\ndef fn(x):\n return (1/math.sqrt(2*math.pi)) * math.exp(-x**2/2)\n\n# return a...
[ [ "scipy.integrate.quad" ] ]
mianasbat/scikit-surgeryfred
[ "b784e52006ee885d1a140979d021e495e6af6ad5" ]
[ "sksurgeryfred/algorithms/fit_contour.py" ]
[ "\"\"\"Fit a contour to an image\"\"\"\n\nfrom skimage.color import rgb2gray\nfrom skimage.filters import gaussian\nfrom skimage.segmentation import active_contour\n\nimport numpy as np\n\n\ndef find_outer_contour(image, alpha=0.015, beta=10.0):\n \"\"\"\n Fits an active contour to the outer most edge in the ...
[ [ "numpy.array", "numpy.cos", "numpy.linspace", "numpy.sin" ] ]
jamesrichter/keras
[ "d3512f7cfd0aba4ccf20f1d58729454a18718699" ]
[ "tests/keras/utils/data_utils_test.py" ]
[ "\"\"\"Tests for functions in data_utils.py.\n\"\"\"\nimport os\nimport time\nimport sys\nimport tarfile\nimport threading\nimport shutil\nimport zipfile\nfrom itertools import cycle\nimport multiprocessing as mp\nimport numpy as np\nimport pytest\nimport six\nfrom six.moves.urllib.parse import urljoin\nfrom six.mo...
[ [ "numpy.ceil", "numpy.ones" ] ]
pierfra-ro/stingray
[ "d255e3ced23e97d297be7d8d659ddf163b808064" ]
[ "stingray/tests/test_gti.py" ]
[ "\n\nimport numpy as np\nimport pytest\nimport os\n\nfrom stingray.gti import cross_gtis, append_gtis, load_gtis, get_btis, join_gtis\nfrom stingray.gti import check_separate, create_gti_mask, check_gtis\nfrom stingray.gti import create_gti_from_condition, gti_len, gti_border_bins\nfrom stingray.gti import time_int...
[ [ "numpy.allclose", "numpy.asarray", "numpy.arange", "numpy.all", "numpy.any", "numpy.array" ] ]
Feliconut/PurdueCS324-LSST
[ "79273ba0ef8ed9aab9e08c736c22631a8e250f6e" ]
[ "Supernova/analysis/simple_classification.py" ]
[ "\"\"\"\nIn this project, I try to find the best differentiator between SN and NON-SN.\n\nThen I turn this into a filter that produces high-quality stream of unclassified events.\n\n@author Xiaoyu Liu\n@date Apr 6 2021\n\"\"\"\n\n# %%\nfrom antares_client._api.models import Locus\nfrom matplotlib import pyplot as p...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlim", "numpy.asanyarray", "numpy.diff", "scipy.stats.linregress", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.where", "matplotlib.pyplot.ylabel" ] ]
pcal93/lsh_index_vehicles_dataset
[ "0571a46e866e89b1e8c46e009f9c65e6ccd820e0" ]
[ "app/LSH.py" ]
[ "import os\r\nimport json\r\nimport numpy as np\r\nfrom random import randint\r\nfrom itertools import *\r\nfrom storage import storage\r\nclass LSHash(object):\r\n \"\"\" LSHash implments locality sensitive hashing using random projection for\r\n input vectors of dimension `input_dim`.\r\n Attributes:\r\n...
[ [ "numpy.dot", "numpy.asarray", "numpy.load", "numpy.random.normal", "numpy.savez_compressed", "numpy.mean", "numpy.count_nonzero", "numpy.random.uniform", "numpy.array", "numpy.random.randint" ] ]
alexcohn/tensorflow
[ "3e21fe5faedab3a8258d344c8ad1cec2612a8aa8", "3e21fe5faedab3a8258d344c8ad1cec2612a8aa8" ]
[ "tensorflow/python/util/tf_export.py", "tensorflow/python/ops/clustering_ops.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.util.tf_decorator.unwrap", "tensorflow.python.util.tf_inspect.getargspec" ], [ "tensorflow.python.ops.array_ops.constant", "tensorflow.python.ops.array_ops.shape", "tensorflow.python.ops.control_flow_ops.while_loop", "tensorflow.python.ops.state_ops.assign_sub", ...
KiaKafaei1/Data_Science_Portfolio
[ "9bfa29632d664c6bad9589106e47a455041f0d2c" ]
[ "Food_recognition/bbox_predict.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"bbox_predict.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1z2jPNx_Q3qr2NbUSAgbnWN0y93hfHc4y\n\"\"\"\n\nimport matplotlib\nimport numpy as np\nimport pandas as pd\nimport torch \nimport torchvision\nimpor...
[ [ "torch.nn.Softmax", "numpy.maximum", "numpy.minimum", "numpy.max", "numpy.argmax", "torch.cuda.is_available", "torch.cuda.get_device_name", "torch.device", "numpy.exp", "numpy.zeros", "numpy.where" ] ]
zsweet/R-Net
[ "b1b35ff4799e46263923f25e373444e9867a6cf4" ]
[ "func.py" ]
[ "import tensorflow as tf\n\nINF = 1e30\n\n\nclass cudnn_gru:\n\n def __init__(self, num_layers, num_units, batch_size, input_size, keep_prob=1.0, is_train=None, scope=None):\n self.num_layers = num_layers\n self.grus = []\n self.inits = []\n self.dropout_mask = []\n for layer i...
[ [ "tensorflow.get_variable", "tensorflow.nn.dynamic_rnn", "tensorflow.concat", "tensorflow.contrib.rnn.GRUCell", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.squeeze", "tensorflow.nn.dropout", "tensorflow.matmul", "tensorflow.shape", "te...
combra-lab/pop-spiking-deep-rl
[ "cc1df56addbdee6779a73f73225e811834250305" ]
[ "loihi_realization/test_loihi.py" ]
[ "import torch\nimport numpy as np\nimport time\nimport gym\nimport pickle\nimport math\nimport sys\n\nsys.path.append(\"../../\")\nfrom popsan_drl.popsan_td3.replay_buffer_norm import ReplayBuffer\nfrom popsan_drl.popsan_td3.popsan import PopSpikeActor\nfrom loihi_realization.popsan_loihi import SpikingActorNet\nfr...
[ [ "torch.load", "numpy.int_", "numpy.exp", "numpy.std", "numpy.mean", "torch.device", "numpy.array", "numpy.tanh", "numpy.zeros" ] ]
HamidMousavi-git/Crypto-Signal
[ "7be5122c4786a55677e87d4389e041248dfbb723" ]
[ "app/analyzers/indicators/candle_recognition.py" ]
[ "\nimport numpy\nimport pandas\nimport talib\n\nfrom analyzers.utils import IndicatorUtils\n\n\nclass Candle_recognition(IndicatorUtils):\n def analyze(self, historical_data, signal, notification='hot', candle_check=1, hot_thresh=None, cold_thresh=None):\n \"\"\"Performs an candle pattern analysis on the ...
[ [ "pandas.DataFrame" ] ]
LulutasoAI/MachineLearningUtilities
[ "4840e472d649b97026fe4944bdce4c7e65b45dc5" ]
[ "MLutilchan.py" ]
[ "import glob\nimport os\nfrom PIL import Image\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport pickle\nfrom sklearn.utils import shuffle\nfrom sklearn.model_selection import train_test_split\nimport keras\nfrom keras.layers import Activation, Conv2D, Flatten, Dense, Dropout, Conv3D\nfrom keras.opt...
[ [ "numpy.asarray", "sklearn.utils.shuffle", "numpy.array", "sklearn.model_selection.train_test_split" ] ]
frongk/brewersdict
[ "2d8390a229fcd4b1d5bb2a1a0b7df77798f52ca3" ]
[ "text2entry.py" ]
[ "from nltk import word_tokenize, sent_tokenize\n\nfrom tqdm import tqdm\n\nimport pandas as pd\n\n\nwith open('brewers_trim.txt', 'rb') as fi:\n file_txt = fi.readlines()\n\ntext = ''.join(file_txt)\n\n# remove page headers\ntext_pages = text.split('\\r\\n\\r\\n\\r\\n')\n\nbody_groups = []\nword_tokenset =[]\nfo...
[ [ "pandas.Series" ] ]
GMinozzi/boston_housing_experiment
[ "fcf1fe44065ecc3d54927bccc636bb6cf1d1e548" ]
[ "boston_housing_experiment/mlp.py" ]
[ "import silence_tensorflow\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nimport extra_keras_metrics\nfrom extra_keras_utils import set_seed\nfrom keras.datasets import boston_housing\nfrom keras.models import Sequential, load_model\nfrom keras.layers import Dense, InputLayer, Dropout...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "pandas.DataFrame" ] ]
samoturk/websdf
[ "b7b3365fa3a17650ead62611c8b7e0cb77d1db00" ]
[ "websdf/calculations.py" ]
[ "from rdkit import Chem\nfrom rdkit.Chem import Descriptors\nfrom rdkit.Chem import PandasTools\nfrom rdkit.Chem import FilterCatalog\nimport pandas as pd\n\ntry:\n # Import extra, proprietary functions\n from websdf.extra import extra\nexcept:\n extra = None\n\nparams = FilterCatalog.FilterCatalogParams()...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
pritamqu/ppg2ecg-cardiogan
[ "5e1390588039b2887f2281771f343d7733ed87b3" ]
[ "codes/preprocessing.py" ]
[ "import numpy as np\nfrom biosppy.signals import tools as tools\n\ndef filter_ecg(signal, sampling_rate):\n \n signal = np.array(signal)\n order = int(0.3 * sampling_rate)\n filtered, _, _ = tools.filter_signal(signal=signal,\n ftype='FIR',\n ...
[ [ "numpy.array" ] ]
wq13552463699/TriFinger_Research
[ "6ddfab4531cb4ba05a0fbb41227a734295dce378", "6ddfab4531cb4ba05a0fbb41227a734295dce378" ]
[ "rrc_example_package/benchmark_rrc/python/cic/motion_primitives.py", "rrc_example_package/benchmark_rrc/python/cic/bayesian_opt/utils/run_local_episode_bo.py" ]
[ "import numpy as np\nimport copy\nfrom .math_tools import rpy2Mat\nimport time\n\nfrom itertools import permutations\n\n\n\nclass PrimitiveObject:\n def __init__(self):\n pass\n\n def step(self, robot_state, state, cube_state_filtered, goal, iteration, initial):\n pass\n\n\n def is_finished(s...
[ [ "numpy.abs", "numpy.clip", "numpy.asarray", "numpy.deg2rad", "numpy.zeros", "numpy.sum" ], [ "numpy.asarray" ] ]
shivamsnaik/cocoapi
[ "471e509a6891f70de992e50f3d0b3ef2c119c2b8" ]
[ "PythonAPI/pycocotools/coco.py" ]
[ "__author__ = 'tylin'\n__version__ = '2.0'\n# Interface for accessing the Microsoft COCO dataset.\n\n# Microsoft COCO is a large image dataset designed for object detection,\n# segmentation, and caption generation. pycocotools is a Python API that\n# assists in loading, parsing and visualizing the annotations in CO...
[ [ "matplotlib.pyplot.gca", "matplotlib.collections.PatchCollection", "numpy.random.random", "numpy.min", "numpy.dstack", "numpy.ones", "matplotlib.pyplot.plot", "numpy.all", "numpy.max", "numpy.array", "matplotlib.patches.Polygon" ] ]
XavierJuradoM/SIAMS
[ "c31b9f519004a0ddb979813ec5315df08d022882" ]
[ "storage/kmeans/algoritmo.py" ]
[ "\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.cluster import KMeans\nimport seaborn as sns; sns.set()\nimport csv\nimport sys\nimport os\n\n\narch_inicial= sys.argv[1]\narch_final= sys.argv[2]\narch_final_centroide= sys.argv[4]\ncluster=sys.argv[3]\n\n#print ('C:/laragon/...
[ [ "pandas.read_csv", "matplotlib.pyplot.savefig", "matplotlib.pyplot.scatter", "pandas.DataFrame" ] ]
ChrisJFarr/GoodwillComputerVision
[ "c40bd1cd1070e04a490726b5fb0deaace31775f3" ]
[ "tests/test_size_classification_model.py" ]
[ "from src.models.size_classification_model import SizeClassificationModel, TARGET_SIZE, SIZE_MAP\nimport unittest\nimport os\nimport numpy as np\nfrom sklearn.svm import LinearSVC\nfrom sklearn.metrics import accuracy_score\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\n# Test Support Constants\nTEST_SIZE...
[ [ "numpy.random.shuffle", "numpy.random.seed", "sklearn.metrics.accuracy_score" ] ]
lrgr/xsmf
[ "f7a144812a2446a09b08a6a4b3abf624205b28e0" ]
[ "src/xsmf.py" ]
[ "import argparse\nimport logging\n\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nfrom i_o import get_logger, log_dict, setup_logging\nfrom sklearn.metrics import r2_score\n\nclass XSMF(object):\n def __init__(self, X_tgt, X_src, \n sim_scores,\n X_val=None,\n ...
[ [ "tensorflow.is_nan", "numpy.dot", "tensorflow.get_variable", "sklearn.metrics.r2_score", "numpy.max", "numpy.random.randn", "tensorflow.train.AdamOptimizer", "tensorflow.trace", "tensorflow.boolean_mask", "tensorflow.Variable", "numpy.eye", "tensorflow.subtract", ...
ajesse11x/tensorflow
[ "655b2afc50a0ee07e80a7e28363e853d2fac97cc" ]
[ "tensorflow/contrib/tpu/python/tpu/keras_support.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.contrib.cluster_resolver.python.training.tpu_cluster_resolver.TPUClusterResolver", "tensorflow.contrib.tpu.python.ops.tpu_ops.infeed_dequeue_tuple", "numpy.concatenate", "tensorflow.python.keras.backend.dtype", "tensorflow.python.ops.array_ops.placeholder", "tensorflow.python.o...
AlexMontgomerie/finn
[ "af783db8dc2a1d2e95bd569d39464b935520b6d2", "ec5f67b333ad4db4acf6191c3b5ab5e9067347aa" ]
[ "tests/fpgadataflow/test_layer_streaming_maxpool_batch.py", "src/finn/transformation/fpgadataflow/insert_fifo.py" ]
[ "# Copyright (c) 2020, Xilinx\n# All rights reserved.\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# * Redistributions of source code must retain the above copyright notice, this\n# list of conditions an...
[ [ "numpy.isclose" ], [ "numpy.prod" ] ]
veot/pyifcb
[ "7cf591a9c51edd19a0a8aa416d3f4774c6d1196a" ]
[ "ifcb/viz/utils.py" ]
[ "import numpy as np\nfrom skimage.transform import rescale, resize\n\nSQUARE_DEFAULT_SIZE = 399\n\ndef square(img, size=SQUARE_DEFAULT_SIZE):\n scaled = resize(img, (size, size), mode='reflect', preserve_range=True).astype(np.uint8)\n return scaled\n\ndef square_letterboxed(img, size=SQUARE_DEFAULT_SIZE, fill...
[ [ "numpy.median", "numpy.zeros", "numpy.mean" ] ]
vaynelau/ZS3-voc12
[ "106feb947d79e889032e8e9181a7353a4d22b3a3" ]
[ "zs3/train_pascal_GMMN.py" ]
[ "import argparse\nimport os\n\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom tqdm import tqdm\nimport yaml\n\nfrom zs3.dataloaders import make_data_loader, get_split, get_dataset\nfrom zs3.modeling.deeplab import DeepLab\nfrom zs3.modeling.gmmn import GMMNnetwork\nfrom zs3.modeling.sync_batchnorm.rep...
[ [ "torch.ones", "torch.randint", "torch.load", "torch.zeros", "numpy.arange", "torch.manual_seed", "torch.utils.data.DataLoader", "numpy.delete", "numpy.argmax", "torch.no_grad", "torch.rand", "torch.cuda.is_available", "torch.optim.SGD", "torch.unique", "...
shl418/world-models-latest
[ "f5659c16ef54ababdff6dc700af92a2a59fdafdb" ]
[ "vaegandemo.py" ]
[ "import numpy as np\nimport argparse\nimport config\nimport os\nimport datetime\nimport sys\nimport tensorflow.keras as keras\nfrom tensorflow.keras.layers import Input, Conv2D, Flatten, Dense, Conv2DTranspose, Lambda, Reshape, Layer\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.optimizers impor...
[ [ "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.keras.layers.LeakyReLU", "tensorflow.keras.layers.Lambda", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.backend.exp", "tensorflow.keras.backend.square", "numpy.load", "numpy.zeros", "tensorflow.keras.layers.Flatten",...
jackbeagley/geometry_tool
[ "7a91d5696503d3eeed4a70eee6a01d2869a78a26" ]
[ "geometry_tool.py" ]
[ "############################################################################\n#\n# AUTHOR: Jack Beagley, Geophysics Lab, Otago University August 2021\n#\n# PURPOSE: Process the navigation files to determine the geometry of\n# a marine seismic survey. Can optionally take into account\n# ...
[ [ "matplotlib.pyplot.legend", "numpy.radians", "pandas.Series", "numpy.sqrt", "matplotlib.pyplot.plot", "numpy.zeros_like", "numpy.argmin", "pandas.read_csv", "numpy.empty_like", "numpy.arange", "numpy.sin", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", ...
david-macleod/models
[ "31ae57eb8555e51493a4721f6efbea68d98a3d69" ]
[ "official/recommendation/data_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 requ...
[ [ "tensorflow.gfile.ListDirectory", "tensorflow.Graph", "numpy.random.seed", "numpy.random.choice", "tensorflow.gfile.Open", "numpy.arange", "tensorflow.test.main", "numpy.random.shuffle", "pandas.DataFrame", "numpy.concatenate", "tensorflow.gfile.MakeDirs", "tensorfl...
matthewearl/ray
[ "e29f2ef788dc399832240ae17fb9464515374eb7" ]
[ "rllib/agents/sac/sac_policy.py" ]
[ "from gym.spaces import Box\nimport numpy as np\nimport logging\n\nimport ray\nimport ray.experimental.tf_utils\nfrom ray.rllib.agents.sac.sac_model import SACModel\nfrom ray.rllib.agents.ddpg.noop_model import NoopModel\nfrom ray.rllib.agents.dqn.dqn_policy import postprocess_nstep_and_prio, \\\n PRIO_WEIGHTS\n...
[ [ "numpy.product", "numpy.prod" ] ]
manurare/360monodepth
[ "43347063f1fa521ea3e0866ff85bbcb734b64393" ]
[ "code/python/src/utility/serialization.py" ]
[ "\nfrom PIL import Image\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport metrics\nimport json\nimport os\nimport pickle\nfrom logger import Logger\n\nlog = Logger(__name__)\nlog.logger.propagate = False\n\n\nclass NumpyArrayEncoder(json.JSONEncoder):\n \"\"\"Assistant class for serialize the numpy...
[ [ "numpy.asarray", "numpy.isnan", "numpy.isinf" ] ]
IsaiahPressman/Kaggle_Santa_2020
[ "ff5c6aa78dbe234cef338f4c721cc30d7dbc3df8", "ff5c6aa78dbe234cef338f4c721cc30d7dbc3df8" ]
[ "handcrafted_agents/deprecated/discrete_thompson_sampling_with_action_history.py", "run_experiment_a3c.py" ]
[ "import numpy as np\nfrom scipy.stats import beta\n\npost_a = None\npost_b = None\nbandit = None\ntotal_reward = 0\nn_selections = None\n\n\ndef agent(observation, configuration):\n global total_reward, bandit, post_a, post_b, n_selections\n \n n_bandits = configuration.banditCount\n decay_rate = config...
[ [ "numpy.arange", "numpy.argmax", "numpy.zeros", "numpy.ones" ], [ "torch.device", "torch.nn.Identity", "numpy.unique" ] ]
gpaw789/ATO_Analysis
[ "d3d3b9bd73953491d2cb3b2c9083eabc18c2190c" ]
[ "ATO_Analysis/ATO_AG_6.py" ]
[ "# TOPIC: Australian Tax Office - Tax Return Sample for Year 2013-14\n# CATEGORY: Age\n# TITLE: Australian Tax Return Income Breakdown by Age Group\n# AUTHOR: George Paw\n# DATE: November 2017\n\nimport sys\nimport os\nimport pandas as pd\nimport plotly.graph_objs as go\nimport plotly\nimport numpy as np\n\n\n#cust...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
huyutao3550346/PaddleHub
[ "eeb2c9235869161a2451711ad37aa559b5ee2762" ]
[ "hub_module/modules/image/text_recognition/chinese_ocr_db_crnn_server/character.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.array", "numpy.where" ] ]
shanicky4ever/one-pixel-attack-feature
[ "0a397d61bd6dfcb36c5bc67488665a2e37597fc6", "29619e0d68bbf71ae2e21bee742ff9eec08d943e" ]
[ "helper.py", "differential_evolution.py" ]
[ "# CIFAR - 10\n\nimport pickle\nimport numpy as np\nfrom keras.datasets import cifar10\nfrom keras.utils import np_utils\nfrom matplotlib import pyplot as plt\nimport pandas as pd\nimport requests\nfrom tqdm import tqdm\n\ndef perturb_image(xs, img):\n # If this function is passed just one perturbation vector,\n...
[ [ "numpy.array", "matplotlib.pyplot.imshow", "numpy.tile", "matplotlib.pyplot.subplots", "pandas.DataFrame", "numpy.max", "numpy.argmax", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.yticks", "matplotlib.pyplot.show", "matplotlib.pyplot.xti...
KorfLab/imeter
[ "1e93d8c032caf02a6d839908a53c458a154f6c93" ]
[ "ime_drafting/IMEter_v1_Nivedita/r2_analysis.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import datasets, linear_model\nfrom sklearn.metrics import mean_squared_error, r2_score\nfrom sklearn.linear_model import LinearRegression\nimport argparse\n\nparser = argparse.ArgumentParser(description='R2 values')\nparser.add_argument('introns', ...
[ [ "numpy.array", "sklearn.linear_model.LinearRegression" ] ]
matescharnitzky/joelnet
[ "d0a003d065e9a62a9ec051049f016a8ada94c3e8" ]
[ "joelnet/layers.py" ]
[ "\"\"\"\nOur neural nets will be made up of layers.\nEach layer needs to pass its inputs forward\nand propagate gradients backward. For example:\n\ninputs -> Linear -> Tanh -> Linear -> output\n\"\"\"\nimport numpy as np\nfrom typing import Dict, Callable\nfrom joelnet.tensor import Tensor\n\n\nclass Layer:\n de...
[ [ "numpy.tanh", "numpy.random.randn", "numpy.sum" ] ]
r0cketr1kky/DeepPixel
[ "334eb551e32087cd3471111b86bf165a76868cb0" ]
[ "deeppixel/cam/gradcam.py" ]
[ "import torch.nn.functional as F\nimport torch\n\nfrom .basecam import BaseCAM\nfrom .utils import *\n\n\nclass GradCAM(BaseCAM):\n \"\"\"\n GradCAM, inherit from BaseCAM\n \"\"\"\n\n def __init__(self, model_dict):\n super().__init__(model_dict)\n\n def forward(self, input_, class_idx=Non...
[ [ "torch.nn.functional.relu", "torch.nn.functional.interpolate" ] ]
dede1751/pytactoe
[ "81ecf233b6ec3730a57ba67785e8ab0fe11e5f6a" ]
[ "pytactoe.py" ]
[ "import numpy as np\nimport json\n\nimport colorama\nfrom colorama import Fore\nfrom termcolor import cprint\nfrom pyfiglet import figlet_format\n\nimport network as nt\n\n\ndef custom_input(message, input_type, board=[], net=False, num_list=[]):\n \"\"\"Custom query function for better error handling and cleane...
[ [ "numpy.zeros" ] ]
abyrne55/osvr-review
[ "777884dcbcb2283247ffe256da51254aa3d6896b" ]
[ "old/admm.py" ]
[ "# Source: http://codereview.stackexchange.com/questions/108263/alternating-direction-method-of-multipliers\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom math import sqrt, log\n\ndef ADMM(A, y):\n \"\"\"Alternating Direction Method of Multipliers\n\n This is a python implementation of the Alterna...
[ [ "matplotlib.pyplot.legend", "numpy.absolute", "numpy.linalg.inv", "numpy.linalg.eig", "matplotlib.pyplot.plot", "numpy.random.randn", "numpy.identity", "matplotlib.pyplot.show", "numpy.zeros", "numpy.random.randint" ] ]
gemlongman/motion_preprocessing_tool
[ "0d46fc41ff951e7cc4788d1d9355b0346a9df306" ]
[ "motion_analysis/motion_synthesis/morphable_graph_state_machine.py" ]
[ "#!/usr/bin/env python\n#\n# Copyright 2019 DFKI GmbH.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy...
[ [ "numpy.dot", "numpy.radians", "numpy.linalg.inv", "numpy.isnan", "numpy.eye", "numpy.cos", "numpy.linalg.norm", "numpy.sin", "numpy.array", "numpy.zeros" ] ]
ahmedopolis/keras
[ "4c87dc9685eea2ed20111f9604b10d627b17f032" ]
[ "keras/utils/image_utils_test.py" ]
[ "# Copyright 2022 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v2.data.Dataset.from_tensor_slices", "numpy.random.random", "tensorflow.compat.v2.test.main", "numpy.any", "numpy.random.rand", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.random.randint" ] ]
ThomasBrazier/PiSlice
[ "3d1987c05517686ce90d4876b5a0c4d0f8c90665" ]
[ "PiSlice/sandbox.py" ]
[ "\n# Debug\nimport time\nimport PiSlice.input as input\n#fasta_file = \"PiSlice/data/Oryza_sativa_GCA_001433935.1/GCA_001433935.1_IRGSP-1.0_genomic.fna.gz\"\n#fasta_file = \"PiSlice/data/Arabidopsis_thaliana_GCA_000001735.2.fna.gz\"\nfasta_file = \"PiSlice/data/Brassica_rapa_Brapa1.5/Brassica_rapa_Brapa1.5.fna.gz\"...
[ [ "pandas.DataFrame" ] ]
mitchchristow/deepmind-research
[ "6f8ae40b2626b30f5f80dfc92f5676689eff5599", "6f8ae40b2626b30f5f80dfc92f5676689eff5599", "6f8ae40b2626b30f5f80dfc92f5676689eff5599" ]
[ "side_effects_penalties/agent_with_penalties.py", "learning_to_simulate/render_rollout.py", "tvt/pycolab/common.py" ]
[ "# Copyright 2019 DeepMind Technologies Limited.\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 applicabl...
[ [ "numpy.maximum" ], [ "numpy.concatenate", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ], [ "numpy.ones_like", "numpy.random.choice", "numpy.arange", "numpy.argwhere", "numpy.random.permutation", "numpy.random.uniform", "numpy.rando...
parthjindal/CS60050
[ "7ac2270ec8076f8334f7a29c7ec547c6cb6721ca" ]
[ "Assignment1/main.py" ]
[ "from typing import List, Dict, Tuple\nfrom util import CarDataset, split_dataset, shuffle_dataset, \\\n get_metrics, find_ci_interval, seed_everything\nfrom decision_tree import DecisionTree\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport argparse\nfrom tabulate import tabulate\n\n\ndef train(\n ...
[ [ "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.errorbar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
a07458666/SwinSR
[ "b08b2c4b46f6dacdcbdfe389b9b8254d85965283" ]
[ "models/loss.py" ]
[ "import torch\nimport torch.nn as nn\nimport torchvision\nfrom torch.nn import functional as F\nfrom torch import autograd as autograd\n\n\n\"\"\"\nSequential(\n (0): Conv2d(3, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n (1): ReLU(inplace)\n (2*): Conv2d(64, 64, kernel_size=(3, 3), strid...
[ [ "torch.randn_like", "torch.mean", "torch.nn.Sequential", "torch.nn.MSELoss", "torch.ones_like", "torch.empty_like", "torch.Tensor", "torch.sqrt", "torch.nn.functional.softplus", "torch.nn.BCEWithLogitsLoss", "torch.pow", "torch.rand", "torch.nn.L1Loss", "tor...
fschur/SQL-Dataset-for-Pytorch
[ "215efe124fb32204a49ef34fcd9b755357d196c9" ]
[ "dataset_sql.py" ]
[ "import torch\nfrom torch.utils.data.dataset import Dataset\nimport sqlite3\nimport random\n\n\"\"\"\nTwo Pytorch Dataset to iterate over a SQLlite database. Instead of loading the observations one by one as done by\nSQLDataset, SQLDatasetPreload loads full chunks of data at once. This speeds up the iteration proce...
[ [ "torch.Tensor" ] ]
OtaYuji/openslider-tfpy
[ "19891babb1d2ad85e0a3866939f86e0fdbcce3d8" ]
[ "examples/read_region.py" ]
[ "# Copyright\n# 2019 Department of Dermatology, School of Medicine, Tohoku University\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/l...
[ [ "tensorflow.train.start_queue_runners", "tensorflow.Graph", "tensorflow.train.Coordinator", "tensorflow.Session" ] ]
jayyoung0802/DI-engine
[ "efbb35ddaf184d1009291e6842fbbae09f193492", "efbb35ddaf184d1009291e6842fbbae09f193492" ]
[ "ding/policy/sql.py", "ding/rl_utils/adder.py" ]
[ "from typing import List, Dict, Any, Tuple, Union, Optional\nfrom collections import namedtuple, deque\nimport copy\nimport torch\nfrom torch.distributions import Categorical\nimport logging\nfrom easydict import EasyDict\nfrom ding.torch_utils import Adam, to_device\nfrom ding.utils.data import default_collate, de...
[ [ "torch.no_grad" ], [ "torch.stack", "torch.zeros_like", "torch.zeros" ] ]
labstructbioinf/localpdb
[ "870feca6256487c27a64e8bd5121f47d9618469c" ]
[ "localpdb/utils/prot.py" ]
[ "import re\nimport gzip\nimport os\nimport pandas as pd\nimport numpy as np\n\nnuc_re = re.compile(r'[^ATGCUXNIF.]')\nnonstd_re = re.compile(r'[^X.]')\n\n\ndef parse_pdb_data(entries_fn, entries_type_fn, res_fn, seqres_fn):\n \"\"\"\n Builds dataframe with the parsed raw PDB data\n @param entries_fn: filen...
[ [ "pandas.merge", "pandas.to_datetime", "pandas.DataFrame.from_dict" ] ]
psclklnk/spdl
[ "ced8c189f378a41e209048ebf886f103755f21f4" ]
[ "deep_sprl/teachers/abstract_teacher.py" ]
[ "import gym\nimport numpy as np\nfrom gym import spaces\nfrom abc import ABC, abstractmethod\nfrom deep_sprl.teachers.util import Buffer\nfrom stable_baselines.common.vec_env import VecEnv\n\n\nclass AbstractTeacher(ABC):\n\n @abstractmethod\n def sample(self):\n pass\n\n\nclass BaseWrapper(gym.Env):\n...
[ [ "numpy.concatenate", "numpy.ones_like", "numpy.mean" ] ]
jupadhya1/Odometry_Signal_Anomaly
[ "37a1e549b640fcec7b21ba06e55f8744dbe4614b" ]
[ "client/mlf.py" ]
[ "import json\r\nimport logging\r\nimport math\r\nfrom collections import defaultdict\r\nfrom typing import Dict, List, Union\r\n\r\nimport mlflow\r\nimport pandas as pd\r\nfrom sklearn.metrics import confusion_matrix\r\n\r\n\r\nclass MlflowClient():\r\n \"\"\"A mlflow client to read artifacts from minio bucket\r...
[ [ "pandas.read_csv", "sklearn.metrics.confusion_matrix" ] ]
andyfaff/avant
[ "b5a72db1d82fd9d722557dded08fb76dac0f7dad" ]
[ "parameter/roughness.py" ]
[ "from .util import findGauss, findUniform\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef Gauss(name):\n \"\"\"\"\n Calls the findGauss function from util.py to return the Gauss prior for the given molecule.\n Input: name of molecule\n Output: Gauss prior object containing pdf, lo...
[ [ "matplotlib.pyplot.title", "numpy.linspace", "matplotlib.pyplot.plot", "numpy.zeros_like", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
alphadl/THUMT
[ "350082579044173aab7df8d17744c6eeea7d40cc" ]
[ "thumt/scripts/visualize.py" ]
[ "import os\nimport sys\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy\nimport re\nfrom matplotlib import font_manager\n\n\ndef parse_numpy(string):\n string = string.replace('[', ' ').replace(']', ' ').replace(',', ' ')\n string = re.sub(' +', ' ', string)\n result = numpy.fromstring(str...
[ [ "numpy.abs", "numpy.reshape", "matplotlib.font_manager.FontProperties", "matplotlib.pyplot.colorbar", "numpy.fromstring", "matplotlib.pyplot.matshow", "matplotlib.pyplot.show" ] ]
aryamansriram/Hello-world
[ "ce838f0e9903a1d75002ad325356c15516983cfb" ]
[ "Upvote_prediction.py" ]
[ "\n# coding: utf-8\n\n\n#IMPORT LIBRARIES\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom keras.utils import to_categorical\n\n#READ DATASETS\ndf = pd.read_csv('train_NIR5Yl1.csv')\ndf_test=pd.read_csv('test_8i3B3FC.csv')\n\n#SHOW DATASET\ndf.head()\n\n\n\ndf.describe()\n\n\n\n#CHECK...
[ [ "numpy.array", "pandas.merge", "pandas.read_csv", "sklearn.metrics.r2_score", "matplotlib.pyplot.scatter", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.linear_model.Lasso", "sklearn.preprocessing.LabelEncoder", "sklearn.ensemble.GradientBoostingR...
ladike/912_project
[ "5178c1c93ac6ca30ffc72dd689f5c6932704b4ab" ]
[ "6 复试/2 笔试/9 机器学习/机器学习概论/hw/2017实验/exp2/实验二/2014011328/exp2.py" ]
[ "\nimport random\nimport math\nimport numpy\nfrom sklearn import tree, svm, preprocessing\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.naive_bayes import GaussianNB, MultinomialNB, BernoulliNB\n\ndef main(task):\n\tif task == 1 :\n\t\tprint(\"Bagging + SVM\")\n\telif task == 2 :\n\t\tprint(\"...
[ [ "sklearn.naive_bayes.GaussianNB", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.normalize", "sklearn.tree.DecisionTreeClassifier", "sklearn.svm.LinearSVC", "numpy.array" ] ]
progressivis/altair_examples
[ "9a453ecebdf0bd4776696d4233bee2a8f2eb3606" ]
[ "altair_examples/layered_histogram.py" ]
[ "\"\"\"\nLayered Histogram\n=================\nThis example shows how to use opacity to make a layered histogram in Altair.\n\"\"\"\n# category: histograms\nimport altair as alt\nimport numpy as np\n\nnp.random.seed(42)\n\n# Generating Data\nsource = alt.pd.DataFrame(\n {\n \"Trial A\": np.random.normal(0...
[ [ "numpy.random.normal", "numpy.random.seed" ] ]
rasterio/rasterio
[ "558bddf52eb6bfb921fbe1a12bd0793119c2e0a1", "706f7987b867dc5f37585d794002b9a5832a5f21" ]
[ "tests/test_warpedvrt.py", "rasterio/__init__.py" ]
[ "\"\"\"Tests for :py:class:`rasterio.warp.WarpedVRT`.\"\"\"\n\nfrom __future__ import division\nimport logging\nimport shutil\n\nimport affine\nimport boto3\nimport numpy\nimport pytest\n\nimport rasterio\nfrom rasterio.control import GroundControlPoint\nfrom rasterio.crs import CRS\nfrom rasterio.enums import Resa...
[ [ "numpy.moveaxis" ], [ "numpy.pad" ] ]
zouchuhang/LayoutNetv2
[ "af425d8fc0d40954fc5aae9fd0a1c8eef9ada796" ]
[ "utils_eval.py" ]
[ "import numpy as np\nfrom scipy.spatial import HalfspaceIntersection, ConvexHull\n\nfrom pano import pano_connect_points\n\n\ndef np_coorx2u(coorx, coorW=1024):\n return ((coorx + 0.5) / coorW - 0.5) * 2 * np.pi\n\n\ndef np_coory2v(coory, coorH=512):\n return -((coory + 0.5) / coorH - 0.5) * np.pi\n\n\ndef np...
[ [ "numpy.hstack", "scipy.spatial.ConvexHull", "numpy.arange", "numpy.cumsum", "numpy.cos", "numpy.sin", "numpy.tan", "numpy.concatenate", "numpy.round", "numpy.flip", "numpy.cross", "numpy.array", "numpy.zeros", "numpy.roll" ] ]
leifdenby/twin-otter
[ "05d66304d03b27cbd0ac8d4add83d3b67518daa3", "05d66304d03b27cbd0ac8d4add83d3b67518daa3" ]
[ "twinotter/plots/flight_track_frames.py", "twinotter/quicklook.py" ]
[ "\"\"\"\n::\n\n Usage:\n flight_track_frames.py <flight_data_path>\n [<lon_min> <lon_max> <lat_min> <lat_max> <resolution>]\n [--goes_path=<path>]\n [--output_path=<path>]\n flight_track_frames.py (-h | --help)\n\n Arguments:\n <flight_data_path> Input ...
[ [ "numpy.arange", "matplotlib.pyplot.savefig", "matplotlib.pyplot.axes", "matplotlib.pyplot.close", "numpy.meshgrid", "matplotlib.pyplot.figure" ], [ "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotli...
slyrx/tfx
[ "cdfe96fdbb91959511da56aab0b3f8bb7e70a0f0" ]
[ "tfx/extensions/google_cloud_ai_platform/pusher/executor_test.py" ]
[ "# Lint as: python2, python3\n# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\...
[ [ "tensorflow.io.gfile.makedirs", "tensorflow.test.main" ] ]
SiyuanMa0316/2018_cei_intern-1
[ "c44e6eb42d4cc17d3585eab5fcb2f0f0e77b4a01" ]
[ "information_theory_related/ShiyuLi's_Correlation/CNN_SaveActivation.py" ]
[ "import tensorflow as tf\nimport keras\nfrom CNN_Model import LeNet\n\nimport numpy as np\n\nimport utils\nimport loggingreporter\n\nimport keras.backend.tensorflow_backend as KTF\n\nconfig = tf.ConfigProto()\nconfig.gpu_options.allow_growth=True #不全部占满显存, 按需分配\nsession = tf.Session(config=config)\n\n# 设置session\...
[ [ "tensorflow.ConfigProto", "tensorflow.train.AdamOptimizer", "tensorflow.Session" ] ]
secantsquared/pyqtgraph
[ "3ef7f5b91639543e43bcd66a84290fb9bc18fc5c", "3ef7f5b91639543e43bcd66a84290fb9bc18fc5c" ]
[ "pyqtgraph/examples/TableWidget.py", "pyqtgraph/opengl/items/GLBarGraphItem.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSimple demonstration of TableWidget, which is an extension of QTableWidget\nthat automatically displays a variety of tabluar data formats.\n\"\"\"\n\nimport pyqtgraph as pg\nfrom pyqtgraph.Qt import QtCore, QtGui\nimport numpy as np\n\napp = pg.mkQApp(\"Table Widget Example\")\n\nw...
[ [ "numpy.array" ], [ "numpy.arange", "numpy.array", "numpy.prod" ] ]
tperl/Low-Resource-Sequence-Tagging-using-Sentence-Reconstruction
[ "81cdd2460198f12a2013521fcab7725b26317cd4" ]
[ "utils/f1_test.py" ]
[ "\n\n\"\"\"function expects to receive a list of words and a list of tags\n it then extract the entities and tags per entity for later to be use when comparing\n when comparing f1 scores\"\"\"\nfrom builtins import enumerate\nfrom seqeval.metrics import accuracy_score, f1_score, classification_report\nimport numpy ...
[ [ "numpy.zeros" ] ]
matt-hayden/MarekKowalski-FaceSwap
[ "edb6afc59d670c26abef59ba3d7619b64a1488d1" ]
[ "FaceSwap/ImageProcessing.py" ]
[ "import logging\nlogger = logging.getLogger('FaceSwap.ImageProcessing')\ndebug, info = logger.debug, logger.info\n\nimport numpy as np\nimport cv2\n\n\n#tutaj src to obraz, z ktorego piksele beda wklejane do obrazu dst\n#feather amount to procent, sluzacy do sterowania wielkoscia obszaru, ktory bedzie poddany wagow...
[ [ "numpy.hstack", "numpy.clip", "numpy.min", "numpy.max", "numpy.copy", "numpy.mean", "numpy.where", "numpy.zeros" ] ]
mirob9363/earthpy
[ "6e43724fac10e980489d182bc028fc94021f7d2f", "6e43724fac10e980489d182bc028fc94021f7d2f" ]
[ "earthpy/tests/test_clip.py", "earthpy/tests/test_stack.py" ]
[ "\"\"\"Tests for the clip module.\"\"\"\n\nimport pytest\nimport numpy as np\nfrom shapely.geometry import Polygon, Point, LineString\nimport shapely\nimport geopandas as gpd\nimport earthpy.clip as cl\n\n\ndef make_locs_gdf():\n \"\"\" Create a dummy point GeoDataFrame. \"\"\"\n pts = np.array([[2, 2], [3, 4...
[ [ "numpy.array" ], [ "numpy.sum" ] ]
QCHighing/pyImageProcessing
[ "7b56aaf385acd6dec8fd80ae0a69bdc317255551" ]
[ "01 CannyEdgeDetection/myCanny.py" ]
[ "import numpy as np\nimport cv2 as cv\n\n\ndef dispImg(imgs):\n for name, img in imgs.items():\n cv.imshow(name, img)\n cv.waitKey(0)\n cv.destroyAllWindows()\n\n\ndef calcuGradient(img, imdx, imdy, immod, imdir):\n row, col = img.shape\n for r in range(1, row - 1): # 去掉最外围的1像素,从1索引到row-1, c...
[ [ "numpy.sqrt", "numpy.arctan", "numpy.uint8", "numpy.max", "numpy.zeros" ] ]
jorahn/clip-guided-diffusion
[ "a631a06b51ac5c6636136fab27833c68862eaa24" ]
[ "cgd/clip_util.py" ]
[ "from functools import lru_cache\n\nimport clip\nimport torch as th\nimport torch.nn.functional as tf\nimport torchvision.transforms as tvt\nimport torchvision.transforms.functional as tvf\nfrom data.imagenet1000_clsidx_to_labels import IMAGENET_CLASSES\nfrom PIL import Image\n\nfrom cgd import script_util\nfrom cg...
[ [ "torch.nn.functional.normalize", "torch.no_grad" ] ]
LoannData/Q26_AlphaTrading
[ "b8e6983e59f942352150f76541d880143cca4478" ]
[ "test/trading/strategyExample.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n#############################################################\nSTRATEGY FILE\n#############################################################\nThis file contains the strategy that will be read and executed \nby the backtester.\n\nPlease, read carefully all the...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "pandas.DataFrame", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
SunshineJunFu/mask-faster-rcnn
[ "109d626e9526f56f464dacd2b68dae6ff6be141c" ]
[ "lib/layer_utils/proposal_top_layer.py" ]
[ "# --------------------------------------------------------\n# Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ impo...
[ [ "numpy.random.choice", "torch.cat" ] ]
moritzmuehlbauer/matplotlib2tikz
[ "7621f20273b8bec1d650de7a14ac7c29194d9f64", "7621f20273b8bec1d650de7a14ac7c29194d9f64" ]
[ "test/test_annotate.py", "matplotlib2tikz/path.py" ]
[ "# -*- coding: utf-8 -*-\n#\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom helpers import Phash\n\n\ndef plot():\n fig = plt.figure(1, figsize=(8, 5))\n ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-4, 3))\n t = np.arange(0.0, 5.0, 0.01)\n s = np.cos(2 * np.pi * t)\n ...
[ [ "numpy.arange", "numpy.cos", "matplotlib.pyplot.close", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ], [ "numpy.column_stack" ] ]
TmacMai/CoMPILE_Inductive_Knowledge_Graph
[ "072885012893a50b47cdee17f2e47f671e33bc00", "072885012893a50b47cdee17f2e47f671e33bc00", "072885012893a50b47cdee17f2e47f671e33bc00" ]
[ "CoMPILE_github/model/dgl/layers.py", "CoMPILE_github/model/dgl/aggregators.py", "CoMPILE_github/model/dgl/graph_classifier.py" ]
[ "\"\"\"\nFile baseed off of dgl tutorial on RGCN\nSource: https://github.com/dmlc/dgl/tree/master/examples/pytorch/rgcn\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Identity(nn.Module):\n \"\"\"A placeholder identity operator that is argument-insensitive.\n (Identit...
[ [ "torch.nn.init.calculate_gain", "torch.nn.Dropout", "torch.mm", "torch.Tensor", "torch.nn.Linear", "torch.matmul" ], [ "torch.nn.Linear", "torch.nn.GRUCell", "torch.cat" ], [ "torch.cat", "torch.zeros", "torch.nn.ELU", "torch.nn.GRU", "torch.nn.Embed...
hangyav/biadapt
[ "ab29452de5b5b1c118d448a1d46054387cc828ba" ]
[ "target-ignorant_with_semisup/semisup/tools/utils.py" ]
[ "import numpy as np\n# import fasttext\nimport tensorflow as tf\n\ndef get_embedding_weights(nb_words, tokenizer, w2v, embedding_dim=300):\n\n embedding_weights = np.zeros((nb_words, embedding_dim))\n for w, i in tokenizer.word_index.items():\n # if type(w2v) == fasttext.model.WordVectorModel or w in w...
[ [ "tensorflow.matmul", "tensorflow.nn.softmax", "tensorflow.transpose", "tensorflow.placeholder", "numpy.random.uniform", "numpy.zeros" ] ]
JacobDowns/sigmapy
[ "b6ec223bd245eecc37087e15a25fc32e12ba8ad4" ]
[ "sigmapy/sigma_sets.py" ]
[ "import numpy as np\nfrom numpy.linalg import cholesky, inv\n\nclass SigmaSets(object):\n \n \"\"\"\n Generates sigma points and weights using one of several available \n methods.\n\n Parameters\n ----------\n\n sqrt_method : function(ndarray)\n The matrix square root used to compute sig...
[ [ "numpy.diag", "numpy.sqrt", "numpy.linalg.inv", "numpy.asarray", "numpy.eye", "numpy.arange", "numpy.full", "numpy.ones", "numpy.atleast_2d", "numpy.block", "numpy.concatenate", "numpy.isscalar", "numpy.repeat", "numpy.meshgrid", "numpy.zeros" ] ]
The-Electric-Moccasins/resistance-prediction
[ "a381ad29b21702efeea76c9fa0cd10657df1f8db" ]
[ "dataproc/build_cohort_dataset.py" ]
[ "import numpy as np\nfrom pandas import DataFrame\n\nfrom dataproc import cohort\nfrom dataproc.io import write_dataframe, load_dataframe\nfrom hyper_params import HyperParams\n\n\ndef build_cohort(params: HyperParams, df_features: DataFrame, datafile='data/fulldata.npy'):\n df_cohort = load_labels(params)\n ...
[ [ "numpy.save" ] ]
godfatherlmh/LoLAnalyzer
[ "0b265b33230316ab1a1459a9767ef7527a4a4f89" ]
[ "Learner.py" ]
[ "# Build and train a neural network to predict the game result\n\nimport os\nimport random\nimport keras\nimport Modes\nimport Networks\nimport sys\nimport pandas as pd\nimport numpy as np\n\nnp.set_printoptions(formatter={'float_kind': lambda x: \"%.2f\" % x}, linewidth=200)\n\n\nclass dataCollector:\n def __in...
[ [ "numpy.set_printoptions", "pandas.read_csv" ] ]
vespos/tools
[ "0a634186ae9c103fd0c6840351cac96469d18cfa" ]
[ "tools_diffraction.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTools for diffraction and FEMTO analysis\n\n\nCreated on Tue Apr 12 14:28:22 2016\n\n@author: esposito_v\n\"\"\"\n\n\nimport numpy as np\nimport diffractionAngles_modes as diff_mode\n\n\n\n\ndef hklFromAngles(E, delta, gamma, omega, alpha, U, B):\n \"\"\"\n Calculate the hkl ...
[ [ "numpy.dot", "numpy.arctan", "numpy.linalg.inv", "numpy.asarray", "numpy.linalg.norm", "numpy.rad2deg", "numpy.cos", "numpy.sin", "numpy.deg2rad", "numpy.identity", "numpy.cross", "numpy.array" ] ]
aaalgo/cls
[ "cea5c208e783ffcb0520b130997ec300b1a53a77" ]
[ "fcn_nets.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport os\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nfrom tensorflow.contrib.slim.nets import resnet_v1\nfrom tensorflow.contrib.slim.nets import resnet_util...
[ [ "tensorflow.contrib.slim.dropout", "tensorflow.contrib.slim.max_pool2d", "tensorflow.identity", "tensorflow.name_scope", "tensorflow.contrib.slim.conv2d", "tensorflow.contrib.slim.conv2d_transpose" ] ]
yaz62/dynamo-release
[ "3f3edb227fa904664b1b0b9f6038414bc4072cc2", "3f3edb227fa904664b1b0b9f6038414bc4072cc2" ]
[ "dynamo/plot/scatters.py", "dynamo/plot/time_series.py" ]
[ "# code adapted from https://github.com/lmcinnes/umap/blob/7e051d8f3c4adca90ca81eb45f6a9d1372c076cf/umap/plot.py\nimport warnings\nfrom matplotlib import patches\nfrom matplotlib.lines import Line2D\nimport numpy as np\nimport pandas as pd\nfrom pandas.api.types import is_categorical_dtype\n\nimport anndata\nfrom n...
[ [ "matplotlib.rcParams.get", "numpy.sqrt", "pandas.Series", "numpy.asarray", "pandas.DataFrame", "numpy.where", "matplotlib.pyplot.tight_layout", "numpy.unique", "numpy.ceil", "matplotlib.pyplot.subplot", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.figure"...
BeeGroup-cimne/module_edinet
[ "0cda52e9d6222a681f85567e9bf0f7e5885ebf5e", "0cda52e9d6222a681f85567e9bf0f7e5885ebf5e" ]
[ "debug.py", "edinet_baseline_hourly_module/edinet_models/pyEMIS2/data/preparation/interpolators.py" ]
[ "from bee_dataframes.utils_connection import BeeDataConnection\nimport pandas as pd\nfrom calendar import monthrange\nfrom list_functions import unique, getFromDict, pretty_numeric, ensure_list\nimport json\nfrom datetime_functions import date_n_month, last_day_n_month\nfrom dateutil.relativedelta import relativede...
[ [ "pandas.TimeGrouper", "pandas.DataFrame", "numpy.nanmean", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ], [ "numpy.isnan", "numpy.arange", "numpy.dtype", "numpy.diff", "numpy.interp" ] ]
Tobiaskri/Heart-Rate-Measurement
[ "b61d927075a1978c2e01ae00ef8c4ce52ac39a96" ]
[ "code/main.py" ]
[ "from Code.userInterface import *\nfrom Code.processData import processing\n\nfrom matplotlib import pyplot as plt\n\n\ndef main():\n\n data = loadData()\n\n red_light = data[:,1]\n green_light = data[:,1]\n blue_light = data[:,2]\n\n plt.plot(range(len(red_light)),red_light)\n plt.show()\n\n r...
[ [ "matplotlib.pyplot.show" ] ]
looyclark/code_sandbox
[ "e7eaed520a3a0e717534a1f8e2f7cf7c371295b1" ]
[ "Python/OLS/ols_example/linalg.py" ]
[ "\"\"\"\nA from scratch implementation of the linear algebra operations required for\nordinary least squares regression. I try to avoid built in numpy functions with\nthe exception of the ndarray data type. The code here could easily be recreated\nwithout numpy using lists instead of numpy arrays.\n\"\"\"\n\nimport...
[ [ "numpy.linalg.det", "numpy.linalg.cond", "numpy.zeros", "numpy.linalg.matrix_rank" ] ]
thearn/scikit-image
[ "edfa25f4a0c30295f09c41ce8f742a140c9d9ec1" ]
[ "skimage/filter/_denoise.py" ]
[ "import numpy as np\nfrom skimage import img_as_float\nfrom skimage._shared.utils import deprecated\n\n\ndef _denoise_tv_chambolle_3d(im, weight=100, eps=2.e-4, n_iter_max=200):\n \"\"\"Perform total-variation denoising on 3D images.\n\n Parameters\n ----------\n im : ndarray\n 3-D input data to ...
[ [ "numpy.abs", "numpy.zeros_like", "numpy.sqrt", "numpy.diff" ] ]
Sura-IIT-DELHI/Autonomous-Driving-Robot-Car
[ "44756265948af96735637bb743dab9a0b68351a8" ]
[ "npycreater.py" ]
[ "import numpy as np\nfrom PIL import Image\nimport pandas as pd\nimage1=[]\nprevious_state1=[]\nlabel1=[]\ndatafile=pd.read_csv('/media/kanish/Data_Softwares/autonomous/'+'syncdata.csv')\ndatafile = datafile.sample(frac=1).reset_index(drop=True)\nfor i in range(datafile.shape[0]):\n\tprevious_state=list(datafile.il...
[ [ "numpy.asarray", "pandas.read_csv", "numpy.save" ] ]
KoryakovDmitry/synthtiger
[ "8a995aef46f2c5fe3ee0bbaca2269b3cf66927d4" ]
[ "templates/default.py" ]
[ "\"\"\"\nSynthTIGER\nCopyright (c) 2021-present NAVER Corp.\nMIT license\n\"\"\"\n\nimport cv2\nimport numpy as np\n\nfrom synthtiger import components, layers, utils\n\nBLEND_MODES = [\n \"normal\",\n \"multiply\",\n \"screen\",\n \"overlay\",\n \"hard_light\",\n \"soft_light\",\n \"dodge\",\n...
[ [ "numpy.pad", "numpy.concatenate", "numpy.random.permutation", "numpy.random.rand", "numpy.zeros", "numpy.sum", "numpy.random.randint" ] ]
Cyberspirit/pythonic
[ "aeb96fb514c0adb78f8ffbdadd80012a0ff510ed" ]
[ "examples/dask_array_2.py" ]
[ "\"\"\"\nExample of using Dask array `map_blocks()` with a function that returns a\ntuple value. Using an 8 CPU core MacBook Pro running macOS v11.6, the serial\nelapsed time is 513.45 seconds and the Dask elapsed time is 3.20 seconds.\n\"\"\"\n\nimport dask.array as da\nimport numpy as np\nimport time\nfrom distri...
[ [ "numpy.set_printoptions", "numpy.array", "numpy.random.random" ] ]
Casperjamin/transposontyping
[ "70c730d7bb914bbf54b993aab2ddb0874e53f98b" ]
[ "SCRIPTS/tetyperead.py" ]
[ "import pandas as pd\nfrom Bio import SeqIO\nimport math\n\nclass tetype_result:\n def __init__(self, summary, fragment):\n self.summary = summary\n self.fragment = fragment\n self.name = str(self.summary.split(\"/\")[-1].split(\"_\")[0])\n\n\n def result_to_frame(self, summary, vcf, scor...
[ [ "pandas.read_csv" ] ]
phbrgnomo/hummingbot
[ "72382954a06a277248f44b321344186aef1c367c" ]
[ "test/hummingbot/strategy/celo_arb/test_celo_arb.py" ]
[ "#!/usr/bin/env python\nfrom decimal import Decimal\nimport logging\nimport pandas as pd\nimport unittest\nimport mock\nfrom nose.plugins.attrib import attr\nfrom hummingsim.backtest.backtest_market import BacktestMarket\nfrom hummingsim.backtest.market import (\n QuantizationParams\n)\nfrom hummingsim.backtest....
[ [ "pandas.Timestamp" ] ]
EthanHolleman/models
[ "0e2c0f7be465d1db118dbefcaca3bbf5a1c66490" ]
[ "research/marco/Automated_Marco.py" ]
[ "#!/usr/bin/python\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/LICENSE-2....
[ [ "tensorflow.contrib.predictor.from_saved_model" ] ]
xinshuoweng/cv_ml_tool
[ "1918b9e37ec5fb8148b8a089f226a4864d67b153", "1918b9e37ec5fb8148b8a089f226a4864d67b153" ]
[ "xinshuo_miscellaneous/pytorch/configuration.py", "xinshuo_math/test/bbox_transform/test_bbox_TLWH2TLBR.py" ]
[ "# Author: Xinshuo Weng\n# email: xinshuo.weng@gmail.com\nimport os, numpy as np, random, torch\n\ndef prepare_seed(rand_seed):\n\tnp.random.seed(rand_seed)\n\trandom.seed(rand_seed)\n\ttorch.manual_seed(rand_seed)\n\ttorch.cuda.manual_seed_all(rand_seed)", "# Author: Xinshuo Weng\n# email: xinshuo.weng@gmail.com...
[ [ "torch.manual_seed", "numpy.random.seed", "torch.cuda.manual_seed_all" ], [ "numpy.array" ] ]
aitor-martinez-seras/FSSD_OoD_Detection
[ "69a6393061c24e2af7e1b7e5cbe78ffff63da813" ]
[ "lib/utils/exp.py" ]
[ "import os\nimport sys\nimport types\nimport pickle\nfrom copy import deepcopy\n\nfrom PIL import Image\nimport numpy as np\nimport torch\nfrom torchvision import transforms\nfrom loguru import logger\nimport torchvision.models as models\nfrom lib.model.resnet_imagenet import resnet34\nfrom lib.model import resnet,...
[ [ "torch.nn.DataParallel", "torch.load" ] ]
Jeffrey-Ede/Adaptive-Partial-STEM
[ "dc13e64ba3fb8266d39a260780af615b170a3c88", "dc13e64ba3fb8266d39a260780af615b170a3c88" ]
[ "105/train.py", "110/train.py" ]
[ "# Copyright 2017 Google Inc.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n# Unless required by applicab...
[ [ "tensorflow.ensure_shape", "tensorflow.nn.dynamic_rnn", "numpy.minimum", "tensorflow.concat", "numpy.sqrt", "tensorflow.zeros", "numpy.asarray", "tensorflow.control_dependencies", "numpy.bool", "numpy.cumsum", "numpy.max", "tensorflow.train.AdamOptimizer", "tens...
lgeiger/io
[ "90be860451a705e2fbe8cfdec3c30030112b5c69", "90be860451a705e2fbe8cfdec3c30030112b5c69" ]
[ "tests/test_obj.py", "tensorflow_io/python/experimental/numpy_dataset_ops.py" ]
[ "# Copyright 2021 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req...
[ [ "tensorflow.io.read_file", "numpy.array", "numpy.array_equal" ], [ "tensorflow.constant", "tensorflow.executing_eagerly", "tensorflow.as_dtype", "tensorflow.unstack", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.cast", "tensorflow.data.Dataset.zip", "te...
zhaozhongch/yolact_ros
[ "ee3e086626f49a81ffd06b2740dae849552151cb" ]
[ "layers/interpolate.py" ]
[ "#!/usr/bin/env python3\n\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass InterpolateModule(nn.Module):\n\t\"\"\"\n\tThis is a module version of F.interpolate (rip nn.Upsampling).\n\tAny arguments you give it just get passed along for the ride.\n\t\"\"\"\n\n\tdef __init__(self, *args, **kwdargs):\n...
[ [ "torch.nn.functional.interpolate" ] ]
drewhart/geonomics
[ "884676d7a2c02d914da4cae0d0befcd1f24f956a" ]
[ "geonomics/sim/data.py" ]
[ "#!/usr/bin/python\n#data.py\n\n\n'''\nClasses and functions for implementing data collection and output\n'''\n\n#geonmics imports\nfrom geonomics.utils.io import (_write_csv, _write_shapefile, _write_geojson,\n _write_file)\n\n#other imports\nimport numpy as np\nfrom random import sa...
[ [ "numpy.linspace", "numpy.random.choice", "numpy.ones", "numpy.all", "numpy.shape", "pandas.DataFrame.from_dict", "numpy.array" ] ]