repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
karannewatia/Mycelium
[ "c20deab29d97025d7623af4bbf97f79f3132b415" ]
[ "graph_scripts/identification_graph.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nplt.rcParams['pdf.fonttype'] = 42\nplt.rcParams['ps.fonttype'] = 42\n\n\nmalice_vals = [0.005, 0.01, 0.02, 0.04]\nind = np.arange(4)\n\n\n#replace these with the data obtained from identification.py\nk2r1 = [0.0, 0.0, 0.0008000000000000229, 0.00159999999999993...
[ [ "matplotlib.pyplot.legend", "numpy.arange", "matplotlib.pyplot.rc", "matplotlib.pyplot.savefig", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel" ] ]
twobackfromtheend/carball
[ "6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73" ]
[ "carball/analysis2/stats/demo_stats.py" ]
[ "from collections import Counter\nfrom typing import Dict, List\n\nimport numpy as np\nimport pandas as pd\n\nfrom api.analysis.stats_pb2 import PlayerStats\nfrom api.events.demo_pb2 import Demo\nfrom api.game.game_pb2 import Game\nfrom carball.analysis2.constants.constants import FIELD_Y_LIM, FIELD_X_LIM\n\n\ndef ...
[ [ "numpy.array" ] ]
AndrewArnett/lambdata
[ "fe7e2694a0a099f9df88807f744556c230e9f18d" ]
[ "lambdata_andrewarnett/__init__.py" ]
[ "\"\"\"\nlambdata - a collection of Data Science helper functions\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\n\nfrom lambdata_andrewarnett.dataframe_helper import shape_head, baseline\n\nTEST = pd.DataFrame(np.ones(10))\n" ]
[ [ "numpy.ones" ] ]
LiTszOn/GraphSAGE
[ "dbeb50d52e8d242b3c4ad3e4264c168a2c406e70" ]
[ "graphsage/unsupervised_train.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport time\nimport tensorflow as tf\nimport numpy as np\n\nfrom graphsage.models import SampleAndAggregate, SAGEInfo, Node2VecModel\nfrom graphsage.minibatch import EdgeMinibatchIterator\nfrom graphsage.neigh_samplers import Unif...
[ [ "numpy.random.seed", "tensorflow.Variable", "tensorflow.shape", "tensorflow.placeholder_with_default", "tensorflow.assign", "tensorflow.placeholder", "numpy.save", "tensorflow.squeeze", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.sum...
Senwang98/Lightweight-Detection-and-KD
[ "7d6a4c02d922d4ed0920c9108f1f06dd63c5e90b" ]
[ "mmdet/distillation/distillers/csd_distiller.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\nimport torch\nfrom mmdet.models.detectors.base import BaseDetector\nfrom mmdet.models import build_detector\nfrom mmcv.runner import load_checkpoint, _load_checkpoint, load_state_dict\nfrom ..builder import DISTILLER, build_distill_loss\nfrom collections impo...
[ [ "torch.nn.ModuleDict", "torch.no_grad", "torch.nn.ModuleList" ] ]
itcthienkhiem/myANPR
[ "e0a76b2165d539c6a38f51f7485f37349a85a074" ]
[ "ANPR.py" ]
[ "\r\ntry:\r\n import cv2\r\nexcept ImportError:\r\n print (\"You must have OpenCV installed\")\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\n#Image(filename='../../../data/ANPR/sample_plates.png')\r\n\r\ndef showfig(image, ucmap):\r\n #There is a difference in pixel ordering in OpenCV and...
[ [ "numpy.int0", "matplotlib.pyplot.imshow", "matplotlib.pyplot.title", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.show" ] ]
ankitshah009/youtube-8m-1
[ "a0f28c9ca05b72ca709322f2c4871a4345a69fbb" ]
[ "readers.py" ]
[ "# Copyright 2016 Google Inc. 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 by app...
[ [ "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.FixedLenFeature", "tensorflow.stack", "tensorflow.minimum", "tensorflow.cast", "tensorflow.TFRecordReader", "tensorflow.sparse_to_dense", "tensorflow.decode_raw", "tensorflow.shape", "tensorflow.parse_exam...
bbitarello/ldpred
[ "b84b99f23dc83dc164300b8dee6678207461a751" ]
[ "util.py" ]
[ "\"\"\"\nVarious general utility functions.\n\n\"\"\"\nimport scipy as sp\nfrom scipy import stats\nimport pickle\nimport gzip\nimport os\nfrom itertools import takewhile\nfrom itertools import repeat\nimport sys\nimport re\n\n# LDpred currently ignores the Y and MT chromosomes.\nok_chromosomes = set(range(1, 24))\...
[ [ "scipy.stats.norm.ppf", "scipy.stats.norm.pdf", "scipy.sum", "scipy.mean", "scipy.copy", "scipy.unique" ] ]
wangxicoding/edl
[ "75d651e72e5297aba2e597588cf958ea336deb4e" ]
[ "example/distill/nlp/reader.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" ] ]
taotaotao3/only_common
[ "7dd3700d4bf3935c193b0b6f38a0dafa750ad01c" ]
[ "only_common.py" ]
[ "import sys\nimport io\nimport csv\nimport pprint\nimport pandas as pd\nimport pdb\ndef excommon(arg_1 = 'a.csv', arg_2 = 'b.csv', arg_3 = 'shift-jis'):\n\n print('sys.argv[1]:', arg_1)\n print('sys.argv[2]:', arg_2)\n print('sys.argv[3]:', arg_3)\n\n df_a = pd.read_csv(arg_1, encoding=arg_3, header=Non...
[ [ "pandas.read_csv" ] ]
MokriyYuriy/FlexNeuART
[ "49f13e3f9f0b0ea1399ea558436caaedd5233f5c" ]
[ "scripts/py_featextr_server/wordembed_cosine_server.py" ]
[ "#!/usr/bin/env python\nimport sys\nimport argparse\n\nsys.path.append('.')\n\nfrom scripts.py_featextr_server.base_server import BaseQueryHandler, startQueryServer\n\nimport numpy as np\n\nfrom scripts.py_featextr_server.utils import loadEmbeddings, createEmbedMap, robustCosineSimil\n\n# Exclusive==True means that...
[ [ "numpy.zeros_like" ] ]
OmerRe/video-processing-methods
[ "245a89aaa1e774a62da1f043058242841a4f53ee" ]
[ "project/Code/video_stabilizer.py" ]
[ "import cv2\nimport numpy as np\nfrom Code.utils import fixBorder, convert_to_gray\n\n\ndef stabilize_video(video_frames: list, config: dict) -> list:\n \"\"\"Creating a stabilized video from an arbitrary input video.\n Args:\n input_video: cv2.VideoCapture. Video we want to stabilize.\n config:...
[ [ "numpy.lib.pad", "numpy.convolve", "numpy.cumsum", "numpy.ones", "numpy.copy", "numpy.float32", "numpy.array", "numpy.zeros" ] ]
suunni/sp17-i524
[ "42dd11b914c03c741dad8a8505c3e091dc6ec412" ]
[ "project/S17-IO-3012/code/bin/benchmark_replicas_import.py" ]
[ "import matplotlib.pyplot as plt\nimport sys\nimport pandas as pd\n\n\ndef get_parm():\n \"\"\"retrieves mandatory parameter to program\n\n @param: none\n @type: n/a\n\n \"\"\"\n try:\n return sys.argv[1]\n except:\n print ('Must enter file name as parameter')\n exit()\n\n\nde...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.ylim", "matplotlib.pyplot.figure", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
RichardScottOZ/harmonica
[ "ccb0437ea0ed528cfd144844edab98141c8d08da" ]
[ "harmonica/equivalent_layer/harmonic_spherical.py" ]
[ "\"\"\"\nEquivalent layer for generic harmonic functions in spherical coordinates\n\"\"\"\nimport numpy as np\nfrom numba import jit\nfrom sklearn.utils.validation import check_is_fitted\nimport verde as vd\nimport verde.base as vdb\n\nfrom .utils import jacobian_numba, predict_numba, pop_extra_coords\nfrom ..forwa...
[ [ "numpy.atleast_1d", "numpy.broadcast", "sklearn.utils.validation.check_is_fitted", "numpy.zeros" ] ]
salihmarangoz/StereoDepthEstimation
[ "a068df34329ee0642b5eb4277dedcd7012d78b4d" ]
[ "opencv_disparity/test.py" ]
[ "##################################################################################\n# SOURCE: https://github.com/aliyasineser/stereoDepth/blob/master/stereo_depth.py\n##################################################################################\n\nimport numpy as np\nimport cv2 as cv\nimport cv2\nfrom matplot...
[ [ "numpy.uint8", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "numpy.int16" ] ]
balewski/neuron_inverter_benchmark
[ "4ad8a03c07e174728ccea2bc5f24d1ae620966a8" ]
[ "poptorch/toolbox/Dataloader_h5.py" ]
[ "__author__ = \"Jan Balewski\"\n__email__ = \"janstar1122@gmail.com\"\n\n'''\nthis data loader reads all data upon start, there is no distributed sampler\n\nreads all data at once and serves them from RAM\n- optimized for mult-GPU training\n- only used block of data from each H5-file\n- reads data from common file...
[ [ "numpy.std", "numpy.mean", "numpy.floor" ] ]
timhunderwood/numpy-to-stl
[ "eea305ae30bb4aa5882d7c66edebe76173da8b06" ]
[ "examples/cellular_example.py" ]
[ "import cellular\nimport numpy\nimport mpl_toolkits.mplot3d\nimport matplotlib.pyplot as plt\nimport numpy_to_stl\n\n\ndef get_simulated_world(cells_per_day, rule, number_of_days):\n world = cellular.World(cells_per_day, rule, ones=False)\n world.simulate(number_of_days)\n world.display(landscape=True)\n ...
[ [ "matplotlib.pyplot.show", "numpy.vstack", "matplotlib.pyplot.figure" ] ]
Beta3-Data/FacialLandmark-Live-Training
[ "10b2b464f1deb015a7f152bb14f120f0dc6f9de2" ]
[ "dataset/dataset_test.py" ]
[ "from __future__ import print_function, division\r\nimport os\r\nimport torch\r\nimport pandas as pd\r\nfrom skimage import io, transform\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom torch.utils.data import Dataset, DataLoader\r\nfrom torchvision import transforms, utils\r\nfrom FaceLandmarksDat...
[ [ "matplotlib.pyplot.imshow", "pandas.read_csv", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.scatter", "numpy.min", "numpy.max", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "matplotlib.pyplot.pause", "matplotlib.pyplot.figure" ] ]
Altizon/incubator-superset
[ "e55fe43ca67a29518674a1a2137a3dbd4f166864" ]
[ "superset/views/core.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "pandas.DataFrame.from_records" ] ]
amarildolikmeta/oac-explore
[ "e3d63992a4ff33c8df593941f498457e94f81eb8" ]
[ "scripts/launch_test.py" ]
[ "import json\nimport sys\nsys.path.append(\"../\")\nfrom trainer.particle_trainer import ParticleTrainer\nfrom trainer.gaussian_trainer import GaussianTrainer\nfrom trainer.trainer import SACTrainer\nimport numpy as np\nimport torch\nfrom main import env_producer, get_policy_producer, get_q_producer\nfrom utils.pyt...
[ [ "torch.manual_seed", "numpy.random.seed", "numpy.random.randint" ] ]
JustinWingChungHui/okkindred_facial_recognition
[ "e6744e604d0bf25f9024a2ef2ba7ca9d0760c8b1" ]
[ "train_face_recognition.py" ]
[ "# https://github.com/ageitgey/face_recognition/blob/master/examples/face_recognition_knn.py\n\nimport math\nimport os\nimport pickle\nfrom PIL import Image as PilImage\nfrom sklearn import neighbors\nfrom models import Person, Image, Tag, FaceModel\nfrom secrets import TRAIN_FACE_RECOGNITION_TEMP_DIR\nfrom file_do...
[ [ "sklearn.neighbors.KNeighborsClassifier" ] ]
ruppinlab/tcga-microbiome-prediction
[ "e7923b94738f9bd1b7862bb109002554430d9ace" ]
[ "sklearn_extensions/model_selection/_search.py" ]
[ "\"\"\"\nThe :mod:`sklearn_extesions.model_selection._search` includes utilities to\nfine-tune the parameters of an estimator.\n\"\"\"\n\n# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,\n# Gael Varoquaux <gael.varoquaux@normalesup.org>\n# Andreas Mueller <amueller@ais.uni-bonn.de>\n# ...
[ [ "sklearn.utils.validation.check_is_fitted", "scipy.stats.rankdata", "sklearn.base.clone", "sklearn.model_selection.ParameterGrid", "sklearn.utils.validation._check_fit_params", "sklearn.model_selection._validation._aggregate_score_dicts", "sklearn.base.is_classifier", "numpy.averag...
anbasile/mwe
[ "2a56b889c7c7f28aa479e477f8e52da7501c2691" ]
[ "app/words.py" ]
[ "import requests\nfrom bs4 import BeautifulSoup\nfrom collections import defaultdict\nimport pandas as pd\nimport json\nimport networkx as nx\nfrom networkx.readwrite import json_graph\nimport numpy as np\nfrom lightning import Lightning\nfrom colorsys import hsv_to_rgb\nfrom sklearn import datasets\nlgn = Lightnin...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
ritvikshrivastava/mindmeld
[ "48eccac059439ea0f32fa3ac9079415bb006233b" ]
[ "mindmeld/models/text_models.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/lic...
[ [ "sklearn.externals.joblib.dump", "sklearn.externals.joblib.load", "sklearn.linear_model.LogisticRegression", "sklearn.preprocessing.MaxAbsScaler", "sklearn.preprocessing.LabelEncoder", "numpy.bincount", "sklearn.feature_selection.SelectPercentile", "sklearn.feature_extraction.DictV...
sagieppel/Classification-of-the-material-given-region-of-an-image-using-a-convolutional-neural-net-with-attent
[ "2c78f069d4f4d9be7197b5bff6df39fc239270e4" ]
[ "EvaluateAccuracy.py" ]
[ "# Evaluate precision of image classification in a given image region\n# Instructions:\n# a) Set folder of images in Image_Dir\n# c) Set folder for ground truth Annotation in AnnotationDir\n# The Label Maps should be saved as png image with same name as the corresponding image and png ending. The value of each p...
[ [ "numpy.zeros", "numpy.sum", "torch.load" ] ]
HanumanJat8698/numpy
[ "cbec2c8054ea6150490b9e72eb051848b79344d1" ]
[ "numpy/core/tests/test_casting_unittests.py" ]
[ "\"\"\"\nThe tests exercise the casting machinery in a more low-level manner.\nThe reason is mostly to test a new implementation of the casting machinery.\n\nUnlike most tests in NumPy, these are closer to unit-tests rather\nthan integration tests.\n\"\"\"\n\nimport pytest\nimport textwrap\nimport enum\nimport iter...
[ [ "numpy.can_cast", "numpy.empty_like", "numpy.dtype", "numpy.datetime64", "numpy.testing.assert_array_equal", "numpy.core._multiarray_umath._get_castingimpl", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
malovannaya-lab/gpgrouper
[ "45cb948bfa9ed256e450ad8f257ec24324f786ca" ]
[ "gpgrouper/containers.py" ]
[ "\"\"\"Container for each experiment, has a dataframe and metadata\"\"\"\nimport os\nimport re\nfrom datetime import datetime\nimport traceback\n\nimport pandas as pd\n\n\nfrom . import _version\n\nclass UserData:\n\n def __init__(self, recno=None, datafile=None, runno=1, searchno=1, no_taxa_redistrib=0,\n ...
[ [ "pandas.DataFrame" ] ]
Chibi-Shem/Hacktoberfest2020-Expert
[ "324843464aec039e130e85a16e74b76d310f1497" ]
[ "Python Programs/The-Imvisible-Man/opcv.py" ]
[ "import numpy as np\nimport cv2\nimport time\n\ncap = cv2.VideoCapture(0)\ntime.sleep(2)\nbackground=0\n\n#capture the background\nfor i in range(30):\n ret,background = cap.read()\n\nwhile(cap.isOpened()):\n ret , img = cap.read()\n\n if not ret:\n break\n\n hsv = cv2.cvtColor(img , cv2.COLOR_B...
[ [ "numpy.array", "numpy.ones" ] ]
scilicet64/keras-spp
[ "23da20561fe92c585208af9bf3e0ef8f51bc5dcc" ]
[ "tests/test_roi_pooling.py" ]
[ "import keras.backend as K\nimport numpy as np\nfrom keras.layers import Input\nfrom keras.models import Model\n\nfrom spp.RoiPooling import RoiPooling\n\ndim_ordering = K.image_data_format()\nassert dim_ordering in {'channels_last','channels_first'}, 'dim_ordering must be in {channels_last,channels_first}'\n\npool...
[ [ "numpy.reshape", "numpy.testing.assert_almost_equal", "numpy.max", "numpy.random.rand", "numpy.array" ] ]
akashkj/superset
[ "8a157d8446780e4e71550405cbedde8a4d64d92a" ]
[ "tests/integration_tests/core_tests.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "pandas.Timestamp", "pandas.DataFrame" ] ]
zierenberg/machine_learning_muca
[ "6fcca12ccda7680ea4cb0e1f10bb53a68b6b0a02" ]
[ "2019_noe_deep_boltzmann_tfv2/deep_boltzmann/networks/noninvertible.py" ]
[ "import keras\nimport tensorflow as tf\nimport numpy as np\n\nfrom deep_boltzmann.networks import nonlinear_transform\nfrom deep_boltzmann.networks import connect as _connect\n\nclass NormalTransformer(object):\n\n def __init__(self, mu_layers, sigma_layers):\n self.mu_layers = mu_layers\n self.sig...
[ [ "tensorflow.reduce_sum", "tensorflow.exp" ] ]
CKPalk/SeattleCrime_DM
[ "0bfbf597ef7c4e87a4030e1c03f62b2f4c9f3c5b" ]
[ "DataMining/Stats/coord_bounds.py" ]
[ "''' Work of Cameron Palk '''\n\nimport sys\nimport pandas as pd\n\ndef main( argv ):\n\ttry:\n\t\tcsv_filepath \t= argv[ 0 ]\n\t\toutput_filepath = argv[ 1 ]\n\texcept IndexError:\n\t\tprint( \"Error, usage: \\\"python3 coord_bounds.py <CSV> <output_file>\\\"\" ) \n\t\treturn\n\t\n\ttraining_data = pd.read_csv( cs...
[ [ "pandas.read_csv" ] ]
KhalilBryant/PlasmaPy
[ "05f7cb60348c7048fb3b8fbaf25985f2fba47fb7" ]
[ "plasmapy/utils/roman/tests/test_roman.py" ]
[ "import pytest\nimport numpy as np\nimport plasmapy.utils.roman as roman\nfrom plasmapy.utils.pytest_helpers import run_test\n\n\nints_and_roman_numerals = [\n (1, \"I\"),\n (2, \"II\"),\n (3, \"III\"),\n (4, \"IV\"),\n (5, \"V\"),\n (6, \"VI\"),\n (7, \"VII\"),\n (8, \"VIII\"),\n (9, \"I...
[ [ "numpy.int", "numpy.int32", "numpy.int64", "numpy.int16" ] ]
yanzhoupan/dlrm_ssm
[ "49ca1e4487ff0e148065c0a133acb078835a9b86" ]
[ "tricks/lsh_pp_pretaining.py" ]
[ "# data preprocessing for LSH embedding\nimport numpy as np\nimport torch\nfrom min_hash_generator import SparseBitVectorMinHashGenerator\nfrom collections import defaultdict\n# import multiprocessing\nfrom tqdm import tqdm\nimport time\nimport random\nimport concurrent.futures\nimport pdb\n\nseed = 123\nrandom.see...
[ [ "numpy.savez", "numpy.random.seed", "torch.manual_seed", "numpy.arange", "numpy.load", "numpy.zeros" ] ]
pulkit1joshi/SimGNN
[ "199b6014482a1dc8719394de4fc17f03c1b7192c" ]
[ "src/simgnn.py" ]
[ "from tensorflow import keras\nfrom tensorflow.keras import layers\nfrom keras_gcn import GraphConv\nfrom keras.models import Model\nfrom keras.layers import Input\nfrom custom_layers import Attention, NeuralTensorLayer\n\"\"\" \nMain model : Node-to-Node interaction not implemented.\nFunctional API :\nShared layer...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.activations.sigmoid" ] ]
iejMac/TTTArena
[ "056636f064769c3251fb2448e7487b4fa8394733" ]
[ "random/agent.py" ]
[ "from agent import Agent\r\nfrom numpy.random import randint\r\n\r\nclass RandomAgent(Agent):\r\n def __init__(self, name):\r\n super().__init__(name)\r\n\r\n def make_action(self, state):\r\n movex = randint(0, state.shape[1])\r\n movey = randint(0, state.shape[0])\r\n return (movey, movex)\r\n\r\n\r...
[ [ "numpy.random.randint" ] ]
AsianHam/geoclaw
[ "b5f9ee8cd6e64d107ba8bba1e6d588aa7bf6d417" ]
[ "examples/tsunami/eta_init_force_dry/setrun.py" ]
[ "\"\"\"\nModule to set up run time parameters for Clawpack.\n\nThe values set in the function setrun are then written out to data files\nthat will be read in by the Fortran code.\n\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nimport os, sys\nimport numpy as np\n\n\ntry:\...
[ [ "numpy.arange" ] ]
Tobias-Fischer/dreyeve
[ "d73979d738e706d90a8aa9d696c6e4dcb19c1134", "d73979d738e706d90a8aa9d696c6e4dcb19c1134" ]
[ "experiments/actions/action_utils.py", "experiments/train/utils.py" ]
[ "\"\"\"\nUtilities for improve code readability in `predict_actions_with_SVM.py`\n\"\"\"\n\nimport itertools\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom os.path import join, exists\n\n\nclass DreyeveRun:\n \"\"\"\n Single run of the DR(eye)VE dataset.\n \"\"\"\n\n def __init__(self, datas...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.yticks", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel" ], [ "numpy.array" ] ]
strieb/VisualQuestionAnswering
[ "28f6ae1f2abd839145306a1d4f34ee84271cf3c1" ]
[ "vqa_image_preprocess.py" ]
[ "import json\nfrom collections import Counter\nimport re\nfrom VQA.PythonHelperTools.vqaTools.vqa import VQA\nimport random\nimport numpy as np\nfrom keras.preprocessing.image import load_img, img_to_array, ImageDataGenerator\nfrom matplotlib import pyplot as plt\nimport os\nimport VQAModel\nfrom keras.applications...
[ [ "numpy.expand_dims" ] ]
bakkerjarr/NetTrafClassificationExploration
[ "66febafcbe4820851784ae72c50a49c28fa91df4" ]
[ "initialExp/classifiers/iscx_naive_bayes.py" ]
[ "# Copyright 2016 Jarrod N. Bakker\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr...
[ [ "sklearn.naive_bayes.GaussianNB" ] ]
arwhyte/SI664-scripts
[ "99daaac123ebdbfb0fbca59251f711efb9a7d39f" ]
[ "scripts/inspect_un_data_sets.py" ]
[ "import logging\nimport os\nimport pandas as pd\nimport sys as sys\n\n\ndef main(argv=None):\n\t\"\"\"\n\tUtilize Pandas library to read in both UNSD M49 country and area .csv file\n\t(tab delimited) as well as the UNESCO heritage site .csv file (tab delimited).\n\tExtract regions, sub-regions, intermediate regions...
[ [ "pandas.read_csv" ] ]
mrzhu666/USCL
[ "8a4741046ef8f337b1e9439d1575db670a11355c" ]
[ "generateFileList.py" ]
[ "import cv2\nimport os\nimport pickle\nfrom numpy.core.fromnumeric import shape\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\nfrom typing import Tuple\nfrom collections import defaultdict\nfrom sklearn.model_selection import train_test_split\nfrom IgAModel66.setti...
[ [ "pandas.read_csv" ] ]
shivam-kotwalia/KittiSeg
[ "ac93c2f0f83bf84f2ba0d645f819b2bbeeeaf58d" ]
[ "continue.py" ]
[ "\"\"\"\nTrains, evaluates and saves the KittiSeg model.\n\n-------------------------------------------------\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Marvin Teichmann\n\nMore details: https://github.com/MarvinTeichmann/KittiSeg/blob/master/LICENSE\n\"\"\"\nfrom __future__ import absolute_import\nfrom __futur...
[ [ "tensorflow.app.flags.DEFINE_boolean", "tensorflow.app.run" ] ]
scratchrealm/spikeinterface
[ "17cfcd6f0c30c9933c11e560daf750366e12a151" ]
[ "spikeinterface/sortingcomponents/template_matching.py" ]
[ "\"\"\"Sorting components: template matching.\"\"\"\n\nimport numpy as np\n\nimport scipy.spatial\n\nfrom tqdm import tqdm\nimport sklearn, scipy\nimport scipy\n\nfrom threadpoolctl import threadpool_limits\n\ntry:\n import numba\n from numba import jit, prange\n HAVE_NUMBA = True\nexcept ImportError:\n ...
[ [ "scipy.linalg.get_blas_funcs", "numpy.sqrt", "numpy.cumsum", "numpy.concatenate", "numpy.argmin", "numpy.any", "numpy.searchsorted", "numpy.where", "scipy.linalg.solve_triangular", "scipy.optimize.differential_evolution", "numpy.unique", "numpy.arange", "numpy.f...
18bce1151/proj
[ "96c0a299ccaec29a02a9486d192a7215f5a12566" ]
[ "Diabetes_API/app.py" ]
[ "from flask import Flask, render_template, url_for, flash, redirect\r\nimport joblib\r\nfrom flask import request\r\nimport numpy as np\r\n\r\napp = Flask(__name__, template_folder='templates')\r\n\r\n@app.route(\"/\")\r\n\r\n@app.route(\"/Diabetes\")\r\ndef cancer():\r\n return render_template(\"diabetes.html\"...
[ [ "numpy.array" ] ]
ChrisQiqiang/mxnet-combination
[ "015c02f8fa1b22133202e1c70488c439cd9e726d" ]
[ "python/mxnet/base.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.frombuffer" ] ]
evemorgen/GdzieJestMojTramwajProject
[ "65a090ae4222053a2a0a1b145df5196f3658065c" ]
[ "backend/schedule_worker/utils/generate_graph.py" ]
[ "import os\nimport logging\nimport networkx as nx\nimport matplotlib.pyplot as plt\nimport json\nfrom geopy.distance import vincenty\nfrom collections import deque\n\nfrom db import MpkDb as DbApi\nfrom utils import Config\n\n\ndef czy_skrzyzowanie(przystanek, skrzyzowania, wariant, punkty):\n for skrzyzowanie i...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure" ] ]
embracesource-cv-com/keras-east
[ "0733a9a99c4446a30c8b8e1d62e102391f7a854a" ]
[ "east/utils/image_utils.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n File Name: image\r\n Description : 图像处理工具类\r\n Author : mick.yi\r\n date: 2019/2/18\r\n\"\"\"\r\nimport skimage\r\nfrom skimage import io, transform\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport random\r\n\r\n\r\ndef load_image(...
[ [ "numpy.expand_dims", "numpy.minimum", "numpy.pad", "matplotlib.pyplot.imread", "numpy.tile", "numpy.random.randint" ] ]
santosh-b/Alleviate-Robust-Overfitting
[ "c369ab2eaf51ba02a15f45db77a8c9292c8dbbf8" ]
[ "Synaptic-Flow/Utils/metrics.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nimport pandas as pd\nfrom prune import * \nfrom Layers import layers\n\ndef summary(model, scores, flops, prunable):\n r\"\"\"Summary of compression results for a model.\n \"\"\"\n rows = []\n for name, module in model.named_modules():\n f...
[ [ "numpy.prod", "numpy.zeros", "numpy.abs", "pandas.DataFrame" ] ]
kzm4269/keras-yolo3
[ "06b2b522213cb901f4a7133b87aab04079e41aff" ]
[ "test_tflite.py" ]
[ "import argparse\nimport sys\nfrom pathlib import Path\n\nimport numpy as np\nimport tensorflow as tf\nimport keras\nfrom PIL import Image\nimport matplotlib.pyplot as plt\n\nfrom yolo3.model import yolo_eval\nfrom yolo3.utils import letterbox_image\n\n\ndef predict_keras(model_path):\n model = keras.models.load...
[ [ "matplotlib.pyplot.Rectangle", "matplotlib.pyplot.Figure", "numpy.asarray", "tensorflow.lite.Interpreter", "numpy.float32" ] ]
foamliu/Image-Matching
[ "3213a8a574fa7bcc476d3de1c7370c268bf817a7" ]
[ "demo.py" ]
[ "import math\n\nimport cv2 as cv\nimport numpy as np\nimport torch\nfrom PIL import Image\nfrom torchvision import transforms\n\nfrom models import ResNetMatchModel\n\n\ndef get_image(file):\n img = cv.imread(file)\n img = img[..., ::-1] # RGB\n img = Image.fromarray(img, 'RGB') # RGB\n img = transfor...
[ [ "numpy.dot", "numpy.clip", "torch.load", "numpy.linalg.norm", "torch.no_grad", "torch.device" ] ]
ucbrise/snoopy
[ "da4c98e3876c10cf52aa51ece3b62c5e8b8e335a" ]
[ "scripts/fig/util.py" ]
[ "import json\nimport math\nimport random\nfrom collections import defaultdict\nfrom scipy.special import lambertw\n\ndef parseData(filename):\n results = []\n f = open(filename, \"r\")\n for line in f:\n elems = line.split()\n result = {\n \"clients\": int(elems[0]),\n \...
[ [ "scipy.special.lambertw" ] ]
idc9/explore
[ "ce8aa039de96b1dd9fecc19fa098c222863ac3ce" ]
[ "explore/viz/continuous.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.preprocessing import StandardScaler\nfrom scipy.stats import pearsonr\n\nfrom explore.utils import safe_apply\nfrom explore.viz.utils import bold, ABLine2D, fmt_pval\n\n\ndef plot_scatter(x, y, alp...
[ [ "matplotlib.pyplot.legend", "pandas.Series", "matplotlib.pyplot.scatter", "scipy.stats.pearsonr", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.xlabel", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.ylabel" ] ]
timkphd/examples
[ "04c162ec890a1c9ba83498b275fbdc81a4704062" ]
[ "mpi/mpi4py/simple.py" ]
[ "#!/usr/bin/env python3\nfrom mpi4py import MPI\nimport numpy\nglobal numnodes,myid,mpi_err\nglobal mpi_root\nimport sys\nmpi_root=0\n# This is a bag-of-tasks program. We define a manager task\n# that distributes work to workers. Actually, the workers\n# request input data. The manager sits in a loop calling\n# ...
[ [ "numpy.asarray", "numpy.arange", "numpy.array", "numpy.zeros_like" ] ]
Prettyfinger/Twostream_reID
[ "8e340e0c03bd248b04ff1b48398ca99b6aeaa508", "8e340e0c03bd248b04ff1b48398ca99b6aeaa508" ]
[ "evaluate.py", "score_rank.py" ]
[ "import scipy.io\nimport torch\nimport numpy as np\n#import time\nimport os\n\n#######################################################################\n# Evaluate\ndef evaluate(qf,ql,qc,gf,gl,gc):\n query = qf\n score = np.dot(gf,query)\n # predict index\n index = np.argsort(score) #from small to large...
[ [ "numpy.dot", "numpy.in1d", "numpy.setdiff1d", "numpy.argwhere", "numpy.intersect1d", "numpy.append", "numpy.mean", "numpy.argsort" ], [ "numpy.dot", "numpy.in1d", "numpy.setdiff1d", "numpy.argwhere", "numpy.intersect1d", "numpy.append", "numpy.mean",...
spectrochempy/spectrochempy
[ "829b290f465e630078785e303dbab197cd78b815" ]
[ "spectrochempy/core/analysis/simplisma.py" ]
[ "# -*- coding: utf-8 -*-\n\n#\n# =============================================================================\n# Copyright (©) 2015-2022 LCS\n# Laboratoire Catalyse et Spectrochimie, Caen, France.\n# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT\n# See full LICENSE agreement in the root directory\n# ===================...
[ [ "numpy.dot", "numpy.sqrt", "numpy.min", "numpy.arange", "numpy.linalg.norm", "numpy.linalg.det", "numpy.max", "numpy.std", "numpy.linalg.lstsq", "numpy.mean", "numpy.argmax", "numpy.zeros" ] ]
pawni/sgld_online_approximation
[ "1edae8a669fdeef4e5501bcb07d6b809fc4cccd9" ]
[ "experiment.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport os\nfrom tensorflow.examples.tutorials.mnist import input_data\nimport edward as ed\nfrom edward.models import Normal, Categorical, Multinomial, Empirical, PointMass\nfrom tensorflow.python.training import moving_averages\n\n# setup function to handle session con...
[ [ "tensorflow.matmul", "tensorflow.nn.softmax", "tensorflow.InteractiveSession", "tensorflow.zeros", "tensorflow.reduce_mean", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.ones", "tensorflow.ConfigProto", "tensorflow.reset_default_graph", "tensorflow.set_ra...
LifeEGX/methQC
[ "2b4f960e7e5c7baca9dc778ca05ee332e2f27653" ]
[ "methylcheck/qc_plot.py" ]
[ "import warnings\nfrom pathlib import Path\nimport logging\nimport pandas as pd\nimport numpy as np\nimport seaborn as sb\nimport matplotlib.pyplot as plt\n\n#app\nimport methylcheck\nfrom .progress_bar import *\n\nLOGGER = logging.getLogger(__name__)\n\n__all__ = ['run_qc', 'plot_beta_by_type', 'qc_signal_intensit...
[ [ "matplotlib.pyplot.legend", "pandas.merge", "matplotlib.pyplot.tight_layout", "pandas.read_csv", "pandas.concat", "matplotlib.pyplot.title", "numpy.linspace", "pandas.read_pickle", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "pandas.DataFrame", "matplotl...
co-develop-drv/FGVC
[ "9820d3c1a33ba402009ecb1d25e897cbcddc74d5" ]
[ "edgeconnecttest/models.py" ]
[ "import os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom .networks import InpaintGenerator, EdgeGenerator, Discriminator\nfrom .loss import AdversarialLoss, PerceptualLoss, StyleLoss, TotalVariationalLoss\n\n\nclass BaseModel(nn.Module):\n def __init__(self, name, config):\n supe...
[ [ "torch.mean", "torch.cat", "torch.load", "torch.cuda.is_available", "torch.nn.DataParallel", "torch.nn.L1Loss" ] ]
AuckeBos/MLiPPaA
[ "4b6c563f93e1eb7fc90f66a9a6ada16c07664d71" ]
[ "Element3/read_and_run.py" ]
[ "import argparse\nimport csv\n\nimport numpy as np\nimport pandas as pd\nfrom tensorflow.keras.models import load_model\n\nimport Element2.Evaluator\nfrom Element2.BaseClassification import BaseClassifier\n\n# As computed by the training data distribution (RebalanceTrainVal=False)\nmulti_train_prior = np.array([.5,...
[ [ "numpy.array", "pandas.read_csv" ] ]
sdpython/csharpyml
[ "f814af89c5b988924a7f31fe71ec6eb515292070" ]
[ "_unittests/ut_notebook/test_dynamic_cs.py" ]
[ "\"\"\"\n@brief test log(time=2s)\n\"\"\"\nimport sys\nimport os\nimport unittest\nfrom sklearn import datasets\nimport pandas\nfrom pyquickhelper.pycode import ExtTestCase, get_temp_folder\n\ntry:\n import src\nexcept ImportError:\n path = os.path.normpath(\n os.path.abspath(\n os.path...
[ [ "sklearn.datasets.load_iris", "pandas.DataFrame" ] ]
yashpatel5400/ARia
[ "1f9ad25f943f5b8859a80470715be8698863b2f8" ]
[ "detect_board.py" ]
[ "import numpy as np\nimport cv2\n\ndef rectify(h):\n if h.shape[0] * h.shape[1] != 8:\n return None\n\n h = h.reshape((4,2))\n hnew = np.zeros((4,2))\n\n add = h.sum(1)\n hnew[0] = h[np.argmin(add)]\n hnew[2] = h[np.argmax(add)]\n\n diff = np.diff(h,axis=1)\n hnew[1] = h[np.argmin(dif...
[ [ "numpy.arange", "numpy.around", "numpy.argmax", "numpy.diff", "numpy.argmin", "numpy.array", "numpy.zeros" ] ]
sappelhoff/sp_psychopy
[ "79cae80eb920b35fb27a52acfde0eda38b9124b1" ]
[ "sp_experiment/tests/test_utils.py" ]
[ "\"\"\"Testing the utility functions.\"\"\"\nimport time\nimport os\nimport os.path as op\nfrom tempfile import gettempdir\nfrom shutil import rmtree, copyfile\nfrom collections import OrderedDict\n\nimport pytest\nimport numpy as np\nimport pandas as pd\n\nimport sp_experiment\nfrom sp_experiment.define_settings i...
[ [ "pandas.read_csv", "numpy.isnan", "numpy.testing.assert_array_equal", "numpy.testing.assert_allclose", "numpy.array" ] ]
samedii/latent-diffusion
[ "f13bf9bf463d95b5a16aeadd2b02abde31f769f8" ]
[ "ldm/data/imagenet.py" ]
[ "import os, yaml, pickle, shutil, tarfile, glob\nimport cv2\nimport albumentations\nimport PIL\nimport numpy as np\nimport torchvision.transforms.functional as TF\nfrom omegaconf import OmegaConf\nfrom functools import partial\nfrom PIL import Image\nfrom tqdm import tqdm\nfrom torch.utils.data import Dataset, Subs...
[ [ "torch.utils.data.Subset", "numpy.random.uniform", "numpy.array", "numpy.unique" ] ]
hodgestar/qiskit-ignis
[ "0e511df442e864cd0e06efcdd1db7b03c011168b" ]
[ "qiskit/ignis/verification/randomized_benchmarking/circuits.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\...
[ [ "numpy.unique", "numpy.floor_divide", "numpy.ones", "numpy.max", "numpy.mod", "numpy.array" ] ]
dbckz/crossing-the-line
[ "c5debb20e263e03eab9188ce7229753034939964" ]
[ "scripts/process_perspective.py" ]
[ "\"\"\"\nScript to evaluate tweets against the Perspective API\n\nHow it's used:\n* Loads \"tweets.csv\" files according to 'root_path' and 'day_paths' vars\n* Sends one tweet at a time to the API\n* Sleeps for 1 second between requests due to API rate-limit\n* Appends results to perspective_processed_tweets.csv af...
[ [ "pandas.DataFrame" ] ]
leaiannotti/jesse
[ "564c54845774891ff3b5a8d3c02cc7cea890ac54" ]
[ "jesse/indicators/pfe.py" ]
[ "from typing import Union\n\nimport numpy as np\nimport talib\n\nfrom jesse.helpers import get_candle_source, slice_candles, same_length\n\n\ndef pfe(candles: np.ndarray, period: int = 10, smoothing: int = 5, source_type: str = \"close\", sequential: bool = False) -> Union[\n float, np.ndarray]:\n \"\"\"\n ...
[ [ "numpy.diff", "numpy.power" ] ]
AsmaBRZ/rcrs-server
[ "d67a84a17b73dd95c5553bed68b8c4c08cd5651a" ]
[ "modules/sample/src/sample/CSV/pf.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport os\ntime=np.arange(1,301)\narray=np.zeros(250)\na=[]\n\nfichiers=os.listdir(\"d\")\n\nfor f in fichiers:\n print(f)\n i=0\n with open(\"d/\"+f, \"r\") as ins:\n for line in ins:\n if i<300:\n print(line)\n ...
[ [ "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.suptitle", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
claydodo/tinkt
[ "dfd07fe7cad34c0d5a1ec0e03a6437a502410918" ]
[ "tinkt/cmap_utils.py" ]
[ "# -*- coding:utf-8 -*-\n\n# cmap utils\n\nimport six\n\nimport numpy as np\nfrom matplotlib import cm as mpl_cm\nfrom matplotlib import colors as mpl_colors\nfrom . import cm as tinkt_cm\n\n\nCM_FAMILIES = {\n 'mpl': mpl_cm,\n 'tinkt': tinkt_cm\n}\n\n\ndef set_under_over_bad_colors(cmap, under=None, over=Non...
[ [ "numpy.linspace" ] ]
idf/FaceReader
[ "d649bf7ca7f9cf66ac99e81a5187cfcc2b54f49d" ]
[ "facerec_py/facerec/svm.py" ]
[ "from facerec_py.facerec.classifier import SVM\nfrom facerec_py.facerec.validation import KFoldCrossValidation\nfrom facerec_py.facerec.model import PredictableModel\nfrom svmutil import *\nfrom itertools import product\nimport numpy as np\nimport logging\n\n\ndef range_f(begin, end, step):\n seq = []\n while...
[ [ "numpy.finfo" ] ]
andrewyguo/privacy
[ "a33afde0c105ece6c48b17a80f13899cf3e7c1b3", "a33afde0c105ece6c48b17a80f13899cf3e7c1b3" ]
[ "tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/keras_evaluation_test.py", "tensorflow_privacy/privacy/estimators/binary_class_head_test.py" ]
[ "# Copyright 2020, The TensorFlow 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 applicable ...
[ [ "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.layers.Dense", "numpy.random.rand", "numpy.random.randint" ], [ "tensorflow.executing_eagerly", "tensorflow.estimator.Estimator", "tensorflow.test.main", "numpy.full", "tensorflow.nn.sigmoid_cross_en...
Jack407/TFCNs_source_code
[ "f41466ad18457dd6335287112191e5daacf6d80d" ]
[ "train_utils.py" ]
[ "import argparse\nimport logging\nimport random\nimport sys\nimport time\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom tensorboardX import SummaryWriter\nfrom torch.nn.modules.loss import CrossEntropyLoss\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\n...
[ [ "torch.softmax", "torch.mean", "torch.nn.DataParallel", "torch.utils.data.DataLoader" ] ]
G-Simeone/Learning_Accident_Occurence_on_Dutch_Highways
[ "1f3992a529fed70fd488811d68128a1e255fac5f" ]
[ "src/create_experiment.py" ]
[ "import sys\nfrom utils import write_exp_utils\nimport pandas as pd\nfrom utils import misc_utils\nimport psycopg2\nfrom psycopg2.extras import Json, DictCursor\n\ndef main(argv):\n print(argv[1])\n w = write_exp_utils.ExperimentConfig(argv[1], argv[2])\n print(\"writing {} to database\".format(argv[1]) )\...
[ [ "pandas.read_sql" ] ]
melodist/MELTNET
[ "47548e4a027ea4e23cdcb5ba1f1d9aa1aa7bbf29" ]
[ "Analysis/SampleVisualization_AE.py" ]
[ "\"\"\"\n Sample Visualization\n Make 2-D image of sample distribution\n 1-1. Extract Features using initial network\n 1-2. Extract Features using trained network\n 2. Using K-means to classify the patches\n 3. Dimension reduction using PCA\n 4. Visualize results\n\"\"\"\n\nimport tensorflow as...
[ [ "numpy.hstack", "tensorflow.enable_eager_execution", "sklearn.cluster.KMeans", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "sklearn.decomposition.PCA" ] ]
francois-rozet/spiq
[ "a2e68c38da9129c85867e77641ed29d88e84c9d7" ]
[ "piqa/fsim.py" ]
[ "r\"\"\"Feature Similarity (FSIM)\n\nThis module implements the FSIM in PyTorch.\n\nOriginal:\n https://www4.comp.polyu.edu.hk/~cslzhang/IQA/FSIM/FSIM.htm\n\nReferences:\n .. [Zhang2011] FSIM: A Feature Similarity Index for Image Quality Assessment (Zhang et al., 2011)\n\n .. [Kovesi1999] Image Features Fr...
[ [ "torch.cos", "torch.view_as_real", "torch.max", "torch.sin", "torch.fft.fft2", "torch.zeros", "torch.nn.functional.avg_pool2d", "torch.zeros_like", "torch.fft.ifft2", "torch.exp", "torch.arange", "torch.stack", "torch.atan2" ] ]
ludysama/crp
[ "08027b67f174426ddac5eef8186349e8337481fc" ]
[ "solo/methods/nnsiam.py" ]
[ "# Copyright 2021 solo-learn development team.\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights to use,\n# copy, modify,...
[ [ "torch.nn.functional.normalize", "torch.nn.BatchNorm1d", "torch.ones", "torch.zeros", "torch.randn", "torch.nn.Linear", "torch.no_grad", "torch.nn.ReLU" ] ]
Pabsm94/Easyplume
[ "ee54194c1c0930b2a0ef442c47f80bd4570913d2" ]
[ "src/HYPERPLUME/hyperplume.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Apr 22 14:07:39 2016\n\n@author: pablo\n\"\"\"\n\nimport numpy as np \n\nimport abc\n\nimport matplotlib.pyplot as plt \n\nclass Hyperplume():\n \n \"\"\" Parent class Hyperplume loads target plasma and defines common attributes as well as\n shared methods i...
[ [ "numpy.log", "matplotlib.pyplot.clabel", "matplotlib.pyplot.title", "numpy.linspace", "numpy.gradient", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "numpy.exp", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.figu...
HaydenFaulkner/VidDet
[ "2dbc104a41bf1192a00ffde07695180eab18cea8" ]
[ "models/definitions/flownet/inference.py" ]
[ "import cv2\nimport mxnet as mx\nimport numpy as np\nfrom scipy.misc import imresize\nfrom tqdm import tqdm\n\nfrom flownet import get_flownet\nfrom utils import flow_to_image, crop, normalise\n\ndef process_two_images(model, imgs, ctx=None):\n \"\"\"\n Process two images into one flow image\n Args:\n ...
[ [ "scipy.misc.imresize", "numpy.array", "numpy.moveaxis" ] ]
tolgadur/Sensor-Placement
[ "ad33477d1fb14052e1a9e58d149d0b8e767ea318" ]
[ "src/sensor_placement.py" ]
[ "#!/usr/bin/python\nimport numpy as np\nimport heapq\nimport pandas as pd\n\n\"\"\" FILE NAME: 'sensor_placement.py'\n DESCRIPTION: This file is implementing the class that will be used for sensor\n positioning according to solution proposed by Krause, Singh and Guestrin (2008).\n\"\"\"\n\nclass SensorPlaceme...
[ [ "numpy.log", "numpy.ix_", "numpy.setdiff1d", "numpy.append", "numpy.argmax", "numpy.array" ] ]
tobon/nibabel
[ "ff2b5457207bb5fd6097b08f7f11123dc660fda7", "ff2b5457207bb5fd6097b08f7f11123dc660fda7" ]
[ "nibabel/minc2.py", "nibabel/tests/test_image_load_save.py" ]
[ "# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n#\n# See COPYING file distributed along with the NiBabel package for the\n# copyright and license terms.\n#\n#...
[ [ "numpy.asarray", "numpy.iinfo" ], [ "numpy.diag", "numpy.arange", "numpy.eye", "numpy.testing.assert_array_equal", "numpy.prod" ] ]
Jarvis73/DINs
[ "fe967115182a47b9ad1018658cd1be745831e7aa" ]
[ "data_kits/nf_kits.py" ]
[ "# Copyright 2019-2020 Jianwei Zhang All Right 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 b...
[ [ "pandas.read_csv", "numpy.abs", "numpy.clip", "numpy.unique", "scipy.ndimage.generate_binary_structure", "numpy.stack", "scipy.ndimage.label", "numpy.bincount", "scipy.ndimage.find_objects", "numpy.transpose", "numpy.array", "numpy.flip", "numpy.where" ] ]
SStroteich/stella-1
[ "104556a07b9736e7c28e6f1bf2f799384732f38b" ]
[ "stellapy/stellapy_old/stella_read.py" ]
[ "import numpy as np\nfrom stella_dirs import *\nfrom scipy.io import netcdf\n#plt.rcParams.update({'font.size': 28})\n#plt.rcParams['lines.linewidth'] = 2\nimport tabCompleter\nfrom tabCompleter import *\nfrom plotbox import *\nfrom aux_functions import *\nfrom os import listdir\nfrom netCDF4 import *\nimport glob ...
[ [ "numpy.concatenate", "numpy.arange", "numpy.copy" ] ]
RaphaelOlivier/deepspeech.pytorch
[ "eb73ef61807ab01fad3662ad03dfea8fd44439aa" ]
[ "deepspeech_pytorch/validation.py" ]
[ "from abc import ABC, abstractmethod\n\nimport torch\nfrom torch.cuda.amp import autocast\nfrom tqdm import tqdm\n\nfrom deepspeech_pytorch.decoder import Decoder, GreedyDecoder\n\nfrom pytorch_lightning.metrics import Metric\nimport Levenshtein as Lev\n\n\nclass ErrorRate(Metric, ABC):\n def __init__(self,\n ...
[ [ "torch.tensor", "torch.no_grad", "torch.cuda.amp.autocast" ] ]
tsarjak/gsoc_code_library
[ "961cea8e0833d28e5c78e7dd06f7c3823b38cbfb" ]
[ "rgbContrast.py" ]
[ "import cv2\nfrom PIL import Image\nimport numpy as np\n\n\n\ndef arrayToImage(img,sizeX,sizeY,saveAs):\n rgbArray = np.zeros((sizeX,sizeY,3),'uint8')\n for i in range(0,sizeX):\n for j in range(0,sizeY):\n for k in range(0,3):\n rgbArray[i,j,k] = img[i,j,k] * 255\n img = I...
[ [ "numpy.zeros" ] ]
ffletcherr/FaceLib
[ "fc1b8496f90ba2c6a76bfb8a59e2e2af7a439a63" ]
[ "facelib/InsightFace/models/data/data_pipe.py" ]
[ "from torch.utils.data import Dataset, ConcatDataset, DataLoader\nfrom torchvision import transforms as trans\nfrom torchvision.datasets import ImageFolder\nfrom PIL import ImageFile\n\nImageFile.LOAD_TRUNCATED_IMAGES = True\nimport numpy as np\n\n\ndef de_preprocess(tensor):\n return tensor * 0.5 + 0.5\n\n\ndef...
[ [ "torch.utils.data.ConcatDataset", "torch.utils.data.DataLoader" ] ]
vnechaev/QGOpt
[ "697f02d89df67a576cd6953ffdd2db62970727da" ]
[ "examples/MERAOpt.py" ]
[ "import QGOpt.manifolds as m\nfrom tensorflow.python.keras.optimizer_v2 import optimizer_v2 as opt\nimport tensorflow as tf\n\n\ndef adj(A):\n \"\"\"Correct adjoint\n Args:\n A: tf.tensor of shape (..., n, m)\n Returns:\n tf tensor of shape (..., m, n), adjoint matrix\"\"\"\n\n return tf.m...
[ [ "tensorflow.linalg.matrix_transpose" ] ]
xzry6/openvino_training_extensions
[ "05cb9b30e8220445fcb27988926d88f330091c12" ]
[ "pytorch_toolkit/face_recognition/dump_features.py" ]
[ "\"\"\"\n Copyright (c) 2018 Intel Corporation\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agr...
[ [ "torch.utils.data.DataLoader", "numpy.linalg.norm", "torch.no_grad", "torch.cuda.device", "numpy.random.uniform", "torch.nn.DataParallel", "numpy.zeros" ] ]
zchen088/Cirq
[ "8cf782554adbafed724987de3067de7ca565fa0c" ]
[ "cirq/sim/simulator.py" ]
[ "# Copyright 2018 The Cirq 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "numpy.max", "numpy.array", "numpy.empty" ] ]
xdralex/pioneer
[ "1fb9ea947d1b1cc2eb1f27bc4e8a7f206019b607", "1fb9ea947d1b1cc2eb1f27bc4e8a7f206019b607" ]
[ "pioneer/temp/mujoco_test.py", "pioneer/launch/pioneer_knm_train.py" ]
[ "import mujoco_py\nimport numpy as np\nfrom gym import spaces\n\nmodel = mujoco_py.load_model_from_path('pioneer/envs/assets/pioneer2.xml')\nsim = mujoco_py.MjSim(model)\n\nprint(f'timestep: {model.opt.timestep}')\n\nbounds = model.jnt_range.copy().astype(np.float32)\nlow, high = bounds.T\nposition_space = spaces.B...
[ [ "numpy.array" ], [ "numpy.random.uniform", "numpy.log" ] ]
Zac-hills/d3m-primitives
[ "1829fc98042dddfcbee3cfbbb8cb75dd452f1e8d" ]
[ "kf_d3m_primitives/natural_language_processing/sent2vec/sent2vec.py" ]
[ "import os.path\nfrom typing import Sequence, Optional, Dict\n\nimport numpy as np\nimport pandas as pd\nfrom nk_sent2vec import Sent2Vec as _Sent2Vec\nfrom d3m import container, utils\nfrom d3m.primitive_interfaces.transformer import TransformerPrimitiveBase\nfrom d3m.primitive_interfaces.base import CallResult\nf...
[ [ "numpy.array" ] ]
YannickWehr/trax
[ "67dda3b236339a7f6de803a3f84a9e92d0f0442c" ]
[ "trax/rl/actor_critic.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Trax 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 app...
[ [ "numpy.arange", "tensorflow.io.gfile.isdir", "numpy.array", "tensorflow.io.gfile.makedirs" ] ]
brandongk-ubco/autoalbument
[ "1735ea4376694c2179ac62ce7d100a10b26f2558", "1735ea4376694c2179ac62ce7d100a10b26f2558" ]
[ "tests/test_albumentations_pytorch.py", "autoalbument/faster_autoaugment/models/faa_model.py" ]
[ "import albumentations.augmentations.functional as F\nimport pytest\nimport torch\nfrom torch.autograd import gradcheck\n\nimport autoalbument.albumentations_pytorch.functional as PF\nfrom tests.utils import assert_batches_match\n\n\nclass Base:\n def scalar_to_tensor(self, arg, requires_grad=False, dtype=torch....
[ [ "torch.autograd.gradcheck", "torch.tensor" ], [ "torch.nn.functional.binary_cross_entropy_with_logits", "torch.nn.functional.cross_entropy", "torch.tensor", "torch.no_grad", "torch.ones_like" ] ]
2dx/moderngl
[ "5f932560a535469626d79d22e4205f400e18f328", "5f932560a535469626d79d22e4205f400e18f328" ]
[ "examples/basic_simple_color_triangle.py", "examples/heightmap_on_the_fly.py" ]
[ "'''\n Renders a traingle that has all RGB combinations\n'''\n\nimport numpy as np\n\nfrom ported._example import Example\n\n\nclass SimpleColorTriangle(Example):\n gl_version = (3, 3)\n aspect_ratio = 16 / 9\n title = \"Simple Color Triangle\"\n\n def __init__(self, **kwargs):\n super().__ini...
[ [ "numpy.array" ], [ "numpy.cos", "numpy.sin" ] ]
zegra1989/ml
[ "ed574ff45d4852d0c93f1ad5d7e0160cd752c9e0" ]
[ "src/native_bayes/classify.py" ]
[ "def NBAccuracy(features_train, labels_train, features_test, labels_test):\n \"\"\" compute the accuracy of your Naive Bayes classifier \"\"\"\n ### import the sklearn module for GaussianNB\n from sklearn.naive_bayes import GaussianNB\n from sklearn.metrics import accuracy_score\n\n ### create classi...
[ [ "sklearn.naive_bayes.GaussianNB", "sklearn.metrics.accuracy_score" ] ]
coco-in-bluemoon/building-recommendation-engines
[ "b337b2ba75b6c9b08612ab1720a2858e64e9de09" ]
[ "chapter03/python/item_cf.py" ]
[ "import numpy as np\nimport pandas as pd\n\n\n# 1. load dataset\nratings = pd.read_csv('chapter02/data/movie_rating.csv')\n\nmovie_ratings = pd.pivot_table(\n ratings,\n values='rating',\n index='title',\n columns='critic'\n)\n\n\n# 2. calculate similarity\ndef calcualte_norm(u):\n norm_u = 0.0\n ...
[ [ "pandas.merge", "pandas.read_csv", "numpy.sqrt", "numpy.isnan", "pandas.DataFrame", "pandas.isna", "pandas.pivot_table" ] ]
The-Makers-of-things/jesse
[ "df061ea21011a3c28f3359f421ec5594216fb708" ]
[ "jesse/indicators/rocp.py" ]
[ "from typing import Union\n\nimport numpy as np\nimport talib\n\nfrom jesse.helpers import get_candle_source\n\n\ndef rocp(candles: np.ndarray, period: int = 10, source_type: str = \"close\", sequential: bool = False) -> Union[\n float, np.ndarray]:\n \"\"\"\n ROCP - Rate of change Percentage: (price-prevP...
[ [ "numpy.isnan" ] ]
tikhonovpavel/LdaSummarization
[ "fbfb229e83548d9dd8f921626fd3fbf423b0305a" ]
[ "src/models/data_loader.py" ]
[ "import bisect\nimport gc\nimport glob\nimport pickle\nimport random\n\nimport torch\n\nfrom others.logging import logger\n\nimport gensim\nfrom gensim.utils import simple_preprocess\nfrom gensim.parsing.preprocessing import STOPWORDS\nfrom nltk.stem import WordNetLemmatizer, SnowballStemmer\nfrom nltk.stem.porter ...
[ [ "numpy.random.seed", "torch.load" ] ]
TeaKatz/Generative_Deep_Learning
[ "f62b9150a5e18240dd22816918f2ce6abf807d58" ]
[ "Original_Codes/GDL_code-master/models/WGANGP.py" ]
[ "\nfrom keras.layers import Input, Conv2D, Flatten, Dense, Conv2DTranspose, Reshape, Lambda, Activation, BatchNormalization, LeakyReLU, Dropout, ZeroPadding2D, UpSampling2D\nfrom keras.layers.merge import _Merge\n\nfrom keras.models import Model, Sequential\nfrom keras import backend as K\nfrom keras.optimizers imp...
[ [ "numpy.clip", "numpy.squeeze", "matplotlib.pyplot.subplots", "numpy.ones", "numpy.random.normal", "matplotlib.pyplot.close", "numpy.prod", "numpy.zeros", "numpy.random.randint" ] ]
DNALuo/3Dposes
[ "c5e2ed5fea612318d7715e239176571f593ccf83" ]
[ "src/models/hg_3d.py" ]
[ "from .layers.Residual import Residual\r\nimport torch.nn as nn\r\nimport math\r\nimport ref\r\n\r\nclass Hourglass(nn.Module):\r\n def __init__(self, n, nModules, nFeats):\r\n super(Hourglass, self).__init__()\r\n self.n = n\r\n self.nModules = nModules\r\n self.nFeats = nFeats\r\n \r\n _up1_, _...
[ [ "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.Upsample", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
csdms/ivy
[ "862fc8bafa665864ceae25c4ead9e376ffe175cb" ]
[ "lessons/best-practices/boulder_dem.py" ]
[ "\"\"\"An example of reading topographical data from a file and displaying it.\"\"\"\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\ntopo_file = \"../../data/topo.asc\"\n\n\ndef read():\n try:\n topo = pd.read_csv(topo_file, header=None)\n except IOError:\n print(\"IOError: file '{}...
[ [ "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.show" ] ]