repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
JanCaha/gdalhelpers | [
"925ecb2552b697b5970617484f1fc259f844ba04"
] | [
"tests/functions/test_create_points_at_angles_distance.py"
] | [
"import unittest\nimport os\nimport math\nfrom osgeo import ogr\nimport numpy as np\nfrom gdalhelpers.functions.create_points_at_angles_distance import create_points_at_angles_distance\n\nPOINTS_PATH = os.path.join(os.path.dirname(__file__), \"..\", \"test_data\", \"points.gpkg\")\n\n\nclass CreatePointsAtAnglesDis... | [
[
"numpy.arange"
]
] |
DevmallyaK/Loss-Optimizer-Using-Pytorch | [
"d837852c451ebac57819363e8fe572a655b57783"
] | [
"loss & Optimizer.py"
] | [
"# 1) Design model (input, output, forward pass with different layers)\r\n# 2) Construct loss and optimizer\r\n# 3) Training loop\r\n# - Forward = compute prediction and loss\r\n# - Backward = compute gradients\r\n# - Update weights\r\n\r\nimport torch\r\nimport torch.nn as nn\r\n\r\n# Linear regr... | [
[
"torch.optim.SGD",
"torch.nn.MSELoss",
"torch.tensor"
]
] |
ganesh314159/manimce | [
"0690508b580a58825721a1bd4206592bb420dd14"
] | [
"manim/mobject/geometry.py"
] | [
"r\"\"\"Mobjects that are simple geometric shapes.\n\nExamples\n--------\n\n.. manim:: UsefulAnnotations\n :save_last_frame:\n\n class UsefulAnnotations(Scene):\n def construct(self):\n m0 = Dot()\n m1 = AnnotationDot()\n m2 = LabeledDot(\"ii\")\n m3 = Labele... | [
[
"numpy.hstack",
"numpy.dot",
"numpy.minimum",
"numpy.sqrt",
"numpy.linspace",
"numpy.clip",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"numpy.all",
"numpy.sign",
"numpy.round",
"numpy.tan",
"numpy.gcd",
"numpy.cross",
"numpy.array",
"numpy.ze... |
joshr2020/Code-Reuse-Estimation | [
"632eb823baf22a4ba4decf3d37239a228b2fa31f"
] | [
"src/binary_compare.py"
] | [
"'''\nCopyright (C) 2017 Aurin Chakravarty & Joshua Russo.\n'''\nimport os\nimport argparse\nimport sys\nimport pandas as pd\nimport subprocess\n\ndef getTotalSize(x):\n '''\n Sums up all string values in base 16 and converts to base 10.\n\n x is a dictionary with keys as symbols and values as sizes in bas... | [
[
"pandas.read_table"
]
] |
mads-br/optimal-ph | [
"c5d11ae739c472b0f85db0e2aec2bab625c65710"
] | [
"src/model.py"
] | [
"from sklearn import tree\nimport numpy as np\nimport pickle\n\n\nclass BaselineModel:\n def __init__(self, model_file_path):\n self.model_file_path = model_file_path\n\n def vectorize_sequences(self, sequence_array):\n vectorize_on_length = np.vectorize(len)\n return np.reshape(vectorize... | [
[
"numpy.vectorize",
"sklearn.tree.DecisionTreeRegressor"
]
] |
marcoancona/DASP | [
"cbd82b36443199f11fa04ecb0322fa68f5505b2c"
] | [
"utils/utils.py"
] | [
"from skimage import feature, transform\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy\nimport datetime\nimport os\nfrom matplotlib.ticker import FormatStrFormatter\n\n\nCOLORS = [\"#4e79a7\",\n \"#59a14f\",\n \"#9c755f\",\n \"#edc948\",\n \"#bab0ac\",\n ... | [
[
"numpy.amax",
"numpy.abs",
"numpy.amin",
"numpy.arange",
"scipy.stats.spearmanr",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.get_cmap",
"numpy.mean",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.ticker.FormatStrFormatter",
"numpy.array",
"matplotlib.pyplot... |
anrahman1/ARMS | [
"c569bc215d30fd6318e627c9600e9463aaeb2293"
] | [
"Alex Code/deep_experiment.py"
] | [
"\"\"\"Adapted from http://www.wildml.com/2015/12/implementing-a-cnn-for-text-classification-in-tensorflow/\"\"\"\nimport math\nimport os\n\nimport tensorflow as tf\nimport numpy as np\nfrom sklearn.model_selection import StratifiedShuffleSplit\nfrom sklearn.metrics.classification import accuracy_score\n\nfrom seq_... | [
[
"tensorflow.Graph",
"tensorflow.all_variables",
"tensorflow.Variable",
"tensorflow.ConfigProto",
"tensorflow.initialize_all_variables",
"numpy.random.permutation",
"numpy.argmax",
"tensorflow.Session",
"tensorflow.train.AdamOptimizer",
"sklearn.metrics.classification.accura... |
ankit-1517/CIFAR10-with-ResNet | [
"d1e22ab20df005cd6a982ea29b39019b1874c953"
] | [
"src/cifar_test_ln.py"
] | [
"import pandas as pd \nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch\nimport torchvision\nimport torchvision.transforms as transforms\nfrom sklearn.model_selection import train_test_split\nfrom torch.utils.data import TensorDatase... | [
[
"torch.ones",
"torch.load",
"torch.zeros",
"torch.sqrt",
"torch.nn.Conv2d",
"torch.from_numpy",
"numpy.ones",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.AdaptiveAvgPool2d",
"torch.no_grad",
"torch.FloatTensor",
"numpy.array"
]
] |
Cannizza-zzk/DL_review | [
"3a329742c4d90727ba341508afec0b4fb0123d5d"
] | [
"assignments/nndl-exercise/chap14_reinforcement_learning/RL_QG_agent.py"
] | [
"import tensorflow as tf\nimport os\n\nclass RL_QG_agent:\n def __init__(self):\n self.model_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), \"Reversi\")\n pass # 删掉这句话,并填写相应代码\n\n def init_model(self):\n\n # 定义自己的 网络\n self.sess = tf.Session()\n self.saver... | [
[
"tensorflow.train.Saver",
"tensorflow.Session"
]
] |
david8862/tensorflow | [
"3957de13a5e7872143317f4d2721f7bf826da329"
] | [
"tensorflow/python/compiler/tensorrt/trt_convert.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.core.protobuf.meta_graph_pb2.MetaGraphDef",
"tensorflow.python.grappler.tf_optimizer.OptimizeGraph",
"tensorflow.python.framework.convert_to_constants.convert_variables_to_constants_v2",
"tensorflow.python.platform.tf_logging.error",
"tensorflow.python.ops.array_ops.placeholder",
... |
jhfoxliu/iMVP | [
"741c355fbaae3a610cb31f0e34965734f0cd19a4"
] | [
"iMVP_utils/iMVP_utils/interactive.py"
] | [
"import os\nimport io\nfrom pydoc import classname\nfrom Bio import SeqIO\nimport time\nimport iMVP_utils\nfrom iMVP_utils import interactive_functions\n# import interactive_functions\nimport base64\nimport PIL.Image as Image\nimport pandas as pd\nimport numpy as np\nimport dash\nfrom dash import dcc\nfrom dash imp... | [
[
"pandas.DataFrame"
]
] |
JonathanLehner/korali | [
"90f97d8e2fed2311f988f39cfe014f23ba7dd6cf",
"90f97d8e2fed2311f988f39cfe014f23ba7dd6cf"
] | [
"tests/statistical/optimizers/correctness/helpers/helpers.py",
"examples/hierarchical.bayesian/extended/_setup/model/model.py"
] | [
"#!/usr/bin/env python3\nimport numpy as np\n\n\ndef checkMin(k, expectedMinimum, tol):\n minimum = k[\"Solver\"][\"Best Ever Value\"]\n assert np.isclose(expectedMinimum, minimum, atol = tol), \"Minimum {0} \"\\\n \"deviates from true min {1} by more than {2}\".format(minimum, expectedMinimum, tol)\n\nd... | [
[
"numpy.less",
"numpy.equal",
"numpy.isclose"
],
[
"numpy.linspace",
"numpy.random.normal",
"numpy.transpose",
"numpy.exp",
"numpy.zeros"
]
] |
Aryan-Rajoria/NASWOT-attacks | [
"5045de462afcd38314d760a41e7da7dfaea24092"
] | [
"nasbench/lib/graph_util.py"
] | [
"# Copyright 2019 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicab... | [
[
"numpy.array_equal",
"numpy.all",
"numpy.vectorize",
"numpy.shape",
"numpy.any",
"numpy.array",
"numpy.sum"
]
] |
JakeTheWise/model-analysis | [
"4e1b3eed50ce8d9cc945d5a79eb547c558663695"
] | [
"tensorflow_model_analysis/extractors/tflite_predict_extractor.py"
] | [
"# Lint as: python3\n# Copyright 2019 Google 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 appli... | [
[
"tensorflow.concat",
"tensorflow.lite.Interpreter",
"numpy.expand_dims",
"numpy.shape"
]
] |
mscipio/occiput-suite | [
"9b7dc59ad615d46d811eab965a86ec9efe292a7d"
] | [
"occiput_suite/occiput/DataSources/FileSources/vNAV.py"
] | [
"# occiput \n# Stefano Pedemonte \n# April 2014 \n# Harvard University, Martinos Center for Biomedical Imaging \n# Boston, MA, USA \n# Nov. 2015 \n\nfrom __future__ import absolute_import, print_function\n\n__all__ = ['vNAV_MPRage', 'load_vnav_mprage']\n\nimport copy\nimport os\n\nimport dicom\nimport matplotlib.py... | [
[
"matplotlib.pyplot.Rectangle",
"numpy.dot",
"numpy.sqrt",
"numpy.asarray",
"numpy.cos",
"matplotlib.pyplot.savefig",
"numpy.sin",
"numpy.copy",
"numpy.mean",
"numpy.float32",
"numpy.transpose",
"matplotlib.pyplot.show",
"numpy.where",
"matplotlib.pyplot.figu... |
vishalbelsare/pymcmcstat | [
"b4b10547ce00fe5e095871ae8ee48b381d9a2a2b"
] | [
"test/plotting/test_utilities.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed May 30 05:57:34 2018\n\n@author: prmiles\n\"\"\"\n\nfrom pymcmcstat.plotting import utilities\nimport unittest\nfrom mock import patch\nimport numpy as np\nimport math\n\n# --------------------------\nclass GenerateSubplotGrid(unittest.TestCas... | [
[
"numpy.linspace",
"numpy.eye",
"numpy.random.random_sample",
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.array",
"numpy.zeros"
]
] |
tdp2110/dldt | [
"87f321c5365ed813e849ea0ed987354ef2c39743"
] | [
"model-optimizer/extensions/ops/sparse_segment_sqrtn.py"
] | [
"\"\"\"\n Copyright (c) 2019 Intel Corporation\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law ... | [
[
"numpy.all",
"numpy.zeros",
"numpy.sqrt"
]
] |
judejeh/dominance-analysis-1.0.8.1 | [
"1fe7a361d4ca3a90f7ec062c036991b3bb44950a"
] | [
"dominance_analysis/dominance.py"
] | [
"import numpy as np\nfrom itertools import combinations\nimport sklearn\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.datasets import load_breast_cancer\nfrom sklearn.datasets import load_boston\nfrom tqdm import tqdm\nfrom sklearn.feature_selection import SelectKBest,chi2,f_regression\nimport pa... | [
[
"pandas.merge",
"sklearn.datasets.load_breast_cancer",
"pandas.DataFrame",
"sklearn.feature_selection.SelectKBest",
"numpy.linalg.pinv",
"numpy.mean",
"sklearn.linear_model.LinearRegression",
"sklearn.datasets.load_boston",
"pandas.DataFrame.from_records",
"numpy.exp"
]
] |
Kefeng91/Forlab | [
"070c96a20ac4d3d41c41cbf4b9a198284c5cea50"
] | [
"utils/view_kde.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nAuthor: Keurfon Luu <keurfon.luu@mines-paristech.fr>\nLicense: MIT\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nif __name__ == \"__main__\":\n # Parameters\n fkind = \"float32\"\n \n # Initialize figure\n fig = plt.figure(figsize = (10, 5), f... | [
[
"numpy.fromfile",
"numpy.min",
"numpy.reshape",
"numpy.max",
"matplotlib.pyplot.figure"
]
] |
jenzenho/pyMARS | [
"3612580fe58c69b441211eaea18baa9dc1045751"
] | [
"pymars/drgep.py"
] | [
"import networkx as nx\nimport numpy as np\nimport h5py\nimport os, sys, argparse\nimport cantera as ct\nimport soln2ck\nimport soln2cti\nfrom readin_initial_conditions import readin_conditions\nfrom simulation import Simulation\nimport helper\nfrom create_trimmed_model import trim\nfrom numpy import genfromtxt\nim... | [
[
"numpy.max",
"numpy.array"
]
] |
resuly/Traffic-3DResnets | [
"cb48c6b7a4921d8593368c262c0d3c0406a6cc32"
] | [
"main/synthesize_results.py"
] | [
"\"\"\"Aggregates results from the metrics_eval_best_weights.json in a parent folder\"\"\"\n\nimport argparse\nimport json\nimport os\nworking_path = os.path.abspath(os.path.dirname(__file__))\n\nfrom tabulate import tabulate\nimport pandas as pd\n\nimport utils\nimport model.net as net\n\nparser = argparse.Argumen... | [
[
"pandas.to_datetime"
]
] |
rmit-ir/AnswerPassageQuality | [
"83c2d6c6467dfa71e887bc6f4a893d6d594fc3b5"
] | [
"models/AnswerPassages.py"
] | [
"from __future__ import print_function\n\nimport argparse\nimport collections\nimport itertools\nimport json\nimport krovetzstemmer\nimport logging\nimport math\nimport string\n\nimport fastText\nimport numpy as np\nimport scipy.stats.mstats\nimport scipy.special\nimport sklearn\n\nfrom smart_open import smart_open... | [
[
"numpy.dot",
"numpy.arange",
"numpy.linalg.norm",
"numpy.ones",
"numpy.array",
"numpy.vstack"
]
] |
Balance-Breaker/keras-contrib | [
"312c66dbcfdc95d865b848da8287525877f8f89f"
] | [
"tests/keras_contrib/layers/test_normalization.py"
] | [
"import pytest\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\nfrom keras.layers import Dense, Activation, Input\nfrom keras.utils.test_utils import layer_test, keras_test\nfrom keras_contrib.layers import normalization\nfrom keras.models import Sequential, Model\nfrom keras import backend as K\nf... | [
[
"numpy.random.seed",
"numpy.reshape",
"numpy.arange",
"numpy.ones",
"numpy.random.normal",
"numpy.append",
"numpy.mean",
"numpy.std",
"numpy.testing.assert_allclose",
"numpy.zeros",
"numpy.sum"
]
] |
kevinbdsouza/VaeLM | [
"31e2d6abc0f49f2ca72d3f22ff17484859fc3601"
] | [
"archive/encoders/encoder_gating.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport collections\nimport os\nimport argparse\nimport datetime as dt\n\nfrom collections import Counter\nfrom random import random\nfrom nltk import word_tokenize\n\n\ndef preprocess(mode):\n # load text files\n train_sentences = [line.strip() for line in open(\"... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.nn.dynamic_rnn",
"tensorflow.nn.raw_rnn",
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.cast",
"tensorflow.nn.bidirectional_dynamic_rnn",
"numpy.reshape",
"numpy.eye",
"tensorflow.layers.dense",
"tensorflow.Session",
... |
Mainframed69/tensorflow | [
"f8b5c95a7882efd58b123aeb308dfb173658a9e6"
] | [
"tensorflow/python/compat/compat.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.util.tf_export.tf_export"
]
] |
colinski/mmclassification | [
"447c8291bc2e2abda6f3eafe2e6d0f13d65843cb"
] | [
"mmcls/datasets/builder.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport copy\nimport platform\nimport random\nfrom functools import partial\n\nimport numpy as np\nimport torch\nfrom mmcv.parallel import collate\nfrom mmcv.runner import get_dist_info\nfrom mmcv.utils import Registry, build_from_cfg, digit_version\nfrom torch.utils... | [
[
"torch.manual_seed",
"numpy.random.seed"
]
] |
Odiurd/deep-reinforcement-learning-continuous-control | [
"b1fb17ceab8cf23200dbdada21ba2ab0e33aa1a2"
] | [
"model.py"
] | [
"#https://github.com/udacity/deep-reinforcement-learning/tree/master/ddpg-pendulum\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\ndef hidden_init(layer):\n fan_in = layer.weight.data.size()[0]\n lim = 1. / np.sqrt(fan_in)\n return (-lim, lim)\n\nclass Actor(n... | [
[
"torch.nn.Linear",
"torch.manual_seed",
"numpy.sqrt",
"torch.cat"
]
] |
Mikoto10032/CycleGAN | [
"c565387c8e068955dfa3134734af9638b0e05c74"
] | [
"layers.py"
] | [
"import tensorflow as tf\n\ndef lrelu(x, leak=0.2, name=\"lrelu\", alt_relu_impl=False):\n\n with tf.variable_scope(name):\n if alt_relu_impl:\n f1 = 0.5 * (1 + leak)\n f2 = 0.5 * (1 - leak)\n # lrelu = 1/2 * (1 + leak) * x + 1/2 * (1 - leak) * |x|\n return f1 *... | [
[
"tensorflow.nn.relu",
"tensorflow.maximum",
"tensorflow.nn.moments",
"tensorflow.truncated_normal_initializer",
"tensorflow.constant_initializer",
"tensorflow.variable_scope",
"tensorflow.sqrt"
]
] |
billzhao1990/CS231n-Spring-2017 | [
"a87597da2605be9f4ce0b84ed84408b313a3dc72"
] | [
"assignment2/cs231n/classifiers/fc_net.py"
] | [
"from builtins import range\nfrom builtins import object\nimport numpy as np\n\nfrom cs231n.layers import *\nfrom cs231n.layer_utils import *\n\n\nclass TwoLayerNet(object):\n \"\"\"\n A two-layer fully-connected neural network with ReLU nonlinearity and\n softmax loss that uses a modular layer design. We ... | [
[
"numpy.random.randn",
"numpy.zeros",
"numpy.sum",
"numpy.ones"
]
] |
astoc/kaggle_dsb2017 | [
"2421442cb220518d9ad70b0f3f7611ccf6303af4"
] | [
"code/Andre/py/iseg_luna3_lub_222f.py"
] | [
"\"\"\"\nCreated on Thu Jan 26 17:04:11 2017\n\nPreprocess Luna datasets and create nodule masks (and/or blank subsets)\n\nNOTE that:\n 1. we do NOT segment the lungs at all -- we will use the raw images for training (DO_NOT_SEGMENT = True)\n 2. No corrections are made to the nodule radius in relation to the ... | [
[
"numpy.dot",
"matplotlib.pyplot.imshow",
"scipy.ndimage.sobel",
"pandas.DataFrame",
"numpy.round",
"numpy.max",
"matplotlib.pyplot.plot",
"numpy.mean",
"numpy.cross",
"numpy.hypot",
"pandas.read_csv",
"numpy.unique",
"scipy.ndimage.generate_binary_structure",
... |
allenai/elastic | [
"57345c600c63fbde163c41929d6d6dd894d408ce"
] | [
"utils.py"
] | [
"from __future__ import print_function\nimport math\nimport random\nimport torchvision.transforms as transforms\nimport warnings\nfrom torch.nn import functional as F\nimport shutil\nimport torch.utils.data as data\nimport os\nfrom PIL import Image\nimport torch\nimport numpy as np\n\n\ndef accuracy(output, target,... | [
[
"numpy.asarray",
"torch.nn.ConstantPad2d",
"numpy.prod",
"torch.nn.ZeroPad2d",
"numpy.array",
"numpy.histogram",
"torch.save"
]
] |
Martynas-P/pandas | [
"c79fc046c8dcb6810202b6dbb5ff41e0e56d685e"
] | [
"pandas/core/base.py"
] | [
"\"\"\"\nBase and utility classes for pandas objects.\n\"\"\"\nimport builtins\nfrom collections import OrderedDict\nimport textwrap\nfrom typing import Dict, FrozenSet, List, Optional\nimport warnings\n\nimport numpy as np\n\nimport pandas._libs.lib as lib\nfrom pandas.compat import PYPY\nfrom pandas.compat.numpy ... | [
[
"pandas.arrays.DatetimeArray",
"pandas.core.dtypes.common.is_datetime64_ns_dtype",
"pandas.util._validators.validate_bool_kwarg",
"pandas.Series",
"pandas.core.common.get_callable_name",
"numpy.asarray",
"pandas.core.dtypes.common.is_extension_array_dtype",
"pandas.core.dtypes.comm... |
sheride/bcml4pheno | [
"c9629dafcdbee0a4c28ceb7b28c9862de8479a24"
] | [
"bcml4pheno/bcml_model.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: bcml_model.ipynb (unless otherwise specified).\n\n__all__ = ['bcml_model', 'refresh_model']\n\n# Cell\nimport numpy as np\nimport sklearn.metrics as skm\nimport scipy.interpolate\nimport scipy.optimize\nimport pandas as pd\nimport joblib\n\n# Cell\nclass bcml_model:\n ... | [
[
"numpy.ones_like",
"numpy.abs",
"numpy.multiply",
"numpy.power",
"numpy.amin",
"numpy.sqrt",
"numpy.linspace",
"numpy.unique",
"sklearn.metrics.confusion_matrix",
"pandas.DataFrame",
"numpy.roots",
"numpy.log10",
"numpy.zeros_like",
"numpy.flip",
"numpy.... |
a97001/merge-csv | [
"d8cd11c55e8a8a383c003151ec37fa751ca02e85"
] | [
"join_by_columns.py"
] | [
"import json\nimport pandas as pd\nimport os\nimport time\n\nconfigPath = os.path.join(os.getcwd(), 'config.json')\nwith open(configPath, 'r') as f:\n config = json.load(f)\n\n\nfiles = []\nfor (dirpath, dirnames, filenames) in os.walk(config['csvFolder']):\n for f in filenames:\n if f.lower().endswith... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
lelange/memilio | [
"e90aa96a3494899c54cd6326a31687d37f5505c8"
] | [
"pycode/memilio-epidata/memilio/epidata_test/test_epidata_get_RKI_Data.py"
] | [
"#############################################################################\n# Copyright (C) 2020-2021 German Aerospace Center (DLR-SC)\n#\n# Authors: \n#\n# Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except ... | [
[
"pandas.read_json",
"pandas.DataFrame"
]
] |
tmunemot/eeg_seizure_forecasting | [
"15db53279ac0e3320c9ba731ce9a7aa49f97ec22"
] | [
"utils.py"
] | [
"#!/usr/bin/python\nimport sys, os, argparse\nimport numpy as np\nimport pandas as pd\nimport random\nimport errno\nfrom scipy import sparse\nimport time\nimport scipy.io\nimport features\n\ndef mkdir_p(path):\n \"\"\"\n a function equivalent to \"mkdir -p\" in bash scripting\n https://stackoverflo... | [
[
"numpy.random.randint"
]
] |
AathmanT/cv-tricks.com | [
"7367c42d3e2d398b31ebf1b058bdbb5dc2a56253"
] | [
"Tensorflow-tutorials/Not-Safe-For-Work-Detection/model.py"
] | [
"import math\nimport numpy as np\nimport tensorflow as tf\nfrom enum import Enum, unique\n\n\n@unique\nclass InputType(Enum):\n TENSOR = 1\n BASE64_JPEG = 2\n\n\nclass OpenNsfwModel:\n \"\"\"Tensorflow implementation of Yahoo's Open NSFW Model\n\n Original implementation:\n https://github.com/yahoo/o... | [
[
"tensorflow.nn.relu",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.nn.softmax",
"tensorflow.reshape",
"tensorflow.placeholder",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.add",
"tensorflow.pad",
"numpy.load"
]
] |
Kdc23/video-caption-pytorch | [
"8d1aceb6455ffa6873c8081ef45430fce8eadfd9"
] | [
"models/EncoderRNN.py"
] | [
"import torch.nn as nn\r\n\r\n\r\nclass EncoderRNN(nn.Module):\r\n def __init__(self, dim_vid, dim_hidden, input_dropout_p=0, dropout_p=0,\r\n n_layers=1, bidirectional=False, rnn_cell='gru'):\r\n \"\"\"\r\n\r\n Args:\r\n hidden_dim (int): dim of hidden state of rnn\r\n ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout"
]
] |
Anthonyive/DSCI-550-Assignment-3 | [
"dbc12837143406af57d2bd0128067ac0c1485b53"
] | [
"src/vis4ForTask5.py"
] | [
"import pandas as pd\nimport json\n\n\ndef vis4ForTask5(csvPath: str) -> None:\n \"\"\"\n csv to jsonl function for Task 5\n\n Parameters:\n csvPath (str): input csv path from the root dir\n\n Returns:\n None: output vis4data.jsonl in data/visualizations\n \"\"\"\n df = pd.read_csv(csvPath)\... | [
[
"pandas.read_csv"
]
] |
BELIEVEfxy/LightSANs | [
"94ce7e59d144dbc787153b8c486cad334790ec6e"
] | [
"recbole/model/sequential_recommender/.ipynb_checkpoints/lightsasrec0-checkpoint.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2020/11/26\n# @Author : Xinyan Fan\n# @Email : xinyan.fan@ruc.edu.cn\n\n\nimport torch\nfrom torch import nn\n\nfrom recbole.model.abstract_recommender import SequentialRecommender\nfrom recbole.model.loss import BPRLoss\nfrom recbole.model.layers import TransformerEncoder\... | [
[
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"torch.sum",
"torch.nn.Embedding",
"torch.nn.LayerNorm",
"torch.mul"
]
] |
greedyuser/kur | [
"ba6588ebfa5dec66d1e462c180618cc115fd38ef"
] | [
"kur/containers/layers/squeeze.py"
] | [
"\"\"\"\nCopyright 2017 Deepgram\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writi... | [
[
"torch.squeeze"
]
] |
AnxietyYoungPoet/tutorials | [
"514a513f2839106603fea2bba6b8908725f874fc"
] | [
"beginner_source/Intro_to_TorchScript_tutorial.py"
] | [
"\"\"\"\nIntroduction to TorchScript\n===========================\n\n*James Reed (jamesreed@fb.com), Michael Suo (suo@fb.com)*, rev2\n\nThis tutorial is an introduction to TorchScript, an intermediate\nrepresentation of a PyTorch model (subclass of ``nn.Module``) that\ncan then be run in a high-performance environm... | [
[
"torch.jit.script",
"torch.jit.load",
"torch.jit.trace",
"torch.zeros",
"torch.tanh",
"torch.nn.Linear",
"torch.relu",
"torch.rand"
]
] |
johnjmolina/MLKyoto | [
"dd1f7447f8ed6770da7132125c1f26b49e19c318"
] | [
"_notebooks/utils/pdesolver/etdrk.py"
] | [
"# last\nimport numpy as np\nfrom . import phi\n\nclass _etdrk:\n def __init__(self, *, G, dt):\n self.G = G\n self.dt = dt\n\nclass etdrk1(_etdrk):\n def __init__(self, *, L, G, dt, dps=100):\n super().__init__(G=G, dt=dt)\n hL = dt*L.reshape(-1)\n self.phi = np.array([phi... | [
[
"numpy.zeros"
]
] |
kemaeleon/drug_share | [
"a3c040a9ba1b2c4a9baafd6f97f59c89318fd6af"
] | [
"drugshare/drugshare/templates/save.py"
] | [
"import folium\nfrom folium import IFrame\nimport folium.plugins as plugins\nimport pandas as pd\nimport geopandas as gpd\nimport matplotlib.pyplot as plt\nimport requests\nimport io\nimport os\nimport numpy as np\nfrom datetime import timedelta, date\ndef daterange(start_date, end_date):\n for n in range(int ((... | [
[
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"numpy.sqrt",
"pandas.pivot_table",
"matplotlib.pyplot.close",
"pandas.set_option",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel"
]
] |
oshadura/opendata-higgs-discovery | [
"47b4ac787a69b9580fc1f72948d3af0bdc20759b"
] | [
"notebooks/atlas_analysis.py"
] | [
"import asyncio\nfrom typing import List, Union\n\nimport numpy as np\nfrom coffea import hist\nfrom coffea.processor.servicex import Analysis, DataSource, LocalExecutor\nfrom func_adl import ObjectStream\nfrom func_adl_servicex import ServiceXSourceUpROOT\nfrom servicex.servicex import ServiceXDataset\n\n\ndef app... | [
[
"numpy.sin",
"numpy.min"
]
] |
joaosoares/xray_teeth_detection | [
"2385038e1fa609988eb2dfef11c0fff04815b23f"
] | [
"src/shape_test.py"
] | [
"import unittest\n\nimport numpy as np\nimport numpy.testing as npt\n\nimport matplotlib.pyplot as plt\n\nfrom point import Point\nfrom shape import Shape\nfrom shapeutils import plot_shape, plot_vecs, plot_rectangle\nfrom testutils import load_incisor\n\n\nclass ShapeTest(unittest.TestCase):\n def test_translat... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array"
]
] |
BBQuercus/useful-scripts | [
"e476b08b80a633622052c21bea326b2187bf8798"
] | [
"trackmate.py"
] | [
"\"\"\"\\U0001F1EB\\U0001F1EF \\U00002B50 CSV track coordinate to TrackMate XML conversion.\n\nFiji allows for quick and easy viewing of images. TrackMate can be used to view tracks.\nUnfortunately, it isn't that simple to convert \"normal\" coordinate output into\nTrackMate-viewable format.\n\nRequires a \"tracks... | [
[
"numpy.array",
"pandas.read_csv",
"numpy.setdiff1d"
]
] |
thanhtruongnhu/hello-world | [
"5fa3fc43064021daa7811e1a6eb7ea7e3b778416"
] | [
"convertCoordinateRB1.py"
] | [
"from picamera.array import PiRGBArray\nfrom picamera import PiCamera\nimport time\nimport cv2\nimport numpy as np\nimport time\nimport serial\nimport math\n# global variables \n\n# rf send\n\nser = serial.Serial(\n\tport = '/dev/ttyAMA0',\n\tbaudrate = 9600,\n\tparity = serial.PARITY_NONE,\n\tstopbits = serial.STO... | [
[
"numpy.uint8",
"numpy.ones",
"numpy.load",
"numpy.array",
"numpy.sum"
]
] |
songanz/fusion | [
"fe3389dd92938ea58b2b78068552da13972a51cb"
] | [
"Frustum-PointNet/eval_frustum_pointnet_val_2ddetections.py"
] | [
"# camera-ready\n\nfrom datasets import DatasetKittiVal2ddetections, wrapToPi, getBinCenter # (this needs to be imported before torch, because cv2 needs to be imported before torch for some reason)\nfrom frustum_pointnet import FrustumPointNet\n\nimport torch\nimport torch.utils.data\nimport torch.nn as nn\nfrom to... | [
[
"torch.load",
"numpy.linalg.inv",
"torch.utils.data.DataLoader",
"numpy.argmax",
"torch.no_grad",
"torch.autograd.Variable"
]
] |
Jxtopher/python-image-manipulation | [
"a4b527f36162afe020acbb4ad5784ab1c84b1dac"
] | [
"sources/sierpinski_triangle.py"
] | [
"from typing import List\nfrom PIL import Image\nfrom copy import deepcopy\nimport numpy as np\n\n\ndef apply_rules(rules: List[dict], line: List, new_line: List, num_case: int) -> None:\n for rule in rules:\n if (\n rule[\"pattern\"][0] == line[num_case - 1]\n and rule[\"pattern\"][... | [
[
"numpy.array"
]
] |
sayanghosh/FLSim | [
"7b47c83c811070cf0f560ff74647fa47adc441be"
] | [
"flsim/trainers/sync_trainer.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom __future__ import annotations\n\nimport logging\nimport math\nfrom data... | [
[
"torch.ones",
"torch.Tensor",
"torch.cuda.current_device",
"torch.median",
"torch.no_grad"
]
] |
event-driven-robotics/movenet.pytorch | [
"24c1175645ede19d21a98506f5e9006a4b546e83"
] | [
"lib/task/task_tools.py"
] | [
"\"\"\"\r\n@Fire\r\nhttps://github.com/fire717\r\n\"\"\"\r\n\r\nimport torch.optim as optim\r\nimport numpy as np\r\nimport cv2\r\n\r\nfrom lib.utils.utils import maxPoint, extract_keypoints\r\n\r\n_range_weight_x = np.array([[x for x in range(48)] for _ in range(48)])\r\n_range_weight_y = _range_weight_x.T\r\n\r\n... | [
[
"torch.optim.lr_scheduler.MultiStepLR",
"torch.optim.lr_scheduler.CosineAnnealingWarmRestarts",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"numpy.reshape",
"numpy.arange",
"numpy.concatenate",
"numpy.zeros",
"torch.optim.lr_scheduler.StepLR"
]
] |
npetrenko/recurrent_frcnn | [
"9fb948a9f6ee87e8f6d48d65c8ad2e957f7ab7ee"
] | [
"test_frcnn.py"
] | [
"from __future__ import division\nimport random\nimport pprint\nimport sys\nimport time\nimport numpy as np\nimport pickle\nimport os\n\nfrom keras import backend as K\nfrom keras.optimizers import Adam\nfrom rcnn import config, data_generators\nfrom rcnn import losses as losses\nimport rcnn.roi_helpers as roi_help... | [
[
"numpy.expand_dims",
"numpy.max",
"tensorflow.Session",
"numpy.transpose",
"tensorflow.train.Saver",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
ArmandoSep/DS-Unit-3-Sprint-2-SQL-and-Databases | [
"3087a3f0602362fa5ec7c81e3517ac582e7d1c26"
] | [
"module1-introduction-to-sql/buddymove_queries.py"
] | [
"\nimport pandas as pd \nimport os\nimport sqlite3\n\ndf = pd.read_csv(\"module1-introduction-to-sql/buddymove_holidayiq.csv\")\ndf = df.rename(columns={'User Id':'id'})\n\n# construct a path to wherever your database exists\nDB_FILEPATH = os.path.join(os.path.dirname(__file__), \"buddymove_holidayiq.sqlite3\")\n\n... | [
[
"pandas.read_csv"
]
] |
Immocat/ACTOR | [
"c7237e82e333bf2c57f7d8e12f27d0831233befc"
] | [
"src/utils/tensors.py"
] | [
"import torch\n\n\ndef lengths_to_mask(lengths):\n max_len = max(lengths)\n mask = torch.arange(max_len, device=lengths.device).expand(len(lengths), max_len) < lengths.unsqueeze(1)\n return mask\n \n\ndef collate_tensors(batch):\n dims = batch[0].dim()\n max_size = [max([b.size(i) for b in batch])... | [
[
"torch.arange",
"torch.as_tensor"
]
] |
tobyrsmith/ExLunaPlots | [
"02bd15c33cbeae8644a4d60938c5eb922ebd228c"
] | [
"15415ree.py"
] | [
"#!/home/toby/anaconda/bin/python\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef log_10_product(x, pos):\n if (x < 1.0):\n return '%3.1f' % (x)\n else:\n return '%i' % (x)\n\ncc = '0.10'\n\nfont = {'family' : 'DejaVu Serif',\n 'weight' : 'normal',\n 'size' : 20,\n}\n\ntfont = {\... | [
[
"matplotlib.pyplot.FuncFormatter",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.MultipleLocator",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.subplot",
"matplotlib.... |
marshuang80/napari | [
"10f1d0f39fe9ccd42456c95458e2f23b59450f02"
] | [
"napari/util/colormaps/vendored/cm.py"
] | [
"\"\"\"\nBuiltin colormaps, colormap handling utilities, and the `ScalarMappable` mixin.\n\n.. seealso::\n\n :doc:`/gallery/color/colormap_reference` for a list of builtin\n colormaps.\n\n :doc:`/tutorials/colors/colormap-manipulation` for examples of how to\n make colormaps and\n\n :doc:`/tutorials/colors/col... | [
[
"numpy.uint8",
"numpy.ma.asarray",
"numpy.empty"
]
] |
yuningkang/APIRecX | [
"aaef5f3f0b669d7a907ddb3273e6658c9267c68a"
] | [
"baseline/lstm/model/RNN_Common.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass RnnCommon(nn.Module):\n def __init__(self,\n input_size,\n hidden_size,\n layer_num,\n batch_first,\n drop_out = 0.0,\n biderction=True,\n... | [
[
"torch.stack",
"torch.nn.ModuleList",
"torch.cat",
"torch.zeros"
]
] |
RoxanneYang/STAM | [
"7334ec13eae90802f04367ffebdffe8d6d70738f"
] | [
"analyzer/utils.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Mar 2 10:14:23 2018\n\n@author: admin\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport statsmodels.api as sm\nimport pymysql\nimport time\nfrom functools import wraps\nfrom datetime import datetime\n\nconfig = {\n 'host': 'magiquant.mysql.rds.aliyuncs... | [
[
"pandas.concat",
"numpy.isnan",
"pandas.DataFrame",
"numpy.size",
"numpy.exp",
"numpy.array",
"numpy.average",
"numpy.zeros",
"numpy.where"
]
] |
haraldschilly/riemann_book | [
"46698d695c43da1ad51cd10249240b2531ee578e"
] | [
"utils/animation_tools.py"
] | [
"\"\"\"\n*NOTE:* This version is slightly modified from the one in\n $CLAW/visclaw/src/python/visclaw/animation_tools.py\n\nSome functions requires JSAnimation, either from Clawpack \nor by installing it separately from\n https://github.com/jakevdp/JSAnimation\n\nThis animation_tools module contains tools to ... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.animation.writers.is_available",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.axes",
"matplotlib.image.imread",
"matplotlib.pyplot.close",
"matplotlib.pyplot.show",
"matplotlib.... |
dchabot/ophyd_hkl | [
"60cb3c3a695898d35ad7b513951bf4470a40711f"
] | [
"tests/test_signal.py"
] | [
"\nimport sys\nimport logging\nimport unittest\nimport threading\nimport random\nimport time\nimport copy\n\nimport numpy as np\nimport epics\n\nfrom ophyd.signal import (Signal, EpicsSignal, EpicsSignalRO)\nfrom ophyd.utils import (ReadOnlyError, TimeoutError)\n\nlogger = logging.getLogger(__name__)\n\n\nclass Fak... | [
[
"numpy.array"
]
] |
kenmcmil/nnitp | [
"aa2ed7286a675f3943ca5b9405066b78f7858fd9"
] | [
"nnitp/mpl_editor.py"
] | [
"#\n# Copyright (c) Microsoft Corporation.\n#\n\nfrom matplotlib.backends.qt_compat import QtCore, QtWidgets\nfrom matplotlib.backends.backend_qt4agg import (\n FigureCanvas, NavigationToolbar2QT as NavigationToolbar)\nfrom matplotlib.figure import Figure\n\nfrom traits.api import Any, Instance\nfrom traitsui.qt... | [
[
"matplotlib.backends.backend_qt4agg.FigureCanvas"
]
] |
phamduchoangeee/number-plate-dectect | [
"1f72485d0e6a87d20206d1864091e68174ca7aa5"
] | [
"PlateDetection/Preprocess.py"
] | [
"# Preprocess.py\n\nimport cv2\nimport numpy as np\n\n# module level variables\nGAUSSIAN_SMOOTH_FILTER_SIZE = (5, 5)\nADAPTIVE_THRESH_BLOCK_SIZE = 19\nADAPTIVE_THRESH_WEIGHT = 9\n\n\ndef preprocess(imgOriginal):\n imgGrayscale = extractValue(imgOriginal)\n\n imgMaxContrastGrayscale = maximizeContrast(imgGrays... | [
[
"numpy.zeros"
]
] |
realshallow/DeepFakeTorch | [
"33b6f65e77aeba4ad3c500b23cfd239c2a079fe5"
] | [
"face_detect.py"
] | [
"from facenet_pytorch import MTCNN\r\nimport torch\r\nimport numpy as np\r\nimport cv2\r\nfrom PIL import Image\r\nfrom img_rotate import rotate\r\nfrom loguru import logger\r\nimport os\r\nimport argparse\r\n\r\ndevice = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')\r\nprint('Running on device: {}... | [
[
"numpy.array",
"torch.cuda.is_available"
]
] |
DevTheDev/C-SSAW | [
"023bcc5b09b1a49447537dd63de4158b09f235b5"
] | [
"Vision/characterPosition.py"
] | [
"import csv\nimport cv2\nimport pytesseract as pt\nimport numpy as np\nfrom io import StringIO\n\nimageFile = 'stop.jpg'\nimg = cv2.imread(imageFile)\n# img = cv2.resize(img, None, fx=2, fy=2, interpolation=cv2.INTER_CUBIC)\ngrayscaled = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)\nthreshold = cv2.bitwise_not(cv2.adaptive... | [
[
"numpy.random.randint"
]
] |
federicopozzi33/vision | [
"b969cca783cfe6c1009b7bf60609e28d83c973a6"
] | [
"torchvision/io/video.py"
] | [
"import gc\nimport math\nimport os\nimport re\nimport warnings\nfrom fractions import Fraction\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nimport numpy as np\nimport torch\n\nfrom ..utils import _log_api_usage_once\nfrom . import _video_opt\n\n\ntry:\n import av\n\n av.logging.set_level(av.... | [
[
"torch.empty",
"numpy.dtype",
"numpy.stack",
"numpy.round",
"numpy.concatenate",
"torch.jit.is_tracing",
"torch.jit.is_scripting",
"torch.as_tensor"
]
] |
DreaaZamaa/CorePy | [
"64105751664e85a2106b71fcc5c124111c62ca0b"
] | [
"Corepy Examples/Coreimage.py"
] | [
"import numpy as np\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nimport os\nimport matplotlib.patches as patches\nimport pickle\nimport math\nimport corepytools as corepy\nimport json\n\nCoreOfStudy = 'Public'\n\nCorebeta=json.load(open(os.path.join(CoreOfStudy + '.json')))\n\n\nFormation_names = '-'.jo... | [
[
"matplotlib.patches.Rectangle",
"numpy.array",
"numpy.shape",
"matplotlib.pyplot.subplots"
]
] |
sustcjudgement/Judgement_information_extraction | [
"c769eb1cb7ee695a157a981dbe9cd9d6559d072b"
] | [
"clustering/KM.py"
] | [
"from sklearn.cluster import KMeans\nfrom sklearn.cluster import *\nfrom sklearn import metrics\nimport numpy as np\nimport openpyxl\nimport matplotlib.pylab as plt\nimport pandas as pd\nfrom sklearn.cluster import Birch\nfrom sklearn.metrics import calinski_harabaz_score\n\nFILE_NAME = \"E:\\data_analysis\\Judgeme... | [
[
"pandas.read_excel",
"sklearn.cluster.KMeans",
"sklearn.cluster.Birch",
"numpy.array",
"numpy.zeros"
]
] |
okingjerryo/modelExperiment | [
"6e6a7b6055a2e4efff7d7e599fa8b79a2ca3270e"
] | [
"fixGanExperment/util.py"
] | [
"import os.path\n'''\nsunkejia\nfile loader\n'''\nimport args\nimport scipy\nimport os\nimport random\nimport numpy as np\nimport threading\nimport queue as Queue\nimport cv2\nfrom glob import glob\nimport glob\n\n#自定义数据读取类\n'''\n设计思路是假设原图和5类噪声共计6类,原图单独在一个文件夹中,噪声图像在指定的文件夹中\n每次读取数据取原图一张再取指定的文件夹中随机选择一种噪声读出图像,制作二元组<Io... | [
[
"numpy.random.get_state",
"scipy.misc.imresize",
"numpy.asarray",
"numpy.random.shuffle",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
larsbratholm/global_fchl | [
"f99065c5d9a5c24eaaa45245ad338e373ae8f18f"
] | [
"plotting.py"
] | [
"import numpy as np\nfrom scipy import interpolate\nimport matplotlib.pyplot as plt\nfrom matplotlib.collections import LineCollection\nfrom matplotlib.gridspec import GridSpec\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom mpl_toolkits.mplot3d.art3d import Line3DCollection\nfrom matplotlib.ticker import FormatStrF... | [
[
"numpy.linspace",
"numpy.arange",
"scipy.interpolate.splprep",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.Normalize",
"numpy.concatenate",
"matplotlib.pyplot.clf",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
jackapbutler/Genetics | [
"fe581898ce151fc7f9bc357b6c330e2b824d4d16"
] | [
"lung-cancer/lung-cancer.py"
] | [
"# Data from https://www.kaggle.com/josemauricioneuro/lung-cancer-patients-mrna-microarray\nDATA_PATH = \"./data/complete_dataframe.csv\"\n\n\nimport pandas as pd\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.model_selection import train_test_spl... | [
[
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.train_test_split",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.svm.SVC",
"sklearn.preprocessing.StandardScaler"
]
] |
jaidevshriram/cross-view | [
"844b4ded335e31fe3144adb412792221703d5246"
] | [
"test.py"
] | [
"import argparse\nimport glob\nimport os\n\nimport PIL.Image as pil\n\nimport cv2\n\nfrom crossView import model, CrossViewTransformer, CycledViewProjection\n\nimport numpy as np\n\nimport torch\n\nfrom torchvision import transforms\n\nfrom easydict import EasyDict as edict\nimport matplotlib.pyplot as PLT\n\n\ndef... | [
[
"torch.device",
"torch.no_grad",
"numpy.zeros",
"torch.load"
]
] |
WLM1ke/aiomoex | [
"dd7f6c4cb9482d0a3185c340274a4d4d42e15a9f"
] | [
"tests/test_history.py"
] | [
"import pytest\nimport pandas as pd\n\nfrom aiomoex import history\n\n\n@pytest.mark.asyncio\nasync def test_get_board_dates(http_session):\n data = await history.get_board_dates(http_session)\n assert isinstance(data, list)\n assert len(data) == 1\n assert data[0][\"from\"] == \"1997-03-24\"\n asser... | [
[
"pandas.DataFrame"
]
] |
mbirkholzupc/urlproj | [
"bace4bc0462acab3ee29d2a9f9ef583747f7bc30"
] | [
"data/household_preprocess.py"
] | [
"\"\"\"\n.. module:: pamap2_preprocess.py\n\n*************\n\n:Description: Script to preprocess the household power consumption dataset. In particular,\n the preprocessing is:\n - Deal with missing values marked with '?'\n - Drop date/time columns\n\n:Authors: birkholz\n\n:... | [
[
"matplotlib.pyplot.cm.Spectral",
"pandas.read_csv",
"matplotlib.pyplot.title",
"pandas.DataFrame",
"numpy.zeros_like",
"sklearn.preprocessing.MinMaxScaler",
"matplotlib.pyplot.show",
"numpy.random.default_rng"
]
] |
tmtenbrink/rustfrc | [
"e5bdebb60f6fd3064f120229649b5165d017e7e3"
] | [
"test.py"
] | [
"import python.rustfrc as r\nimport numpy as np\nimport time\n\ninit_x = (np.ones((900, 700, 100))*24.31)\ninit_y = (np.ones((900, 700, 100))*30).astype(np.int32)\ninit_z = np.ones((900, 700, 50))*30\n\n\n# start = time.perf_counter()\n# x = r.binom_split(init_x)\n# end = time.perf_counter()\n# print(str(end - star... | [
[
"numpy.ones"
]
] |
bihanli/yolactBH | [
"756bc91c5110e532abe75729c905f70cfb988c23"
] | [
"data/coco/annotations/cocosplit.py"
] | [
"import json\nimport argparse\nimport funcy\nfrom sklearn.model_selection import train_test_split\n\nparser = argparse.ArgumentParser(description='Splits COCO annotations file into training and test sets.')\nparser.add_argument('annotations', metavar='coco_annotations', type=str,\n help='Path to ... | [
[
"sklearn.model_selection.train_test_split"
]
] |
ShanRaye/sqlalchemy-challenge | [
"7f8d71cd73ad16a37c5412ba407acba1197b26be"
] | [
"app.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\nimport sqlalchemy\nfrom sqlalchemy.ext.automap import automap_base\nfrom sqlalchemy.orm import Session\nfrom sqlalchemy import create_engine, func\nimport pandas as pd\nimport datetime as dt\n\nfrom flask import Flask, jsonify\n\nengine = create_engine(\"sqlite:... | [
[
"pandas.DataFrame"
]
] |
bundocka/fast-carpenter | [
"fa90ba6fb28a73c5de4be53daebc7af9889f2478"
] | [
"fast_carpenter/expressions.py"
] | [
"import numpy as np\nimport re\nimport numexpr\nimport tokenize\nimport awkward\nimport logging\ntry:\n from StringIO import StringIO\nexcept ImportError:\n from io import StringIO\n\nlogger = logging.getLogger(__name__)\n\n\n__all__ = [\"get_branches\", \"evaluate\"]\n\n\nconstants = {\"nan\": np.nan,\n ... | [
[
"numpy.repeat",
"numpy.array_equal"
]
] |
akmeraki/deep-learning- | [
"ba4302a8d65ac8b63627bcfa8e3b23871fa2c390"
] | [
"yadlt/core/model.py"
] | [
"\"\"\"Model scheleton.\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport tensorflow as tf\n\nfrom .config import Config\n\n\nclass Model(object):\n \"\"\"Class representing an abstract Model.\"\"\"\n\n def __init__(self, name):\n \"\"\"Constructor.\n\... | [
[
"tensorflow.Graph",
"tensorflow.Session"
]
] |
ultrons/apex | [
"ebcd7f084bba96bdb0c3fdf396c3c6b02e745042"
] | [
"apex/contrib/multihead_attn/fast_self_multihead_attn_func.py"
] | [
"import torch\nimport fast_self_multihead_attn\nimport fast_self_multihead_attn_bias\nimport fast_self_multihead_attn_bias_additive_mask\n\nclass FastSelfAttnFunc(torch.autograd.Function) :\n @staticmethod\n def forward(ctx, use_time_mask, is_training, heads, inputs, input_weights, output_weights, input_biase... | [
[
"torch.tensor"
]
] |
danifranco/UNetPlusPlus | [
"869063cd53ad7f7e81dc268605671b39365f7f76"
] | [
"pytorch/nnunet/training/network_training/nnUNet_variants/profiling/nnUNetTrainerV2_2epochs.py"
] | [
"# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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# ... | [
[
"torch.cuda.is_available",
"torch.cuda.amp.autocast"
]
] |
fabianzoepf/cross_section | [
"69a26d4f73873a95504120666ecc594ef86595c0"
] | [
"analyze_scale.py"
] | [
"\"\"\"Analyze fish scales: extract their cross section and count the rings.\"\"\"\nimport argparse\nimport os\nimport glob\nimport imghdr\n\nimport pandas as pd\nimport cv2\nfrom tqdm import tqdm\n\nimport cross_section\nimport count_rings\n\n\ndef export(scale_data: pd.DataFrame, out_file: str) -> None:\n \"\"... | [
[
"pandas.DataFrame"
]
] |
ndey96/lucent | [
"d868d8ca52520bd245c1e5fcf3b026782f77e561"
] | [
"lucent/optvis/transform.py"
] | [
"# Copyright 2020 The Lucent 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... | [
[
"torch.ones",
"numpy.random.choice",
"torch.tensor",
"numpy.ceil",
"torch.nn.Upsample",
"torch.cuda.is_available",
"torch.nn.functional.pad"
]
] |
TomMonks/basecast | [
"312c2c2a80a4cd15257be4b53ced87d5d5fa5ec7"
] | [
"tests/test_naive.py"
] | [
"'''\nTests for Naive benchmark classes\n\nTests currently cover:\n\n1. Forecast horizons\n2. Allowable input types: np.ndarray, pd.DataFrame, pd.Series\n3. Failure paths for abnormal input such as np.nan, non numeric,\n empty arrays and np.Inf\n4. Predictions\n - naive1 - carries forward last value\n - sna... | [
[
"pandas.Series",
"numpy.random.seed",
"numpy.array_equal",
"numpy.isnan",
"numpy.arange",
"pandas.DataFrame",
"numpy.random.poisson",
"numpy.array"
]
] |
kafkasl/hpc.fassr | [
"9608dc1a9ca01951230dc006777be7cc379769b5"
] | [
"src/plots/boxplot_3.py"
] | [
"from glob import glob\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom matplotlib.patches import Polygon\nimport matplotlib\n\nfrom utils import load_obj\n\nshow_plot = False\ncols = [\"dataset\", \"period\", \"clf\", \"magic\", \"model_params\", \"k\", \"bot_thresh\",\n \"t... | [
[
"pandas.concat",
"pandas.to_datetime",
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"pandas.to_numeric",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"numpy.round",
"matplotlib.pyplot.gcf",
"numpy.average",
... |
iesus/thesis-production-models | [
"38bf703db513ffeed5a533590fbae747235a60ba"
] | [
"rnn/prodSRNN_UID.py"
] | [
"import theano,numpy,os\nfrom theano import tensor as T\nfrom collections import OrderedDict\n\nimport rnn.prodSRNN_notBPTT_mon\n\n'''\n RecurentNeuralNetwork to model UID, receives a probability distribution of possible word productions and a DSS, and outputs a new probability distribution per time step that ho... | [
[
"numpy.asarray",
"numpy.ndarray",
"numpy.random.normal",
"numpy.argmax",
"numpy.zeros"
]
] |
cqh6666/transfer_learning_code | [
"93225814b8225d9cd8e4addffba6a7d52203443b"
] | [
"deep transfer learning/DAN/DAN.py"
] | [
"from __future__ import print_function\nimport argparse\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.autograd import Variable\nimport os\nimport math\nimport data_loader\nimport ResNet as models\nfrom torch.utils import model_zoo\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0... | [
[
"torch.nn.functional.log_softmax",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.no_grad",
"torch.cuda.is_available",
"torch.autograd.Variable"
]
] |
kais-siala/rmnd-lca | [
"db00e65e520b59e7e85268cbefb5fef593139715"
] | [
"premise/electricity.py"
] | [
"import os\nfrom . import DATA_DIR\nfrom .activity_maps import InventorySet\nfrom .geomap import Geomap\nfrom wurst import searching as ws\nimport csv\nimport numpy as np\nimport uuid\nimport wurst\nfrom .utils import get_lower_heating_values\nfrom datetime import date\n\nPRODUCTION_PER_TECH = (\n DATA_DIR / \"e... | [
[
"numpy.isnan",
"numpy.arange"
]
] |
viridityzhu/ROMP | [
"82d72d099e4dcea8ec50f84f634e0e91011c2d84"
] | [
"romp/lib/utils/util.py"
] | [
"#encoding=utf-8\nimport h5py\nimport torch\nimport numpy as np\nimport json\nimport torch.nn.functional as F\nimport cv2\nimport math\nimport hashlib\nimport shutil\nimport pickle\nimport yaml\nimport csv\nimport platform\nimport os,sys\nimport glob\nfrom io import BytesIO\nfrom scipy.spatial.transform import Rota... | [
[
"numpy.dot",
"torch.transpose",
"numpy.savez",
"torch.sin",
"numpy.asarray",
"torch.cat",
"torch.zeros",
"numpy.max",
"torch.where",
"numpy.roll",
"numpy.linalg.svd",
"torch.norm",
"numpy.ones_like",
"torch.ones",
"torch.sqrt",
"numpy.linalg.eig",
... |
mjhajharia/pymc3 | [
"e03f5bf6a85ab350bf2ae3029dade7b9fc12dd07"
] | [
"pymc/math.py"
] | [
"# Copyright 2020 The PyMC Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"numpy.linalg.svd",
"numpy.abs",
"numpy.meshgrid",
"numpy.triu_indices",
"numpy.isnan",
"numpy.empty_like",
"numpy.asarray",
"numpy.arange",
"scipy.sparse.block_diag",
"numpy.tril_indices",
"numpy.expm1",
"scipy.linalg.block_diag",
"numpy.random.uniform",
"n... |
Yangzhen0000/CDVD-TSP | [
"95adff7c0b827b7170619b58a3edcec03a9a137e"
] | [
"code/model/motion_net.py"
] | [
"import torch\nimport torch.nn as nn\n\ndef make_model(args):\n device = 'cpu' if args.cpu else 'cuda'\n return MotionNet()\n\n\nclass MotionNet(nn.Module):\n \"\"\"docstring for MotionNet\"\"\"\n def __init__(self):\n super(MotionNet, self).__init__()\n print(\"Creating MotionNet\")\n\n ... | [
[
"torch.nn.Conv2d",
"torch.nn.LeakyReLU",
"torch.nn.ConvTranspose2d",
"torch.cat"
]
] |
NatureGeorge/pyRMSD | [
"9b45fcad944596a021823c9d5a5b73fcddbcd1fc"
] | [
"pyRMSD/benchmark/BenchmarkNeighborOperations.py"
] | [
"\"\"\"\nCreated on 10/08/2012\n\n@author: victor\n\"\"\"\nfrom __future__ import print_function\nimport time\nimport random\nimport numpy\nfrom pyRMSD.condensedMatrix import CondensedMatrix\nimport pyRMSD.benchmark.alias.condensedMatrix as PythonCondensedMatrix\nfrom pyRMSD.benchmark.alias.neighbourOps import choo... | [
[
"numpy.testing.assert_array_equal"
]
] |
bianzheng123/SimilaritySearchScript | [
"7fcfd7c161bd33e1f8135c1479eae3fc538f7fe1"
] | [
"draw_curve/paper/config_compare.py"
] | [
"import json\nimport matplotlib.pyplot as plt\n\n\ndef get_cluster_nn_classification(json_dir):\n x_arr = []\n y_arr = []\n with open(json_dir, 'r') as file:\n json_data = json.load(file)\n for ele in json_data:\n if ele['recall'] == 0.0:\n continue\n x_ar... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
zecevic-matej/gan_transforming_faces | [
"079662fc148d8a114d8e902d2df40a5ca50f0970"
] | [
"pix2pix_script.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nimport argparse\nimport os\nimport json\nimport glob\nimport random\nimport collections\nimport math\nimport time\n\nconfig = {\n \"input_dir\": None,\n ... | [
[
"tensorflow.concat",
"tensorflow.control_dependencies",
"numpy.concatenate",
"tensorflow.train.ExponentialMovingAverage",
"tensorflow.tanh",
"tensorflow.map_fn",
"tensorflow.layers.conv2d_transpose",
"tensorflow.pad",
"tensorflow.train.AdamOptimizer",
"tensorflow.train.batc... |
ysglh/tensorflow_for_- | [
"6c3c766dcabff3b5fa41dbfd491c9e8062a77b07"
] | [
"tensorflow/contrib/autograph/impl/conversion.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.util.tf_inspect.isclass",
"tensorflow.python.util.tf_inspect.ismethod",
"tensorflow.contrib.autograph.pyct.inspect_utils.getnamespace",
"tensorflow.python.util.tf_inspect.getmodule",
"tensorflow.contrib.autograph.pyct.origin_info.resolve",
"tensorflow.contrib.autograph.c... |
fabiomaia/msc | [
"43e3a8e17786c2c3246768f29be60d6c93f52527"
] | [
"src/plot_vgg16.py"
] | [
"import os\nimport re\nimport argparse\nimport csv\nimport json\nimport itertools\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport helpers\n\n\ndef truncate(f):\n return float(\"{:.2e}\".format(f))\n\n\ndef truncate_floats(stats):\n for stat in stats:\n for h in stat['hyperparameters']:... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.ylabel",
"numpy.std",
"numpy.mean",
"matplotlib.pyplot.close",
"matplotl... |
CaFeCoKe/Scream_Detection | [
"3dcaba5c14c225221220aae33c09aac0b846873c"
] | [
"demo.py"
] | [
"import sys\nimport numpy as np\n\nimport pyaudio\n\nimport pyqtgraph as pg\nfrom PyQt5 import QtCore, uic\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtWidgets import *\n\nimport librosa\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\nSAMPLING_RATE = 22050 # 음성데이터의 샘플링 레이트\nCHUNK_SIZE = 22050... | [
[
"torch.nn.functional.dropout2d",
"torch.load",
"numpy.arange",
"torch.nn.Conv2d",
"torch.tensor",
"torch.nn.Linear",
"numpy.fromstring",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
boat-ocean/open_spiel | [
"38941dee3beb52ffdb134b66f420a758634d9a20"
] | [
"open_spiel/python/algorithms/rcfr_test.py"
] | [
"# Copyright 2019 DeepMind Technologies Ltd. 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 r... | [
[
"tensorflow.compat.v1.ones",
"tensorflow.compat.v1.keras.optimizers.Adam",
"tensorflow.compat.v1.expand_dims",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.random.set_random_seed",
"tensorflow.compat.v1.enable_eager_execution",
"numpy.zeros"
]
] |
JoyHuYY1412/CADR-FixMatch | [
"e226b43951a25384ae9074ea56a8a6316f1d31be"
] | [
"scripts/inspect_dataset.py"
] | [
"#!/usr/bin/env python\n\n\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to... | [
[
"tensorflow.train.MonitoredSession",
"numpy.zeros"
]
] |
ethanscho/tensorflow-edge | [
"bea7f4e570a854827276c1215f4bbada90fabc9b"
] | [
"edge/semantic_segmentation/model.py"
] | [
"\nimport numpy as np\nimport tensorflow as tf\n\nclass Model(object):\n def __init__(self, model_filepath):\n # The file path of model\n self.model_filepath = model_filepath\n # Initialize the model\n self.load_graph(model_filepath = self.model_filepath)\n\n def load_graph(self, m... | [
[
"tensorflow.Graph",
"tensorflow.import_graph_def",
"tensorflow.InteractiveSession",
"tensorflow.gfile.GFile",
"tensorflow.placeholder",
"tensorflow.GraphDef"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.