repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
caudaz/RoboND-Perception-Project
[ "f676c0613331d5ac53986e0dfeea002cf320a89a" ]
[ "sensor_stick/scripts/capture_features.py" ]
[ "#!/usr/bin/env python\nimport numpy as np\nimport pickle\nimport rospy\n\nfrom sensor_stick.pcl_helper import *\nfrom sensor_stick.training_helper import spawn_model\nfrom sensor_stick.training_helper import delete_model\nfrom sensor_stick.training_helper import initial_setup\nfrom sensor_stick.training_helper imp...
[ [ "numpy.concatenate" ] ]
anatoliy-kuznetsov/ExtractionScore
[ "f98721eba382abac379351a03dd5ab96b0fd537b" ]
[ "draw.py" ]
[ "import rdkit.Chem as Chem\nimport rdkit.Chem.AllChem as AllChem\nimport rdkit.Chem.Draw as Draw\nfrom PIL import Image, ImageOps\nfrom collections import defaultdict\n# from rdkit.Chem.Draw.cairoCanvas import Canvas\nimport os\nimport numpy as np\nimport re\n'''\nMany of these functions are taken from RDKit.\n'''\...
[ [ "numpy.array", "numpy.sum", "numpy.nonzero" ] ]
BenjSta/spaudiopy
[ "c54dd32386812084926bb9e284650efc0f38d7d9" ]
[ "examples/SH.py" ]
[ "# ---\n# jupyter:\n# jupytext:\n# comment_magics: 'false'\n# formats: ipynb,py:percent\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.1'\n# jupytext_version: 0.8.4\n# kernelspec:\n# display_name: Python 3\n# language: python\n...
[ [ "numpy.sqrt", "numpy.eye", "numpy.ones", "numpy.array", "matplotlib.pyplot.show" ] ]
goyalrinki/ivy
[ "0aa999073709e1d9f4471b9adc7f528a2488041b" ]
[ "ivy/functional/backends/torch/core/linear_algebra.py" ]
[ "\"\"\"\nCollection of PyTorch linear algebra functions, wrapped to fit Ivy syntax and signature.\n\"\"\"\n\n# global\nimport torch as _torch\nfrom typing import List\nimport ivy as _ivy\nfrom typing import Union, Tuple\n\n\n\n\ndef matrix_norm(x, p=2, axes=None, keepdims=False):\n axes = [-2, -1] if axes is Non...
[ [ "torch.linalg.cholesky", "torch.zeros", "torch.cat", "torch.pinverse", "torch.unsqueeze", "torch.inverse", "torch.linalg.matrix_norm" ] ]
berndverst/Hackathon-CaptureImageForFaceDetection
[ "723ead3cd86ae527c27b645ccb36023645e51d7f" ]
[ "app.py" ]
[ "import os, io, base64\nfrom flask import Flask, render_template, request, jsonify\n\nimport cv2\nimport tensorflow as tf\nfrom PIL import Image\nimport numpy as np\n\n# Load the TensorFlow model exported from Azure Cognitive Services Custom Vision\n\nCWD = os.getcwd()\n\nMODELFILE = CWD + '/model/model.pb'\nLABELF...
[ [ "numpy.expand_dims", "tensorflow.compat.v1.import_graph_def", "tensorflow.compat.v1.gfile.FastGFile", "tensorflow.compat.v1.Session", "numpy.argmax", "tensorflow.compat.v1.gfile.GFile", "tensorflow.compat.v1.GraphDef", "numpy.array", "tensorflow.compat.v1.reset_default_graph", ...
XWan2021/yaglm
[ "a0454427a04dc6be37a15d7031e0d77dbb21538e" ]
[ "yaglm/infer/Inferencer.py" ]
[ "from numbers import Number\nfrom pandas.core.dtypes.inference import is_array_like\nfrom copy import deepcopy\nimport numpy as np\n\nfrom yaglm.config.base import Config\nfrom yaglm.autoassign import autoassign\nfrom yaglm.config.penalty import Lasso\nfrom yaglm.infer.dof import est_dof_support\nfrom yaglm.utils i...
[ [ "numpy.array", "pandas.core.dtypes.inference.is_array_like" ] ]
prbronze/Kaggle
[ "aeba51432df18aae5ba521343f584b8b98db3955" ]
[ "toxic_comment_challenge/src/visualize/plot_learning_curve.py" ]
[ "from sklearn.model_selection import learning_curve\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef plot_curve(estimator, X, yt):\n \"\"\"Plot learning curves for each label of a multilabel problem.\n \n Parameters:\n -----------\n estimator : sklearn-type classifier\n Estimator us...
[ [ "numpy.linspace", "matplotlib.pyplot.subplots", "numpy.std", "numpy.mean", "matplotlib.pyplot.show" ] ]
Maercoli/sqlalchemy-challenge
[ "a07878815c02d4ccb1a55aa5fcb2dd982bebb324" ]
[ "app.py" ]
[ "#Import dependecies\nfrom flask import Flask, jsonify\nimport datetime as dt\n\nimport sqlalchemy\nimport pandas as pd\nimport numpy as np\nfrom sqlalchemy.ext.automap import automap_base\nfrom sqlalchemy.orm import Session\nfrom sqlalchemy import create_engine, func, asc\nfrom sqlalchemy import inspect\n\n#SQLAlc...
[ [ "pandas.DataFrame" ] ]
EloDoyard/sentiment-evolution-in-characters-network
[ "94a2b0e9d9c95989c9d07b8f9ad9a0019677a70e" ]
[ "src/evaluation_metrics.py" ]
[ "import sklearn\nfrom sklearn.cluster import KMeans\nfrom sklearn.decomposition import PCA\nfrom sklearn.model_selection import train_test_split\nimport numpy as np\nimport pandas as pd\n\n\nground_truth_data_df = pd.DataFrame([ \n('agde', 'Monsieur Agde',13,'M',36930), \n('altamira','Comte Altamira',26,'M',97835),...
[ [ "sklearn.cluster.KMeans", "sklearn.metrics.mutual_info_score", "sklearn.metrics.adjusted_mutual_info_score", "pandas.DataFrame", "sklearn.metrics.rand_score", "sklearn.metrics.adjusted_rand_score", "numpy.array" ] ]
K-H-Ismail/ConvNeXt
[ "664c758d0616aa9499c5878e1a0eaf7c5000ac61" ]
[ "engine.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and affiliates.\n\n# All rights reserved.\n\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\n\nimport math\nfrom typing import Iterable, Optional\nimport torch\nfrom timm.data import Mixup\nfrom timm.ut...
[ [ "torch.nn.CrossEntropyLoss", "torch.cuda.synchronize", "torch.zeros_like", "torch.cuda.amp.autocast", "torch.cdist", "torch.no_grad", "torch.clamp_min" ] ]
irglbriz/goban_to_sgf
[ "bea415bc897ed901de7bffb154fea288da04699e" ]
[ "src/warp.py" ]
[ "\"\"\"Warps image to square top-down view given corner coordinates\nExpects grayscale image and corners in shape(4,2))\"\"\"\n\nimport numpy as np\nimport cv2\n\nTARGET_RES = 380 # 19x20 - goban is 19x19, patches will be 20x20\n\ndef sort_corners(corners):\n rect = np.zeros((4, 2), dtype=\"float32\")\n # the...
[ [ "numpy.argmax", "numpy.argmin", "numpy.diff", "numpy.float32", "numpy.zeros", "numpy.sum" ] ]
NathanKlineInstitute/OEvent
[ "51cc9b4dab7e96160a31b9b451cf9c32bd014271" ]
[ "cyc.py" ]
[ "# Most of the code in cyc.py is based on Cole & Voytek's \"Cycle-by-cycle analysis of neural oscillations\"\n# implementation by Sam Neymotin (samuel.neymotin@nki.rfmh.org)\nimport scipy.signal as sps\nfrom evstats import getCV2\nfrom numpy import diff\nimport numpy as np\nfrom pylab import *\nfrom collections imp...
[ [ "numpy.array", "scipy.signal.find_peaks", "numpy.diff" ] ]
wood-b/dihedral_model
[ "37b7b1648ff2c36f6319401aa50b8400183312f6" ]
[ "tests/test_utils.py" ]
[ "import numpy as np\n#import math\n#import json\nimport unittest\n\nfrom utils import utils\n\n__author__ = \"Brandon Wood\"\n\n\nclass TestUtilFunctions(unittest.TestCase):\n @staticmethod\n def test_uvec():\n pt1 = np.array([0.0, 0.0, 0.0])\n pt2 = np.array([1.0, 0.0, 0.0])\n uvec = np....
[ [ "numpy.testing.assert_array_equal", "numpy.testing.assert_almost_equal", "numpy.array" ] ]
AI-secure/Uncovering-the-Connections-BetweenAdversarial-Transferability-and-Knowledge-Transferability
[ "a2fb10f56618c6d6dd1638967d59c4a83ffa1c05" ]
[ "image_exp/adv2know.py" ]
[ "import argparse\nimport os\nfrom datetime import datetime\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nfrom torch.optim.lr_scheduler import CosineAnnealingLR\nimport torchvision.datasets as datasets\nimport torchvision.transforms as transforms\nfrom subloader import CIFA...
[ [ "torch.nn.CrossEntropyLoss", "torch.norm", "torch.load", "torch.utils.data.DataLoader", "numpy.linalg.norm", "torch.cuda.is_available", "numpy.outer", "numpy.array" ] ]
uwaa-ndcl/ACC_2019_Avant
[ "d03e3715a030e52135baa9bf4e6a4d7a8b2c0881" ]
[ "pose_estimation/gramian/trajectories.py" ]
[ "import os\nimport math\nimport pickle\nimport numpy as np\nimport transforms3d as t3d\n\nimport pose_estimation.directories as dirs\nimport pose_estimation.tools.math as tm\nimport pose_estimation.blender.render as br\nimport pose_estimation.gramian.functions as gf\nfrom pose_estimation.blender.render_properties i...
[ [ "numpy.expand_dims", "numpy.savez", "numpy.linspace", "numpy.meshgrid", "numpy.reshape", "numpy.tile", "numpy.stack", "numpy.full", "numpy.argmax", "numpy.argmin", "numpy.load", "numpy.array" ] ]
leewujung/echopype-lfs-test
[ "b76dcf42631d0ac9cef0efeced9be4afdc15e659" ]
[ "echopype/convert/utils/set_groups_base.py" ]
[ "from __future__ import absolute_import, division, print_function\nimport os\nimport numpy as np\nimport netCDF4\nimport zarr\nimport xarray as xr\n\n\nclass SetGroupsBase:\n \"\"\"Base class for setting groups in netCDF file.\n \"\"\"\n\n def __init__(self, file_path='test.nc', compress=True):\n se...
[ [ "numpy.timedelta64", "numpy.datetime64" ] ]
irmaps/easy-few-shot-learning
[ "afb315589c42ea9380f908380b46b5cb3a200dad" ]
[ "easyfsl/methods/relation_networks.py" ]
[ "\"\"\"\nSee original implementation at\nhttps://github.com/floodsung/LearningToCompare_FSL\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom easyfsl.methods import AbstractMetaLearner\nfrom easyfsl.utils import compute_prototypes\n\n\nclass RelationNetworks(AbstractMetaLearner):\n \"\"\"\n Sung, Flood, Yo...
[ [ "torch.nn.AdaptiveMaxPool2d", "torch.nn.Conv2d", "torch.nn.Flatten", "torch.nn.Sigmoid", "torch.nn.Linear", "torch.nn.BatchNorm2d", "torch.nn.functional.one_hot", "torch.nn.ReLU", "torch.nn.MSELoss" ] ]
xaviercucurull/FACIL
[ "41cb16211b2c086e6970500b6de5da5807495081" ]
[ "src/main_incremental.py" ]
[ "import os\nimport time\nimport torch\nimport argparse\nimport importlib\nimport numpy as np\nfrom functools import reduce\nimport pathlib\n\nimport utils\nimport approach\nfrom loggers.exp_logger import MultiLogger\nfrom datasets.data_loader import get_loaders\nfrom datasets.dataset_config import dataset_config\nf...
[ [ "torch.cuda.set_device", "numpy.ones", "torch.cuda.is_available", "numpy.repeat", "numpy.zeros" ] ]
garrettkatz/poppy-muffin
[ "43ac00e6a151346ca7df005c009fcb762f16bd35" ]
[ "pybullet/tasks/pick_and_place/eager_rl.py" ]
[ "import pickle as pk\nimport numpy as np\nimport torch as tr\nimport sys, time\nsys.path.append('../../envs')\nfrom blocks_world import BlocksWorldEnv, MovementPenaltyTracker\nfrom abstract_machine import make_abstract_machine, memorize_problem\nfrom nvm import virtualize\nimport neural_virtual_machine as nv\nimpor...
[ [ "torch.zeros", "torch.set_printoptions", "torch.sum", "torch.tensor", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.subplot", "torch.no_grad", "numpy.random.rand", "torch.stack", "torch.distributions.normal.Normal", "matplotlib.pyplot.show",...
harshal306/radiometric_normalization
[ "5c3970a01954dfcb19938312b0f64b811f36deff" ]
[ "radiometric_normalization/wrappers/display_wrapper.py" ]
[ "'''\nCopyright 2015 Planet Labs, Inc.\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...
[ [ "numpy.logical_and", "numpy.nonzero" ] ]
r1cc4rdo/marble_solitaire
[ "1b465a232bdd81a3c0c9f9cd29c83bc7367d25f6" ]
[ "search.py" ]
[ "import numpy as np\n\nfrom board_io import load_board\n\npowers_of_2 = None # used as bit masks for each bit in the board representation\nboard_template = None # see board_io. -1 on unused grid elements, 0 empty, 1 filled with marble/peg\nmove_bit_masks = None # has 1s on the corresponding move representation b...
[ [ "numpy.power", "numpy.fliplr", "numpy.argwhere", "numpy.copy", "numpy.sum" ] ]
RounakPython/reconcile-a-report-using-pandas
[ "b3308236cb7057dfb6b78adc8192b2f221899890" ]
[ "code.py" ]
[ "# --------------\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt \r\n\r\ndf = pd.read_csv(path)\r\n\r\ndf['state'] = df['state'].apply(lambda x:x.lower())\r\ndf['total'] = df['Jan'] + df['Feb'] + df['Mar']\r\n\r\nsum_row = df[['Jan', 'Feb', 'Mar', 'total']].sum()\r\nprint(sum_row)\r\n...
[ [ "pandas.read_csv", "pandas.read_html", "pandas.DataFrame" ] ]
priyald17/emissions-assumptions
[ "3159182b84deaaa086af56c13a08dae6a510c0ac" ]
[ "data/date_helpers.py" ]
[ "#/usr/bin/env python3\n\n###############################################################################\n# Helper functions for managing dates and time zones.\n###############################################################################\n\nimport pandas as pd\nfrom datetime import datetime, timedelta\nimport p...
[ [ "numpy.floor", "pandas.DataFrame" ] ]
Tord-Zhang/DPT
[ "0fa1b6e65ce449c6576eca46492f4b84245e2022" ]
[ "hubconf.py" ]
[ "dependencies = [\"torch\"]\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport cv2\nimport util.io\nfrom torchvision.transforms import Compose\nfrom dpt.models import DPTDepthModel\nfrom dpt.transforms import Resize, NormalizeImage, PrepareForNet\n\ndef DPT(pretrained=True, model_type=\"dpt_hybrid\"...
[ [ "torch.device" ] ]
egracheva/SMILES-X
[ "e2ec7b070b491ed9eb204685b790219da6c46377" ]
[ "SMILESX/inference.py" ]
[ "import numpy as np\nimport pandas as pd\nimport os\n\nfrom rdkit import Chem\n\nfrom keras.models import load_model\nfrom keras import backend as K\nfrom keras import metrics\nimport tensorflow as tf\n\nfrom SMILESX import utils, model, token, augm\n\n##\nconfig = tf.ConfigProto()\nconfig.gpu_options.allow_growth ...
[ [ "numpy.random.seed", "pandas.DataFrame", "tensorflow.ConfigProto", "numpy.std", "numpy.mean", "tensorflow.Session", "numpy.array" ] ]
MimansaSharma15/Animo
[ "351edbbaeb6f8bc529602a888fb39e9d2bee010d" ]
[ "src/main.py" ]
[ "import torch \nfrom torch import nn as nn \nfrom torch.nn import functional as f \nfrom data import main_data\nfrom torch.utils.data import DataLoader\nfrom models import Encoder, Decoder\nimport random\nimport time \nfrom tqdm import tqdm\nfrom models import Seq2Seq, Encoder, Decoder\nfrom torch.utils.tensorboard...
[ [ "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader", "torch.utils.tensorboard.SummaryWriter", "torch.save" ] ]
AWilcke/Dissertation
[ "b85ad38a7f336ee290d5883f5e942f54e140d0d0" ]
[ "src/svmreg/dataloader.py" ]
[ "import os\nimport torch\nfrom torch.utils.data import Dataset\nfrom torchvision import transforms\nfrom PIL import Image\nimport scipy.io as sio\nimport pickle\nfrom pathlib import Path\nimport numpy as np\n\nclass BasicDataset(Dataset):\n\n def __init__(self, labels_file, root_dir):\n \"\"\"\n Ar...
[ [ "numpy.where", "torch.cat", "torch.from_numpy", "numpy.random.choice" ] ]
Meng-Xiang-Rui/qusource
[ "44aad9fa6c3477d145e2bdd76edbbe79eec10267" ]
[ "qusource/qusource.py" ]
[ "import numpy as np\nfrom scipy.linalg import expm\nimport matplotlib.pyplot as plt\nimport scipy.stats as stats\nfrom scipy.stats import bernoulli\nimport random\n\ntrans_mat = np.zeros((4, 10))\ntrans_mat[0, 1] = trans_mat[1, 3] = trans_mat[2, 4] = trans_mat[3, 8] = 1\n\n\ndef int2bin(n, count=24):\n return \"...
[ [ "numpy.dot", "numpy.sqrt", "numpy.kron", "scipy.stats.bernoulli.rvs", "numpy.arange", "numpy.eye", "matplotlib.pyplot.text", "numpy.zeros", "numpy.log", "matplotlib.pyplot.ylim", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.abs...
forman/dectree
[ "5895967d3a91ce4d76806417689c66349fce2a85" ]
[ "examples/intertidal_flat_classif/verification_main.py" ]
[ "import time\n\nimport numpy as np\nimport pandas as pd\n#from intertidal_flat_classif import Input, Output, apply_rules\n#from intertidal_flat_classif_opt import Input, Output, apply_rules\nfrom intertidal_flat_classif_fuz import Input, Output, apply_rules\n\nINPUT_TXT = \"verification_input.txt\"\nEXPECTED_TXT = ...
[ [ "numpy.array", "pandas.read_csv" ] ]
abelcarreras/symgroup
[ "66233426d5457aa606e720794dd3a3679ef830e8" ]
[ "python/setup.py" ]
[ "from numpy.distutils.core import setup, Extension\nfrom distutils.dir_util import copy_tree\nfrom distutils.errors import DistutilsFileError\n\n#import shutil\n\n\ndef get_version_number():\n for l in open('symgroupy/__init__.py', 'r').readlines():\n if not(l.find('__version__')):\n exec(l, gl...
[ [ "numpy.distutils.core.Extension" ] ]
mcooper/tmtoolkit
[ "cdfbaf7f20095ea45edbdf9e773544e3bb63089d" ]
[ "tests/test_utils.py" ]
[ "import string\nimport random\n\nimport pytest\nimport hypothesis.strategies as st\nfrom hypothesis import given\nimport numpy as np\n\nfrom tmtoolkit.utils import (pickle_data, unpickle_file, require_listlike, require_dictlike, require_types,\n simplified_pos, apply_to_mat_column, flatt...
[ [ "numpy.arange", "numpy.max", "numpy.array", "numpy.min" ] ]
johndunne2019/pands-project
[ "4a544be7a4074dc8a277775981b3619239c45872" ]
[ "Histogram.py" ]
[ "# 2019-04-15\n# John Dunne\n# To create a histogram of the data using matplotlib.pyplot \n# Script adapted from example analysis read here: https://machinelearningmastery.com/machine-learning-in-python-step-by-step/\n\nprint(\"The Histogram will appear on your screen momentarily\")\n# printed sentence to the scree...
[ [ "pandas.read_csv", "matplotlib.pyplot.show" ] ]
propelwise/ct-net-models
[ "d25f0a43eac316766f80fa93177add3bc5130bd6" ]
[ "load_dataset/custom_datasets.py" ]
[ "#custom_datasets.py\n#Copyright (c) 2020 Rachel Lea Ballantyne Draelos\n\n#MIT License\n\n#Permission is hereby granted, free of charge, to any person obtaining a copy\n#of this software and associated documentation files (the \"Software\"), to deal\n#in the Software without restriction, including without limitati...
[ [ "pandas.read_csv", "torch.cuda.manual_seed", "numpy.random.seed", "torch.manual_seed", "torch.from_numpy", "torch.cuda.manual_seed_all", "numpy.array" ] ]
bencevans/CameraTraps
[ "7e86a3e48602510e412bcaccdc9259388e9863b5" ]
[ "api/batch_processing/postprocessing/find_repeat_detections.py" ]
[ "########\n#\n# find_repeat_detections.py\n#\n# Looks through a sequence of detections in the API output json file, and finds candidates\n# that might be \"repeated false positives\", i.e. that random branch that the detector\n# thinks is an animal.\n#\n# Writes out a new .json file where \"suspicious\" detections ...
[ [ "pandas.DataFrame" ] ]
shangtse/cleverhans
[ "c8e224dd6105aa8d664ed06f59b795f3609d3dcb" ]
[ "cleverhans/loss.py" ]
[ "\"\"\"Loss functions for training models.\"\"\"\nimport json\nimport os\nimport warnings\n\nimport tensorflow as tf\n\nfrom cleverhans.compat import softmax_cross_entropy_with_logits\nfrom cleverhans.model import Model\nfrom cleverhans.utils import safe_zip\n\n\nclass Loss(object):\n \"\"\"\n An abstract interfa...
[ [ "tensorflow.device", "tensorflow.reduce_mean", "tensorflow.shape", "tensorflow.maximum", "tensorflow.reshape", "tensorflow.cast", "tensorflow.nn.l2_loss", "tensorflow.square", "tensorflow.distributions.Beta", "tensorflow.add_n" ] ]
ezatterin/pySPM
[ "ae40bfb79678b3f10c85daadaa9cd5ce9e4e2e42" ]
[ "pySPM/ITA.py" ]
[ "# -- coding: utf-8 --\n\n# Copyright 2018 Olivier Scholder <o.scholder@gmail.com>\n\n\"\"\"\nThis module gives the ability to ready and parse the ToF-SIMS ITA files from iontof.\nYou can mainly retrieve images and spectra for each channel and scan.\n\"\"\"\nfrom __future__ import absolute_import\n\nimport numpy as...
[ [ "numpy.fft.fft2", "numpy.hstack", "numpy.sum", "numpy.sqrt", "numpy.linspace", "numpy.min", "numpy.flipud", "matplotlib.pyplot.subplots", "numpy.max", "numpy.argmax", "numpy.mean", "scipy.ndimage.filters.gaussian_filter", "matplotlib.colors.ListedColormap", ...
chuankaizhao/SAXS-guidedAdaptiveSampling
[ "348eebdc59641398d09538118618e6b0d04521d6" ]
[ "05-AdaptiveSampling/pickAdaptiveSeeds.py" ]
[ "### Given the SAXS discrepancy scores, pick the N states with the least SAXS discrepancy scores\n### for next round of adaptive sampling. Other information can be incorporated together with SAXS\n### to pick the seeding structures for adaptive sampling. \n### Required packages: numpy\n### Output: input files for C...
[ [ "numpy.loadtxt" ] ]
BigNerd/justmltools
[ "97133380f2675596fdd9c87d9bc570ccd5fc20b9" ]
[ "tests/nlp/test_word_embedder.py" ]
[ "import numpy as np\nimport os\nimport pathlib\nfrom unittest import TestCase\nfrom justmltools.nlp.word_embedder import WordEmbedder\n\n\nclass TestWordEmbedder(TestCase):\n\n \"\"\" sample_text consists of the 100 words contained in the embedding file,\n however, the three '/'-separated words, e.g. züri...
[ [ "numpy.count_nonzero", "numpy.unique" ] ]
sanilrod/Contactless-Attendence-System
[ "a0246047df139807dd636ca102b8151c456292ae" ]
[ "UI/app/views.py" ]
[ "import glob\nfrom .models import *\nimport os\nimport datetime\nfrom django.shortcuts import render\n\n# Create your views here.\n\n\ndef getAttendance(request):\n print(\"abcbababbabababbababababa\")\n import face_recognition\n import cv2\n import numpy as np\n from django.http import JsonResponse\...
[ [ "numpy.argmin", "numpy.loadtxt" ] ]
r0mainK/ml-core
[ "ac17828d58e817e771caf2b2c3de523d527874b8" ]
[ "sourced/ml/core/algorithms/swivel.py" ]
[ "#!/usr/bin/env python3\n#\n# Copyright 2016 Google Inc. All Rights Reserved.\n# Copyright 2017 Sourced Technologies S. L.\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# ...
[ [ "tensorflow.device", "tensorflow.concat", "tensorflow.FixedLenFeature", "tensorflow.python.client.device_lib.list_local_devices", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.train.ExponentialMovingAverage", "tensorflow.GPUOptions", "tensorflo...
dannyjacobs/PRISim
[ "89e544d771cf5c4113a4d5787a57c9586fa98eac" ]
[ "main/generate_antenna_power.py" ]
[ "import argparse\nimport numpy as NP \nfrom astropy.io import fits\nfrom astropy.io import ascii\nimport scipy.constants as FCNST\nimport matplotlib.pyplot as PLT\nimport matplotlib.colors as PLTC\nimport progressbar as PGB\nimport healpy as HP\nimport geometry as GEOM\nimport interferometry as RI\nimport catalog a...
[ [ "numpy.sqrt", "numpy.linspace", "numpy.asarray", "numpy.concatenate", "numpy.mean", "numpy.random.randn", "numpy.where", "numpy.arange", "numpy.copy", "numpy.repeat", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.loadtxt", ...
shixun404/elegatnRL-marl
[ "89ade546e00fd00fee35e6d0efb6fa6b0239f0e8" ]
[ "elegantrl/env.py" ]
[ "import os\nimport gym # not necessary\nimport numpy as np\nfrom copy import deepcopy\n\n\"\"\"[ElegantRL.2021.09.01](https://github.com/AI4Finance-LLC/ElegantRL)\"\"\"\n\ngym.logger.set_level(40) # Block warning\n\n\nclass PreprocessEnv(gym.Wrapper): # environment wrapper\n def __init__(self, env, if_print=T...
[ [ "numpy.array", "torch.as_tensor" ] ]
OAB-exams/oab-exams
[ "b47d6f318c98fc213c1dc5d0ee7de8d2b98cfbd3" ]
[ "src/retrieval.py" ]
[ "import copy\nimport csv\nimport os\nimport json\nfrom functools import reduce\nimport collections\nfrom lxml import etree\nimport nltk\nimport numpy\nimport networkx\nnltk.download('punkt')\n\n\n\"\"\"\n## examples\n\n# parse OAB exam, return generator of OABQuestion instances\noab = parse_xml('/home/bruno/git/oab...
[ [ "numpy.dot", "numpy.zeros", "numpy.linalg.norm" ] ]
INCF/BrainImagingPipelines
[ "39915b5a313d049a0bb3ccd3a82a9a83e1241b11" ]
[ "bips/utils/reportsink/write_report.py" ]
[ "# general class for writing reportlab stuff. \n\nfrom reportlab.platypus import SimpleDocTemplate, Paragraph,\\\n Table, TableStyle, Spacer,\\\n PageBreak, PageTemplate\nfrom reportlab.pdfgen import canvas\nfrom reportlab.lib.units import inch\nfrom repor...
[ [ "numpy.array" ] ]
lei56/snli-ethics
[ "d5b18717ff1a6d135fed52086d2406cf26adaf2f" ]
[ "snli_query.py" ]
[ "#!/usr/bin/env python\n\n\nfrom math import log\nfrom heapq import nlargest\nfrom itertools import product\nfrom functools import partial\nfrom contextlib import contextmanager\nfrom csv import DictWriter\nimport logging\nimport pickle\nimport sys\n\nimport yaml\nimport numpy as np\nfrom scipy.stats import chi2\n\...
[ [ "numpy.log", "numpy.array", "numpy.sum", "scipy.stats.chi2.sf" ] ]
interactivereport/cellxgene_VIP
[ "084ad2d1bc576801bf75b47d5ee59fcc121cd256" ]
[ "VIPInterface.py" ]
[ "import requests\nimport json\nimport traceback\nimport sqlite3\nimport server.app.decode_fbs as decode_fbs\nimport scanpy as sc\nimport anndata as ad\nimport pandas as pd\nimport numpy as np\nimport diffxpy.api as de\nimport matplotlib\nmatplotlib.use('Agg')\nfrom matplotlib import pyplot as plt\nimport seaborn as...
[ [ "pandas.Series", "numpy.flipud", "pandas.DataFrame", "pandas.DataFrame.sparse.from_spmatrix", "matplotlib.pyplot.gca", "matplotlib.patches.Patch", "pandas.read_csv", "matplotlib.pyplot.gcf", "matplotlib.pyplot.close", "matplotlib.pyplot.text", "matplotlib.pyplot.figure"...
jaisenc/qutil
[ "1485fe486f4f2141f236d25addcdc34eceb3727d" ]
[ "qutil/format/number.py" ]
[ "import numpy as np\n\n\ndef fmtp(number, decimals=2):\n \"\"\"\n Formatting helper - percent: 0.52 -> 52.00%\n \"\"\"\n if np.isnan(number):\n return '-'\n return format(number, '.{}%'.format(decimals))\n\n\ndef fmtpn(number, decimals=2):\n \"\"\"\n Formatting helper - percent no % sign...
[ [ "numpy.isnan" ] ]
timtonthat/batch8_ceebios
[ "224debcd4325f5f44b334b2e98594208cf83fe1c" ]
[ "pokedex/search/search_gbif.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Sep 25 14:08:30 2020\n\nModule de recherche sur la base gbif https://www.gbif.org/fr/\n\nhttp://tecfa.unige.ch/perso/lombardf/calvin/teaching/mammiferes-fr-latin.html\n\n@author: CHRISTIAN\n\"\"\"\n\n\nimport os\nimport time\nimport pprint\nimport json\nimport re\nim...
[ [ "pandas.read_pickle", "scipy.sparse.load_npz", "pandas.DataFrame", "pandas.set_option", "scipy.sparse.save_npz" ] ]
deepest-stack/backend
[ "e3b9e1f73b5b5160c0529d2a507daf7b87089f16" ]
[ "dl/python/dl/gnn/full_gcn.py" ]
[ "#!/usr/local/greenplum-db-6.10.0/ext/python/bin/python\n# coding=utf-8\n\n\"\"\"class for GCN implementation\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport re\nimport graphlearn as gl\nimport tensorflow as tf\nfrom .base_gcn import Ba...
[ [ "tensorflow.estimator.Estimator" ] ]
kirchhausenlab/incasem
[ "ee9e007c5c04571e547e2fb5af5e800bd2d2b435" ]
[ "incasem/gunpowder/unsqueeze.py" ]
[ "import copy\nfrom typing import List\nimport logging\n\nimport numpy as np\nimport gunpowder as gp\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.INFO)\n\n\nclass Unsqueeze(gp.BatchFilter):\n \"\"\"Unsqueeze a batch at a given axis\n\n Args:\n ...
[ [ "numpy.expand_dims" ] ]
eisber/sarplus
[ "ebc19a0a2297565c41e24413a0d33fbfab93aef3" ]
[ "python/tests/test_pyspark_sar.py" ]
[ "import calendar\nimport datetime\nimport math\nimport numpy as np\nimport pandas as pd\nimport pytest\nimport os\nfrom sklearn.model_selection import train_test_split\n\nfrom pyspark.sql import SparkSession\n\nfrom pysarplus import SARPlus, SARModel\n\ndef assert_compare(expected_id, expected_score, actual_predict...
[ [ "pandas.read_csv", "pandas.Series", "numpy.allclose", "pandas.wide_to_long", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "pandas.melt" ] ]
moeyensj/atm
[ "0523600cf44423a1ef72ca40fff29bbfbe1281a8", "0523600cf44423a1ef72ca40fff29bbfbe1281a8" ]
[ "atm/functions/tests/test_blackbody.py", "atm/functions/tests/test_optical.py" ]
[ "#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\nimport numpy as np\nfrom astropy import constants as C\nfrom astropy import units as u\nfrom astropy.modeling.blackbody import blackbody_lambda\nfrom astropy.modeling.blackbody import blackbody_nu\n\nfrom ..blackbody import calcPlanckLambda\nfrom ..blackbody import...
[ [ "numpy.linspace" ], [ "numpy.array" ] ]
iamacityzen/Project---Data-handling-with-Pandas.
[ "123f0427486a0f0807f6e53f1115ae07437add17" ]
[ "code.py" ]
[ "# --------------\n#Importing header files\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n#Path of the file\r\npath\r\ndata = pd.read_csv(path)\r\n#Code starts here\r\ndata.rename(columns = {'Total' : 'Total_Medals'}, inplace = True)\r\ndata.head(10)\r\n\r\n\r\n\n\n\n# ------...
[ [ "pandas.read_csv", "numpy.where" ] ]
KalinNonchev/kipoiseq
[ "38d1134885e401198acd3883286dc55627cf12a6" ]
[ "kipoiseq/transforms/transforms.py" ]
[ "from __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport numpy as np\nfrom kipoiseq.transforms import functional as F\nfrom kipoiseq.utils import DNA, parse_alphabet, parse_dtype\n\n\nclass Compose(object):\n \"\"\"Composes several transforms toget...
[ [ "numpy.swapaxes", "numpy.expand_dims" ] ]
acdh-oeaw/thunau-old
[ "a3023885470e80f7312e43561028398bffd713e0" ]
[ "importLegacyData.py" ]
[ "\n# coding: utf-8\n\n# In[33]:\n\n\nimport pandas as pd\nfrom dateutil import parser\n\n\n# In[34]:\n\n\nfile = \"data/thunau_export_20170626.csv\"\n\n\n# In[35]:\n\n\ndf = pd.read_csv(file)\n\n\n# In[37]:\n\n\ntroubles = []\nfor index, row in df.iterrows():\n doc, _ = Document.objects.get_or_create(legacy_id=r...
[ [ "pandas.read_csv" ] ]
GalBenZvi/niworkflows
[ "14c54533a0300ee760b285f7e4d0a88593b4c075" ]
[ "niworkflows/interfaces/surf.py" ]
[ "# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n#\n# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Licen...
[ [ "numpy.hstack", "numpy.sqrt", "numpy.vstack", "numpy.eye", "numpy.ones", "numpy.genfromtxt", "numpy.cross", "numpy.savetxt", "numpy.zeros", "numpy.loadtxt" ] ]
vlomonaco/continual-learning
[ "39301f9454a40304d43fa9444b6e94f4f13e328f" ]
[ "vae_models.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nimport excitability_modules as eM\nimport utils\nimport linear_nets\nfrom replayer import Replayer\n\n\nclass AutoEncoder(Replayer):\n \"\"\"Class for variational auto-encoder (VAE) models.\"\"\"\n\n def __init__(self, image_size, imag...
[ [ "torch.nn.Dropout", "torch.max", "torch.randn", "torch.nn.functional.cross_entropy", "torch.nn.Linear", "torch.no_grad" ] ]
fjbriones/emotalkingface
[ "d3d838be705ea74d4165891720739d749aaf38a5" ]
[ "data_prep/utils.py" ]
[ "# Written by Sefik Emre Eskimez, May 29 2018 - Aug 17 2018 #\r\n\r\nimport matplotlib as mpl\r\nmpl.use('Agg')\r\nimport matplotlib.pyplot as plt\r\nfrom mpl_toolkits import mplot3d\r\nimport matplotlib.animation as manimation\r\nimport matplotlib.lines as mlines\r\nfrom matplotlib import transforms\r\nimport nump...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.plot", "numpy.max", "matplotlib.pyplot.gca", "numpy.reshape", "matplotlib.pyplot.subplot", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "numpy.min", "mat...
axelmagn/metrics
[ "63b047d4f0481614597f25a1e4c03cad35ff89eb" ]
[ "ai-metrics/aimetrics/estimator.py" ]
[ "import json\nimport logging\nimport numpy as np\nfrom sklearn.base import BaseEstimator, ClassifierMixin\nfrom sklearn.utils.validation import NotFittedError\nfrom tornado import gen\nfrom tornado.httpclient import AsyncHTTPClient, HTTPError, HTTPClient\nfrom tornado.ioloop import IOLoop\nfrom urllib.parse import ...
[ [ "numpy.asarray", "sklearn.utils.validation.NotFittedError" ] ]
satpal82bhandari/Hands-On-Markov-Models-with-Python
[ "9c38aab4225806e25c3878a6c5b137710bbd4fa0" ]
[ "Chapter06/parse_data.py" ]
[ "\"\"\"\nUsage: parse_data.py --company=<company>\n\"\"\"\nimport os\nimport tarfile\nimport pandas as pd\nfrom pandas import errors as pd_errors\nfrom functools import reduce\nfrom docopt import docopt\n\nargs = docopt(doc=__doc__, argv=None, help=True,\n version=None, options_first=False)\n\nyears = ...
[ [ "pandas.DataFrame" ] ]
mphoward/relentless
[ "5f7e8eb62696f45df28a948202b324563805a7f5" ]
[ "relentless/optimize/criteria.py" ]
[ "\"\"\"\nConvergence criteria\n====================\n\nA convergence test determines if an objective function has converged to the\ndesired minimum, subject to design constraints.\n\nThe following convergence tests have been implemented:\n\n.. autosummary::\n :nosignatures:\n\n AllTest\n AndTest\n AnyTe...
[ [ "numpy.isclose" ] ]
jmaslek/OpenBBTerminal
[ "919ca99f80809b2b9fe828dc3dd201c813d12d6d" ]
[ "openbb_terminal/forex/forex_helper.py" ]
[ "from datetime import datetime\nfrom typing import List, Optional, Dict, Iterable\nimport os\nimport argparse\nimport logging\nimport re\n\nimport yfinance as yf\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib.lines import Line2D\nimport mplfinance as mpf\n\nfrom openbb_terminal.forex import ...
[ [ "matplotlib.lines.Line2D", "pandas.read_json", "pandas.DataFrame" ] ]
wang3702/barlowtwins
[ "6d1dc9d31f8f3c87fa4148b7dada0fe9e34805d1" ]
[ "ops/LARS.py" ]
[ "import torch\nfrom torch import nn\n\n\nclass SGD_LARC(object):\n \"\"\"\n :class:`LARC` is a pytorch implementation of both the scaling and clipping variants of LARC,\n in which the ratio between gradient and parameter magnitudes is used to calculate an adaptive\n local learning rate for each individu...
[ [ "torch.norm", "torch.no_grad" ] ]
LenzDu/Kaggle-Competition-Sberbank
[ "ef8ba67c0a17183cac7ab693a42f4e5dbbac6bb3" ]
[ "lightGBM.py" ]
[ "# author: vrtjso\r\nimport numpy as np\r\nimport pandas as pd\r\nimport lightgbm as lgb\r\nimport gc\r\nfrom sklearn.preprocessing import StandardScaler\r\nfrom Utils import CreateOutput\r\n\r\ntrainDf = pd.read_csv('train_featured.csv')\r\nXtrain = trainDf.drop(['price_doc','w'],1)\r\nw = trainDf.w.values\r\nYtra...
[ [ "pandas.read_csv" ] ]
DNPLab/DNPLab
[ "78999a4e8320b6476a5aa55d9884c49d74149edc" ]
[ "dnplab/dnpIO/tnmr.py" ]
[ "from .. import dnpdata\nimport numpy as np\nimport struct\nimport re\n\n\ndef import_tnmr(path):\n \"\"\"\n Import tnmr data and return dnpdata object\n\n Args:\n path (str) : Path to .jdf file\n\n Returns:\n tnmr_data (object) : dnpdata object containing tnmr data\n \"\"\"\n\n attr...
[ [ "numpy.array" ] ]
mariajmolina/ML-extremes-mcs
[ "b3783b00132dd59247947cc9d1492dfb18c2415e" ]
[ "ML-extremes-mcs/running_mcs_stats_flextrkrID3H.py" ]
[ "import numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport cartopy.crs as ccrs\nimport cartopy.feature as cf\nfrom visualize import create_STATES\nfrom id_selector import IDSelector\nimport mcs_stats\nfrom config import main_path_era, savefig_path, us_states_location\n\n#################...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.cm.get_cmap", "matplotlib.colors.Normalize", "matplotlib.pyplot.savefig", "matplotlib.pyplot.bar", "numpy.array", "matplotlib.pyplot.show", "numpy.zeros" ] ]
Bennygmate/Deep-Learning
[ "a7236f15829009bcadfdee884c78182ebdfb42f7" ]
[ "deep learning/Mnist/train.py" ]
[ "import tensorflow as tf\nimport hw1 as qfns\nimport time\nfrom datetime import datetime\nfrom tensorflow.examples.tutorials.mnist import input_data\n\n#options: \"onelayer\", \"twolayer\", \"conv\"\n#network = \"none\"\n#network = \"onelayer\"\n#network = \"twolayer\"\nnetwork = \"conv\"\n\n\ndef accuracy(sess, da...
[ [ "tensorflow.confusion_matrix", "tensorflow.reduce_max", "tensorflow.summary.FileWriter", "tensorflow.reduce_mean", "tensorflow.cast", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.reduce_min", "tensorflow.summary.merg...
jbr-ai-labs/NeurIPS2020-Flatland-Competition-Solution
[ "bd3c169ffa39063d6bb2b170bca93fa785b7bf71" ]
[ "networks/DQN.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass DQNNet(nn.Module):\n def __init__(self, state_sz, action_sz, layers_sz, device):\n super(DQNNet, self).__init__()\n self.layers_sz = layers_sz\n self.device = device\n \n layers = self.create_linear_layers(state_sz, action_sz, layers_...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.nn.ReLU" ] ]
harmsm/gpvolve
[ "94dd71e5fbee29cc50b82d282ef33c850fb33575", "94dd71e5fbee29cc50b82d282ef33c850fb33575" ]
[ "gpvolve/cluster/opt.py", "gpvolve/simulate/wright_fisher/engine/wright_fisher_engine_python.py" ]
[ "from gpvolve.cluster.criteria import *\nimport numpy as np\n\n\ndef optimize(T, criterion=\"Spectral gap\", z=None):\n \"\"\"\n Finding optimal number of clusters to use based on\n given criterion.\n\n Since the number of clusters nc is unknown in advance,\n the cluster algorithm is ran several time...
[ [ "numpy.shape" ], [ "numpy.unique", "numpy.random.choice", "numpy.arange", "numpy.random.poisson", "numpy.sum" ] ]
rknaebel/textgame-project
[ "53b035639ce4502fcaaec12f250db4fa11503963" ]
[ "train2.py" ]
[ "#!/usr/bin/python\n#\n# author: rknaebel\n#\n# description:\n#\nimport numpy as np\nimport random\n\n# GYM: Environment lib\nimport gym\nimport gym_textgame\n\nfrom models import HistoryQLearner\nfrom replay_buffer import PrioritizedReplayBuffer\nfrom preprocess import sent2seq, initHist, addHistoryState\n\nfrom a...
[ [ "numpy.mean", "numpy.random.rand" ] ]
trislaz/useful_wsi
[ "8bad92832545eaa85cfc3df9100f2325a71c710b" ]
[ "useful_wsi/patch_sampling.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCode for sampling from WSI\n\n\"\"\"\n\nimport itertools\nimport numpy as np\n\nfrom .tissue_segmentation import roi_binary_mask\nfrom .utils import (find_square, get_size, get_whole_image, pj_slice,\n get_x_y, get_x_y_from_0, mask_percentage, open_image)\n\n\nde...
[ [ "numpy.ones_like", "numpy.array", "numpy.where", "numpy.random.seed" ] ]
pashu123/torch-mlir
[ "7c3ba25238ac73850fcdd698be1fb084f8a58e49" ]
[ "e2e_testing/torchscript/elementwise.py" ]
[ "# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n# See https://llvm.org/LICENSE.txt for license information.\n# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n# Also available under a BSD-style license. See LICENSE.\n\nimport torch\n\nfrom torch_mlir_e2e_test.torchscript.f...
[ [ "torch.abs", "torch.randint", "torch.ops.aten.erf", "torch.ops.aten.maximum", "torch.tanh", "torch.rsqrt", "torch.where", "torch.pow", "torch.add", "torch.sqrt", "torch.clone", "torch.log2", "torch.relu", "torch.mul", "torch.reciprocal", "torch.rsub"...
rbavery/sprnca_gedi
[ "2c89cb9b84d255bf03b50bf7bf29efa93b932604" ]
[ "pygedi/clean_shps.py" ]
[ "import geopandas as gpd\nimport pandas as pd\nfrom datetime import datetime\nfrom astral.sun import sun\nfrom astral import LocationInfo\nimport pytz\n\ndef convert_float_to_datetime(timestamp):\n delta_time_reference = \"Jan 1 00:00 2018\" # from the data dictionary\n\n utc_time = pd.to_datetime(timestamp, ...
[ [ "pandas.to_datetime", "pandas.Timedelta" ] ]
Taarak9/Handwritten-DIgit-Recognition
[ "6ae4c5c64872a6ee1550b073d926fa1855d941ef" ]
[ "src/Handwritten_Digit_Recognition/hdr_fnn.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\nfrom mnist_loader import load_data_wrapper \nfrom customdl import FNN\n\n# MNIST data split\ntraining_data, validation_data, test_data = load_data_wrapper()\n\n# handwritten digit recognizer \n# Loss function: Cross Entropy\nhdr = FNN(784, \"ce\")\nhdr.add_...
[ [ "numpy.reshape", "numpy.arange", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show" ] ]
julianblanco/MAVFleetControl
[ "70ca504288e7123a906150beb8f1fc7141a18fbd" ]
[ "precision_land.py" ]
[ "import asyncio\nimport time\nimport numpy as np\n\nfrom mavfleetcontrol.craft import Craft\nfrom mavfleetcontrol.actions.point import FlyToPoint\nfrom mavfleetcontrol.actions.percision_land import PercisionLand\nfrom mavfleetcontrol.actions.land import land\n\nif __name__ == \"__main__\":\n\n # loop = asyncio.g...
[ [ "numpy.array" ] ]
tyang816/CoClsGraph
[ "c31634d39685e6192a5018f9d1a113ad5fc80407" ]
[ "backend/flask-app/server.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom flask import Flask, request, jsonify\nfrom db import *\nimport json\nimport pandas as pd\nimport os\n\n# 跨域支持\ndef after_request(response):\n response.headers['Access-Control-Allow-Origin'] = '*'\n response.headers['Access-Control-Allow-Methods'] = 'PUT,GET,POST,DELETE'\n r...
[ [ "pandas.read_excel" ] ]
HyeongJu916/video_SuperResolution_ESRGAN
[ "c1a01c99287a6212a3dc76ac17baafcf1c9f3013" ]
[ "esrgan_pytorch/calculate_niqe.py" ]
[ "# Copyright 2020 Dakewe Biotech Corporation. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle...
[ [ "numpy.dot", "scipy.linalg.pinv", "numpy.sqrt", "numpy.int", "numpy.mean", "numpy.argmin", "numpy.var", "numpy.hstack", "numpy.arange", "numpy.float32", "numpy.ravel", "numpy.zeros", "scipy.special.gamma", "numpy.cov", "scipy.ndimage.correlate1d", "n...
deeplearningforfun/torch-tools
[ "e3dc040dcfe33aec247a3139e72426bca73cda96" ]
[ "torchtoolbox/data/sampler.py" ]
[ "__all__ = ['RepeatedAugmentSampler']\n\nimport math\n\nimport torch\nfrom torch import distributed as dist\nfrom torch.utils.data import Sampler\n\n\nclass RepeatedAugmentSampler(Sampler):\n \"\"\"Sampler that restricts data loading to a subset of the dataset for distributed,\n with repeated augmentation.\n ...
[ [ "torch.Generator", "torch.distributed.get_world_size", "torch.distributed.is_available", "torch.distributed.get_rank" ] ]
GeniusHTX/EIDIG-2021-09-30-server
[ "af3ca2c8edd1ba052b8b7c9a0ecf6494dc9b36b6" ]
[ "_htx/retraining_htx.py" ]
[ "\"\"\"\nThis python file retrains the original models with augmented training set.\n\"\"\"\n\nimport os\nimport pickle\nimport sys\n\nimport joblib\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom tensorflow import keras\n\nfrom _htx.EIDIG_htx import DisInstanceResult\n\nsys.path.app...
[ [ "sklearn.model_selection.train_test_split", "numpy.append", "numpy.delete", "tensorflow.keras.callbacks.EarlyStopping", "numpy.empty" ] ]
countywest/SAUM
[ "9dc2215db95039ea43452a7cc626e58755363219" ]
[ "test_self_consistency.py" ]
[ "import csv\nimport importlib\nimport numpy as np\nimport os\nimport tensorflow as tf\nimport time\nimport datetime\nimport sys\nimport h5py\nfrom utils.io_util import read_pcd, save_pcd\nfrom utils.tf_util import chamfer, earth_mover, dist_to_nearest\nfrom utils.visu_util import plot_pcd_three_views\nfrom utils.ar...
[ [ "tensorflow.train.latest_checkpoint", "numpy.arange", "tensorflow.placeholder", "tensorflow.ConfigProto", "numpy.mean", "tensorflow.Session", "tensorflow.train.Saver" ] ]
themech/Machine-Learning-Coursera-Tensorflow
[ "bd99b7de6206ad5903313c824fb9dd05df8580c2" ]
[ "ex1-linear regression/1_plot_data.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\n\n\n# Read the data - two comma-separated columns.\n# As there is no header row, we name the columns here\ndf = pd.read_csv('data/ex1data1.txt', names=['population', 'profit'])\n\n# Print the header and first few rows\nprint(df.head())\n\...
[ [ "pandas.read_csv", "matplotlib.pyplot.show" ] ]
Hao-Kailong/DisFeb
[ "2877edd587556e127d6648ee211ed22838c8d015" ]
[ "load_data.py" ]
[ "# encoding: utf-8\r\nimport json\r\nimport torch.utils.data as data\r\nimport torch\r\nimport os\r\nimport numpy as np\r\nimport random\r\n\r\n\r\nclass FewRelDataset(data.Dataset):\r\n # name是文件名,root是根目录\r\n def __init__(self, name, encoder, N, K, Q, root):\r\n self.root = root\r\n path = os....
[ [ "torch.stack", "torch.utils.data.DataLoader", "torch.tensor" ] ]
nsarlin/courserapredictprices
[ "78c3023e604e18b50e9e08097e367fc6d740c2f3" ]
[ "src/models/predict_model.py" ]
[ "# -*- coding: utf-8 -*-\nimport click\nimport logging\nimport os\n\nfrom sklearn.metrics import mean_squared_error\n\nimport scipy.sparse as sp\nimport numpy as np\n\nimport dnn\nimport xgb\n\n\n@click.command()\n@click.argument('data_dirpath', type=click.Path(exists=True))\n@click.argument('model_dirpath', type=c...
[ [ "sklearn.metrics.mean_squared_error" ] ]
coleygroup/molpal
[ "7b3dd1488af6e734caea527fe2738ff7f6ebfc49" ]
[ "scripts/trajectories.py" ]
[ "from argparse import ArgumentParser\nfrom collections import Counter, defaultdict\nimport csv\nfrom itertools import islice\nfrom operator import itemgetter\nfrom pathlib import Path\nimport pickle\nfrom typing import Iterable, List, Set, Tuple\n\nfrom matplotlib import pyplot as plt\nfrom matplotlib import ticker...
[ [ "numpy.array", "matplotlib.pyplot.subplots", "pandas.DataFrame", "numpy.mean", "matplotlib.ticker.MaxNLocator", "numpy.var", "matplotlib.ticker.FuncFormatter", "numpy.exp" ] ]
ruofeidu/mdif
[ "41e7edc8ff4765543d98d2dfa28e98ca51e0220d" ]
[ "model/network_pipeline_test.py" ]
[ "#!/usr/bin/python\n#\n# Copyright 2020 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app...
[ [ "tensorflow.zeros", "tensorflow.test.main", "tensorflow.eye" ] ]
zhangchao162/deep-learning-cnn
[ "3fa513e975263ca95bdd7d5e720455ffb3c82917" ]
[ "04 image_classification/vgg_tf.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nvgg_tf.py:训练tensorflow版的vgg16网络,对cifar-10shuju进行分类\n\"\"\"\nfrom datetime import datetime\nimport math\nimport time\nimport tensorflow as tf\nimport cifar10\n\nbatch_size = 16\nnum_batches = 100\n\n# 定义函数对卷积层进行初始化\n# input_op : 输入数据 \n# name : 该卷积层的名字,用tf.name_scope()来命名\n# kh,kw :...
[ [ "tensorflow.device", "tensorflow.nn.max_pool", "tensorflow.nn.l2_loss", "tensorflow.nn.conv2d", "tensorflow.Graph", "tensorflow.Variable", "tensorflow.gradients", "tensorflow.name_scope", "tensorflow.Session", "tensorflow.contrib.layers.xavier_initializer", "tensorflow....
Edelweiss35/deep-machine-learning
[ "b1e4b133609f303be77de824601925f448a94764" ]
[ "dml/KNN/kd.py" ]
[ "from __future__ import division\nimport numpy as np\nimport scipy as sp\nfrom operator import itemgetter\nfrom scipy.spatial.distance import euclidean\nfrom dml.tool import Heap\nclass KDNode:\n\tdef __init__(self,x,y,l):\n\t\tself.x=x\n\t\tself.y=y\n\t\tself.l=l\n\t\tself.F=None\n\t\tself.Lc=None\n\t\tself.Rc=Non...
[ [ "numpy.vstack" ] ]
marneusz/LicensePlatesDetectionAndRecognition
[ "5b3eb2845d64b22abb1a321b5662c24d7b3832b3" ]
[ "read_data.py" ]
[ "# Necessary imports\nimport glob\nimport os\nimport xml.etree.ElementTree as ET\n\nimport pandas as pd\n\n\nclass MacOSFile(object):\n\n def __init__(self, f):\n self.f = f\n\n def __getattr__(self, item):\n return getattr(self.f, item)\n\n def read(self, n):\n # print(\"reading total...
[ [ "pandas.DataFrame" ] ]
48cfu/CarND-Traffic-Sign-Classifier-Project
[ "825a8a43e6bc95648a601a5761278e486054c3b9" ]
[ "source/LeNet-Lab.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # LeNet Lab\n# ![LeNet Architecture](lenet.png)\n# Source: Yan LeCun\n\n# ## Load Data\n# \n# Load the MNIST data, which comes pre-loaded with TensorFlow.\n# \n# You do not need to modify this section.\n\n# In[1]:\n\n\nfrom tensorflow.examples.tutorials.mnist import inpu...
[ [ "matplotlib.pyplot.imshow", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.zeros", "tensorflow.nn.max_pool", "tensorflow.cast", "tensorflow.contrib.layers.flatten", "tensorflow.train.AdamOptimizer", "tensorflow.nn.conv2d", "numpy.pad", "tensorflow.Session", ...
OmidSa75/mmdetection
[ "baccacb2d2675fdc430b4f9546a7fd46f9097a20" ]
[ "mmdet/core/bbox/coder/delta_xywh_bbox_coder.py" ]
[ "import mmcv\nimport numpy as np\nimport torch\n\nfrom ..builder import BBOX_CODERS\nfrom .base_bbox_coder import BaseBBoxCoder\n\n\n@BBOX_CODERS.register_module()\nclass DeltaXYWHBBoxCoder(BaseBBoxCoder):\n \"\"\"Delta XYWH BBox coder.\n\n Following the practice in `R-CNN <https://arxiv.org/abs/1311.2524>`_,...
[ [ "numpy.log", "torch.tensor", "torch.log", "torch.where", "torch.stack", "torch.onnx.is_in_onnx_export" ] ]
HilitOreny/SheCodes
[ "be98ca8654c6c0539fe2cd22ad2ae0fdbcf60117" ]
[ "Sustain/sustain_code_example.py" ]
[ "\"\"\"This module analyzes the content of an excel file for the Welcome Team of She Codes\"\"\"\n\nimport pandas\nimport datetime\nimport os\n\n\ndef pathfinder():\n path = '/python_scripts/welcome.xlsx'\n check_file_location = os.path.isfile(path)\n return check_file_location\n\n\ndef read_file(track_nam...
[ [ "pandas.read_excel" ] ]
mightypirate1/Smartorn
[ "27cbe5abac45eb144a44ec369fcf92f298db3743" ]
[ "nn/smartorn.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\nimport utils.utils as utils\n\nEPSILON = 10**-7\n\nclass smartorn:\n def __init__(\n self,\n input_shape,\n output_shape,\n n_neurons=100,\n n_layers=3,\n n_dimentions=3...
[ [ "tensorflow.reduce_sum", "tensorflow.get_collection", "tensorflow.squeeze", "tensorflow.math.divide", "tensorflow.math.pow", "numpy.zeros", "tensorflow.nn.l2_normalize", "tensorflow.norm", "tensorflow.nn.elu", "tensorflow.placeholder", "tensorflow.math.exp", "tensor...
willtop/imitation-learning
[ "2c00f77e4e575e38ef233cc5eac6862e598ec4ac" ]
[ "Rejection-System/parse_json_tagging_targets.py" ]
[ "import numpy as np\nimport json\n\n# TYPE = \"TRAIN\"\nTYPE = \"VALID\"\n\nif(__name__==\"__main__\"):\n if (TYPE == \"TRAIN\"):\n filename = \"Data/Train/train_tags.json\"\n filename_processed = \"Data/Train/train_tags_processed.json\"\n number_of_images = 5000\n target_filename = \...
[ [ "numpy.size", "numpy.zeros", "numpy.sum", "numpy.save" ] ]
wpirkl/matplotlib_qtquick_playground
[ "17f8b600776d4a051d945c74a50ec3423169b8fa" ]
[ "backend/backend_qtquick5/backend_qquick5agg.py" ]
[ "import ctypes \nimport os\nimport sys\nimport traceback \n\nimport matplotlib\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg\nfrom matplotlib.backend_bases import cursors\nfrom matplotlib.figure import Figure\nfrom matplotlib.backends.backend_qt5 import TimerQT\n\nimport six\n\nfrom PyQt5 import Q...
[ [ "matplotlib.backends.backend_agg.FigureCanvasAgg.resize_event", "matplotlib.backends.backend_agg.FigureCanvasAgg.key_release_event", "matplotlib.rcParams.get", "matplotlib.backends.backend_agg.FigureCanvasAgg.button_press_event", "matplotlib.backends.backend_agg.FigureCanvasAgg.key_press_event...
mattwigway/tssankey
[ "01b3456bc7c308450dcb82154eddfdb984cc7014" ]
[ "tssankey/sankey.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.patches\nimport textwrap\n\n\n# just using fill_between and offsetting curves vertically makes steep curves appear to get\n# thinner in the middle, because you perceive the width of the line perpendicular to its direction\ndef _cwcurve(x_left, ...
[ [ "numpy.linspace", "numpy.min", "numpy.clip", "matplotlib.pyplot.subplots", "numpy.max", "numpy.array", "numpy.sum" ] ]
lekooooook/POINT2-pytorch
[ "c9f5fad59e2f7da2c169255de5a730d861a1a96e" ]
[ "lib/net/triangulation_layer.py" ]
[ "import torch\nimport torch.nn as nn\nfrom kornia import SpatialSoftArgmax2d\n\n\nclass triangulation_layer(nn.Module):\n def __init__(self, device):\n super(triangulation_layer, self).__init__()\n self.device = device\n self.softArgmax = SpatialSoftArgmax2d(temperature=10000, normalized_coo...
[ [ "torch.cat", "torch.pinverse", "torch.tensor", "torch.inverse", "torch.matmul" ] ]
dtanoglidis/DeepGhostBusters
[ "eb33bd4f7db6ce65e5fd70231d4f2a9d18c2080c" ]
[ "run.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nGeneric python script.\n\"\"\"\n__author__ = \"Alex Drlica-Wagner\"\n\nimport os\nimport numpy as np\nimport pylab as plt\nimport pandas as pd\nimport scipy.ndimage as nd\n#import fitsio\n\nimport collections\nimport subprocess\n\nimport matplotlib\nfrom matplotlib.colors import LogN...
[ [ "pandas.read_csv", "numpy.abs", "numpy.unique", "matplotlib.patches.Rectangle", "numpy.percentile", "numpy.genfromtxt", "numpy.ones", "matplotlib.image.imread", "numpy.zeros_like", "numpy.argsort" ] ]
temcomp/helita
[ "33c71837f79cb2acb89144fcfb59a7ae84fe6db0" ]
[ "helita/obs/iris_util.py" ]
[ "\"\"\"\nSet of utility programs for IRIS.\n\"\"\"\nimport os\nimport re\nimport io\nimport numpy as np\nimport pandas as pd\nfrom datetime import datetime, timedelta\nfrom glob import glob\n\n# pylint: disable=F0401,E0611,E1103\nfrom urllib.request import urlopen\nfrom urllib.parse import urljoin, urlparse\nfrom u...
[ [ "numpy.array", "pandas.DataFrame" ] ]
mmore500/pipe-profile
[ "861babd819909d1bda5e933269e7bc64018272d6" ]
[ "conduitpylib/test/test_utils/test_consolidate_merge.py" ]
[ "#!/bin/python3\n\nimport pandas as pd\nimport pandas.testing as pd_testing\nimport unittest\n\nfrom conduitpylib.utils import consolidate_merge\n\nclass TestCountHandsWithKOrMoreSets(unittest.TestCase):\n\n # adapted from https://stackoverflow.com/a/54344148\n def assertDataframeEqual(self, a, b, msg):\n ...
[ [ "pandas.testing.assert_frame_equal", "pandas.DataFrame" ] ]
Wastoon/TSAL
[ "0f880c600f1a2e128de9c9fdfb94ae0776948cbe" ]
[ "lib/datasets/GD.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\nfrom __future__ import print_function\nfrom PIL import Image\nfrom os import path as osp\nimport numpy as np\ni...
[ [ "numpy.dot", "numpy.sqrt", "torch.cat", "numpy.concatenate", "numpy.exp", "numpy.finfo", "numpy.argmax", "matplotlib.pyplot.subplot", "matplotlib.pyplot.subplots_adjust", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "numpy.array", "m...