repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
vthuongt/tikzplotlib
[ "a225d47b40030222e8c37608e18fb08e2402ab6a" ]
[ "tests/test_logplot.py" ]
[ "import matplotlib.pyplot as plt\n\n\ndef plot():\n a = [pow(10, i) for i in range(10)]\n fig = plt.figure()\n ax = fig.add_subplot(1, 1, 1)\n ax.semilogy(a, color=\"blue\", lw=0.25)\n\n plt.grid(b=True, which=\"major\", color=\"g\", linestyle=\"-\", linewidth=0.25)\n plt.grid(b=True, which=\"mino...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.figure" ] ]
rateixei/si-mu-lator
[ "53505146c3a9098138d52999079cd45b92903bf9" ]
[ "detmodel/detector.py" ]
[ "import numpy as np\nimport sympy\nimport yaml\nimport sys\nfrom detmodel.hit import Hit\nfrom detmodel.signal import Signal\nfrom detmodel.muon import Muon\nfrom detmodel.plane import Plane\nfrom detmodel.plane import DetType\n\n## ToDo:\n### Add print method to summarize detector\n### implement noise as a functio...
[ [ "numpy.concatenate" ] ]
Sirish07/2D_projection_matching
[ "11c8ea81e3cbf5ecd3daba602cde0b7a9efcc15d" ]
[ "2Dpm/densify/utils.py" ]
[ "\"\"\"\nAuthors: Chen-Hsuan Lin\nhttps://github.com/chenhsuanlin/3D-point-cloud-generation/\n\"\"\"\n\nimport numpy as np\n\n\ndef parseObj(fname):\n vertex,edge,face = [],[],[]\n # parse vertices\n with open(fname) as file:\n for line in file:\n token = line.strip().split(\" \")\n ...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.ones_like", "numpy.linalg.matrix_rank", "numpy.all" ] ]
Timmy-Oh/Adorable-Lab
[ "c21454d011e6888fd28c41d1624721ea1826be40" ]
[ "PySrc/9day/Num01.py" ]
[ "# Num01.py\n# Array <-- numpy\nimport numpy as np\nd1 = [1,2,'3',4,5]\nprint(type(d1[1]),type(d1[2]));\n\na1 = np.array(d1)\nprint(a1)\nprint(type(a1),a1.shape, a1.dtype)\n\nd2 = [1,2,3,4,5]\na2 = np.array(d2)\nprint(a2)\nprint(type(a2),a2.shape, a2.dtype)\n\nd3 = [[1,2],[3,4],[5,6]]\na3 = np.array(d3)\nprint(a3)\...
[ [ "numpy.array" ] ]
AngeloMendes/mirdata
[ "6cd0fd740dc619ad3f583ece366bf8a31a48fe86" ]
[ "mirdata/datasets/salami.py" ]
[ "\"\"\"SALAMI Dataset Loader\n\n.. admonition:: Dataset Info\n :class: dropdown\n\n The SALAMI dataset contains Structural Annotations of a Large Amount of Music\n Information: the public portion contains over 2200 annotations of over 1300\n unique tracks.\n\n NB: mirdata relies on the **corrected** ...
[ [ "numpy.array", "numpy.diff" ] ]
rieder/grps
[ "a8cea14fe851090f633d47e778daec49bd994be8" ]
[ "plotting_new.py" ]
[ "# coding: utf-8\nimport os,sys\nimport argparse\nimport numpy as np\nimport time as clocktime\n\nfrom amuse.lab import *\n\nfrom amuse.community.kepler_orbiters.interface import Kepler\nfrom amuse.couple.bridge import Bridge\nfrom amuse.support.console import set_printing_strategy\n\nfrom parameters import Paramet...
[ [ "matplotlib.use", "numpy.array", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.style.use" ] ]
BoChenYS/ROPE
[ "3e50f134259b555cf547e4a3ef8b14cf5cda4e00" ]
[ "main_ycbv.py" ]
[ "import datetime\nimport os\nimport time\nfrom yacs.config import CfgNode as CN\nfrom scipy.io import savemat\n\nimport torch\nimport torch.utils.data\nfrom torch import nn\nimport torchvision\nimport torchvision.models.detection\nimport torchvision.models.detection.mask_rcnn\n\nfrom reference.group_by_aspect_ratio...
[ [ "torch.device", "torch.utils.data.RandomSampler", "torch.optim.Adam", "torch.utils.data.SequentialSampler", "torch.nn.parallel.DistributedDataParallel", "torch.optim.lr_scheduler.MultiStepLR", "torch.utils.data.DataLoader", "torch.utils.data.distributed.DistributedSampler", "to...
MiqSA/app-data-visualization
[ "ed3226e8306dff4700d9c4a0d74db373a3933cb7" ]
[ "api/resources/products.py" ]
[ "from flask_restful import Resource\nimport pandas as pd\nimport json\n\n\nclass Products(Resource):\n def get(self):\n data_d_sh2 = pd.read_excel('../datasets/d_sh2.xlsx')\n data_d_sh2 = data_d_sh2[['CO_NCM', 'NO_NCM_POR']]\n data_d_sh2 = data_d_sh2.to_json(orient='records')\n data_d...
[ [ "pandas.read_excel" ] ]
fcostin/hybrid_poisson_hmm
[ "106af88fa46f41dc8fedbfa80a646d6f1bde1836" ]
[ "lib/gamma_approx/test_gamma_approx.py" ]
[ "import numpy\nimport numpy.random\nfrom scipy.special import digamma\nimport pytest\n\n\nfrom . import (\n expected_rate_of_gamma_mixture,\n expected_log_rate_of_gamma_mixture,\n fit_batch_gamma_dists_to_gamma_mixtures,\n fit_gamma_dist_to_gamma_mixture,\n rough_fit_batch_gamma_dists_to_gamma_mixtur...
[ [ "numpy.concatenate", "numpy.array", "numpy.empty", "numpy.asarray", "numpy.zeros", "numpy.log", "numpy.sum", "numpy.random.default_rng", "numpy.mean", "numpy.amax", "numpy.argmax", "numpy.all", "scipy.special.digamma" ] ]
TulioChiodi/AEmotion
[ "cedabb5902d343a400400e9e09ffddd539977254" ]
[ "organize_dataset.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 26 13:26:40 2021\n\n@author: rdavi\n\nDEMoS and EmoFilm datasets feature extraction\n\"\"\"\n\n# %% Imports\nfrom features_extraction import load_data\nimport os \nimport pickle\nimport numpy as np\n\n# %% Categorizar dados em pastas\npath = 'dataset/DEMoS/DEMOS/...
[ [ "numpy.asarray" ] ]
bunlinh80/HARK
[ "160284fe999aadfa309ea0f411694e7e1484596e" ]
[ "cAndCwithStickyE/cAndCwithStickyE.py" ]
[ "'''\nRuns the exercises and regressions for the cAndCwithStickyE paper.\n'''\nimport sys \nimport os\nsys.path.insert(0, os.path.abspath('../'))\nsys.path.insert(0, os.path.abspath('../ConsumptionSaving'))\n\nimport numpy as np\n#from copy import copy, deepcopy\nfrom StickyEmodel import StickyEconsumerSOEType, Sti...
[ [ "numpy.array", "numpy.ones_like", "numpy.log", "matplotlib.pyplot.plot", "numpy.mean", "numpy.std", "numpy.sqrt", "matplotlib.pyplot.show", "numpy.linspace" ] ]
samueljackson92/major-project
[ "5d82b875944fcf1f001f9beb5e5419ba60be3bf1" ]
[ "src/mia/features/_orientated_bins.py" ]
[ "\"\"\"Implementation of the Orientated Bins filter.\n\nUsed to compute the strength and orientation of linear features in an image.\n\nReference: Reyer Zwiggelaar, Tim C. Parr, and Christopher J. Taylor.\n\"Finding Orientated Line Patterns in Digital Mammographic Images.\" BMVC. 1996.\n\"\"\"\n\nimport itertools\n...
[ [ "numpy.count_nonzero", "numpy.zeros", "scipy.ndimage.filters.generic_filter", "numpy.where", "numpy.argmax", "numpy.amax" ] ]
076923/Tensorflow-2.0-Object-Detection-API
[ "933d1b46a814b8103da22b32859a14d45163087c" ]
[ "sample_python.py" ]
[ "# Using GPU computing\nimport tensorflow as tf\nphysical_device = tf.config.list_physical_devices('GPU')\ntf.config.experimental.set_memory_growth(physical_device[0], enable=True)\n\n# Model Prediction\nfrom core.detection import ModelZoo\nmodel = ModelZoo(ModelZoo.SSD_MobileNet_v2_320x320)\nimg, input_tensor = mo...
[ [ "tensorflow.config.list_physical_devices", "tensorflow.config.experimental.set_memory_growth" ] ]
arovir01/model-optimization
[ "92bfb45da34715eeff8849c2007cf3b734429120" ]
[ "tensorflow_model_optimization/python/core/internal/tensor_encoding/core/simple_encoder.py" ]
[ "# Copyright 2019, The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "tensorflow.nest.flatten", "tensorflow.nest.pack_sequence_as", "tensorflow.compat.v1.name_scope", "tensorflow.nest.map_structure" ] ]
julian-nunezm/requestsAnalysis
[ "349641eded803c77460fd1018f15f68782608424" ]
[ "docsRevision.py" ]
[ "import time, re\nfrom pprint import pprint\nfrom tensorflow.keras.preprocessing.text import text_to_word_sequence as ttws\n#https://github.com/first20hours/google-10000-english/blob/master/20k.txt\n\n#ToDo: Organize the structure to save the three totals for each document.\nfilepath = \"data/comms/\"\ndataSources ...
[ [ "tensorflow.keras.preprocessing.text.text_to_word_sequence" ] ]
asindel/SliTraNet
[ "a16d2a786b3e06dec4737dd11e5d6e830e8d3c8c", "a16d2a786b3e06dec4737dd11e5d6e830e8d3c8c" ]
[ "backbones/resnet3d.py", "data/data_utils.py" ]
[ "\"\"\"\nBased on: https://github.com/wei-tim/YOWO/blob/master/backbones_3d/resnet.py\nModifications for SliTraNet ResNet3d see below \n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport math\nfrom functools import partial\n\n__all__ = [\n ...
[ [ "torch.nn.functional.avg_pool3d", "torch.cat", "torch.nn.Sequential", "torch.nn.MaxPool3d", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv3d", "torch.nn.AdaptiveAvgPool3d", "torch.nn.BatchNorm3d" ], [ "numpy.round", "numpy.array", "numpy.float"...
themousepotato/yt
[ "6befef2bc0427250fd62395962599be41b193e65" ]
[ "yt/frontends/art/data_structures.py" ]
[ "import glob\nimport numpy as np\nimport os\nimport struct\nimport weakref\n\nfrom yt.geometry.oct_geometry_handler import \\\n OctreeIndex\nfrom yt.geometry.geometry_handler import \\\n YTDataChunk\nfrom yt.data_objects.static_output import \\\n Dataset, ParticleFile\nfrom yt.data_objects.octree_subset im...
[ [ "numpy.array", "numpy.empty", "numpy.zeros", "numpy.rint", "numpy.ones", "numpy.diff", "numpy.sqrt", "numpy.append", "numpy.fromfile", "numpy.fromstring" ] ]
jphacks/F_2007
[ "e18deaa4ca7779ce6826289d6502cacf8af5a755" ]
[ "api_test/getink.py" ]
[ "from transformers import AutoModel, AutoTokenizer\r\nimport torch \r\n#torchはサイズでかいからherokuにuploadするときはcpu版をrequirementsで指定する\r\n#bert-base-japaneseはcl-tohokuを入れないとうまくいかない\r\n#fugashiが無いとか言われたからインストール->ipadic dictionaryが無いと言われてる pip install ipadicで入れたらとりあえず動いた\r\n#numpyは重くてherokuの500MB制限に引っかかるからtorchのtensor形式で計算\r...
[ [ "torch.norm", "torch.no_grad", "torch.tensor" ] ]
NoaAizer/Cheat-Game-Detector
[ "58b9689b4b8266af1a71fea8b377cb850f892ee0" ]
[ "joint_model.py" ]
[ "import numpy as np\nimport pandas as pd\n\n# Read in the results from our CNN\npreds_cnn = pd.read_csv('predict_cnn.csv')\n# Read in the results from our Dense NN\npreds_nn = pd.read_csv('predict_nn.csv')\npreds_rnn = pd.read_csv('predict_rnn.csv')\n\n# Convering the results to arrays\npreds_cnn_array = preds_cnn....
[ [ "pandas.DataFrame", "pandas.read_csv", "numpy.load" ] ]
b-biswas/kndetect
[ "2a3a59ae1048490954c581986d7a9376840f0358" ]
[ "kndetect/features.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom scipy.optimize import minimize\nfrom tqdm import tqdm\n\nfrom kndetect.utils import extract_mimic_alerts_region\n\n\ndef get_feature_names(npcs=3):\n \"\"\"\n Create the list of feature names depending on the number of principal components.\n\n Parameters\n ...
[ [ "numpy.square", "numpy.zeros_like", "numpy.add", "numpy.zeros", "pandas.DataFrame.from_dict", "numpy.take", "numpy.argmax", "numpy.sqrt", "scipy.optimize.minimize", "numpy.unique" ] ]
RohitMohanty/AI-Pose-Detector
[ "fdc355ca859f79226f71952cdd814cf1e10dfa02" ]
[ "run_checkpoint.py" ]
[ "import argparse\nimport logging\nimport os\n\nimport tensorflow as tf\nfrom tf_pose.networks import get_network, model_wh, _get_base_path\n\nlogging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s')\n\nconfig = tf.compat.v1.ConfigProto()\nconfig.gpu_options.allocator_type = 'BFC'\ncon...
[ [ "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.profiler.ProfileOptionBuilder.float_operation", "tensorflow.compat.v1.get_default_graph", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.Session", "tensorflow.io.write_graph", "tensorflow.contrib.quantize.create_eval_...
miliadis/DeepVideoCS
[ "760851192d6b5a7b21ea05b3c202db02f39276f5" ]
[ "datasets/videocs.py" ]
[ "import torch.utils.data as data\nimport os.path\nimport imageio\nimport numpy as np\nimport torch\nimport math\nimport h5py\nimport glob\n\n\ndef get_hdf5_all_samples(videos):\n count = 0\n for video in videos:\n count += h5py.File(video, 'r')['label'].shape[0]\n return count\n\n\ndef make_dataset(...
[ [ "numpy.uint8", "numpy.asarray", "numpy.reshape", "numpy.floor" ] ]
crixspine/PSR
[ "1ff4f7a0331c55fc3dab35b57b06f7843fc42571" ]
[ "environment/GymEnv.py" ]
[ "import gym\nfrom autoencoder import DeepAutoEnc, SimpleAutoEnc\nfrom bin import Parameter\nfrom bin.Util import merge\nfrom numpy.random import randint\nfrom bin.MultiProcessSimulation import EvaluateMultiProcess, SimulateTrainDataMultiProcess, SimulateRunsOnCPSR\n\ndef getNumObservations(gameName):\n env = gym...
[ [ "numpy.random.randint" ] ]
DalavanCloud/UGESCO
[ "03f037b8c0e48b7a2fbefdac570d12241deb64e7" ]
[ "functions/get_wikidata_items.py" ]
[ "from SPARQLWrapper import SPARQLWrapper, JSON\nimport pandas as pd\n\ndef get_wikidata_item(predicat, objet):\n \"\"\"\n Use the WDQ service to get items by property and object.\n Return a panda dataframe with the items and their english label.\n \"\"\"\n sparql = SPARQLWrapper(\"https://query.wikid...
[ [ "pandas.io.json.json_normalize" ] ]
xueyuelei/tracklib
[ "d33912baf1bebd1605d5e9c8dfc31484c96628cc" ]
[ "gtt_eof_benchmark.py" ]
[ "#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport scipy.io as io\nimport tracklib.filter as ft\nimport tracklib.init as init\nimport tracklib.model as model\nimport tracklib.utils as utils\nimport matplotlib.pyplot as plt\n\n\ndef plot_ellipse(ax, x0, y0, C, N, *args, **kwargs):\n x...
[ [ "numpy.empty", "scipy.io.loadmat", "numpy.mean", "matplotlib.pyplot.figure", "scipy.io.savemat", "numpy.arange", "matplotlib.pyplot.show", "numpy.diag" ] ]
silent567/pytorch_DGCNN
[ "79bf5361b5cf21e5e2e3e0ccb21b716e2fc23b53" ]
[ "my_mlp.py" ]
[ "from __future__ import print_function\n\nimport os\nimport sys\nimport numpy as np\nimport torch\nimport random\nfrom torch.autograd import Variable\nfrom torch.nn.parameter import Parameter\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom tqdm import tqdm\nimport pdb\n\ns...
[ [ "torch.nn.Linear", "torch.nn.functional.nll_loss", "torch.autograd.Variable", "torch.nn.functional.l1_loss", "torch.nn.functional.dropout", "torch.nn.functional.log_softmax", "torch.nn.functional.mse_loss", "torch.nn.BatchNorm1d", "torch.nn.functional.relu", "torch.sum" ]...
jinwonkim93/MWPToolkit
[ "fb8bb918c022805e8c4fb91d812fdb37b46c9206" ]
[ "mwptoolkit/module/Graph/graph_module.py" ]
[ "# -*- encoding: utf-8 -*-\n# @Author: Yihuai Lan\n# @Time: 2021/08/29 22:00:28\n# @File: graph_module.py\n\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom mwptoolkit.module.Layer.graph_layers import PositionwiseFeedForward,LayerNorm\nfrom mwptoolkit.module.Graph.gcn import GCN\n...
[ [ "torch.nn.Linear", "torch.cat", "torch.stack", "torch.nn.ModuleList", "torch.nn.functional.relu", "torch.matmul", "torch.pow" ] ]
KyleDavisSA/pde-surrogate
[ "41ad2c9eb73c323e389174080f4b3df6cbd3c900" ]
[ "utils/load.py" ]
[ "\"\"\"\nLoad args and model from a directory\n\"\"\"\nimport torch\nfrom torch.utils.data import DataLoader, TensorDataset\nfrom argparse import Namespace\nimport h5py\nimport json\nimport meshio\nimport numpy as np\n\n\ndef load_args(run_dir):\n with open(run_dir + '/args.txt') as args_file: \n args = ...
[ [ "torch.FloatTensor", "torch.utils.data.TensorDataset", "numpy.zeros" ] ]
NValsted/KeysVizu
[ "7a4748498aa3ea2e48450e71208c1d33bfa6e664" ]
[ "particles/setup.py" ]
[ "# run with \"python setup.py build_ext --inplace\"\n\nfrom setuptools import setup\nfrom setuptools.command.build_ext import build_ext\n\nfrom Cython.Build import cythonize\nimport numpy as np\n\nlink_args = ['-static-libgcc',\n '-static-libstdc++',\n '-Wl,-Bstatic,--whole-archive',\n ...
[ [ "numpy.get_include" ] ]
skybristol/earthmap_cat_survey
[ "e38f1ad7171a768ee08fea4e53a39c0bdc8b0e68" ]
[ "earthmap_cat_survey/cli.py" ]
[ "import sys, getopt\nimport earthmap_cat_survey\nimport pandas as pd\nimport pickle\nfrom collections import Counter\nimport datetime\nimport os\nimport pylinkedcmd\n\ntry:\n import importlib.resources as pkg_resources\nexcept ImportError:\n import importlib_resources as pkg_resources\n\nfrom . import data\n\...
[ [ "pandas.DataFrame", "pandas.read_excel", "pandas.merge", "pandas.notnull" ] ]
chetanmreddy/imvoxelnet
[ "10dd35a96539af7b147be4bb03b0395cc164177e" ]
[ "mmdet3d/datasets/sunrgbd_monocular_dataset.py" ]
[ "import numpy as np\nfrom os import path as osp\nfrom mmcv.utils import print_log\n\nfrom mmdet.datasets import DATASETS\nfrom .sunrgbd_dataset import SUNRGBDDataset\nfrom mmdet3d.core.bbox import DepthInstance3DBoxes\nfrom .dataset_wrappers import MultiViewMixin\n\n\n@DATASETS.register_module()\nclass SUNRGBDMonoc...
[ [ "numpy.array", "numpy.mean", "numpy.eye", "numpy.stack", "numpy.abs" ] ]
ScriptBox99/facebook-faiss
[ "04d31fac53c609b6487a4cd6ead1c8b4ad926b0c" ]
[ "benchs/bench_polysemous_1bn.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nimport sys\nimport time\nimport numpy as np\nimport re\nimport faiss\nfrom multiprocessing.dummy import Pool as ThreadPoo...
[ [ "numpy.memmap" ] ]
wehak/reservoirpy
[ "d052145211e086a5156f605e994957f2b62894b1" ]
[ "reservoirpy/nodes/esn.py" ]
[ "# Author: Nathan Trouvain at 27/10/2021 <nathan.trouvain@inria.fr>\n# Licence: MIT License\n# Copyright: Xavier Hinaut (2018) <xavier.hinaut@inria.fr>\nfrom inspect import signature\nfrom typing import Sequence\nfrom multiprocessing import Manager\n\nimport numpy as np\nfrom joblib import Parallel, delayed\n\nfrom...
[ [ "numpy.zeros" ] ]
ZHUCUII/FinRL-Meta
[ "dcabce5eebd7225c2921cd959e4f52aa55e3b047" ]
[ "finrl_meta/data_processors/binance.py" ]
[ "import datetime as dt\nimport json\nimport urllib\nfrom typing import List\n\nimport pandas as pd\nimport requests\nimport os\nimport urllib\nimport zipfile\nfrom datetime import *\nfrom pathlib import Path\n\nfrom finrl_meta.data_processors._base import BaseProcessor\n\nfrom finrl_meta.config import (\nTIME_ZONE_...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.date_range" ] ]
Snoo-py/ksp_panel
[ "4eee6784c49a6bc14be25275d983d60090795e63" ]
[ "panel/orbital/ref_planet_plot.py" ]
[ "from matplotlib.patches import Ellipse\n\nfrom panel.planet_data import PLANET_DATA\n\n\n\nclass RefPlanetPlot(object):\n def __init__(self, axes):\n self._axes = axes\n self._ref_planet_name = None\n self._ref_planet_plot = None\n self._diameter = 0\n\n\n def _create_ref_planet(s...
[ [ "matplotlib.patches.Ellipse" ] ]
agdenadel/math-visualizations
[ "3353dee42ec900a0db07a6fc60d1199308f31846" ]
[ "math-visualizations/dynamical_systems/continuous.py" ]
[ "from matplotlib import pyplot as plt\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\n\r\n\r\n\r\n\r\n\r\n# Models continuous systems of DE's with Euler's method\r\ndef model_3d(function, parameters, x_initial, y_initial, z_initial, num_steps, delta_t):\r\n x = [0] * (num_steps + 1) # add one for initial value\r\n...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
joykour/COCO-Dataset-2018-Stuff-Segmentation-Challenge
[ "973ef2d75c1821c8348fd01a3f2b084c4243ebd2" ]
[ "Image Segmtation on COCO Dataset/keras_segmentation/data_utils/data_loader.py" ]
[ "\nimport numpy as np\nimport cv2\nimport glob\nimport itertools\nimport os\nfrom tqdm import tqdm\n\nfrom ..models.config import IMAGE_ORDERING\nfrom .augmentation import augment_seg\nimport random\n\nrandom.seed(0)\nclass_colors = [ ( random.randint(0,255),random.randint(0,255),random.randint(0,255) ) for _ in...
[ [ "numpy.max", "numpy.array", "numpy.reshape", "numpy.zeros", "numpy.rollaxis" ] ]
benlindsay/pbcluster
[ "fa641d685cf674b87bf892575f2d95029a6c0f15" ]
[ "tests/test_utils.py" ]
[ "# -*- coding:utf-8 -*-\n#\n# test_utils.py\n\nimport numpy as np\n\nfrom pbcluster.utils import get_graph_from_particle_positions\n\n\"\"\"Tests for utils module.\"\"\"\n\n\ndef test_get_graph_from_particle_positions_linear_chain():\n particle_positions = np.array([[0.25, 2], [3.25, 2], [3.75, 2]])\n box_len...
[ [ "numpy.array" ] ]
felixbosco/specklepy
[ "18f1d542f04cbe31fec8675791bf8350a09441c6" ]
[ "specklepy/core/analysis.py" ]
[ "import numpy as np\nimport os\n\nfrom astropy.io import fits\nfrom astropy.table import Table, Column\n\nfrom specklepy import imshow\nfrom specklepy.core import Aperture\nfrom specklepy.logging import logger\n\n\ndef aperture_analysis(file, index, radius, out_file=None, pixel_scale=1, recenter=False, debug=False)...
[ [ "numpy.sum", "numpy.argmax" ] ]
jackie840129/CF-AAN
[ "2b357bf5823837908f0fe04a22b47deaf9e3da4e" ]
[ "data/samplers/triplet_sampler.py" ]
[ "# encoding: utf-8\n\"\"\"\n@author: liaoxingyu\n@contact: liaoxingyu2@jd.com\n\"\"\"\n\nimport copy\nimport random\nimport torch\nfrom collections import defaultdict\n\nimport numpy as np\nfrom torch.utils.data.sampler import Sampler\n\n\nclass RandomIdentitySampler(Sampler):\n \"\"\"\n Randomly sample P id...
[ [ "torch.randperm", "numpy.random.choice" ] ]
gregjauvion/pno-ai
[ "5897cfc5b76ece9e2a72f0bdfafd44f14dc9e453" ]
[ "preprocess/pipeline.py" ]
[ "import os, random, copy\nimport pretty_midi\nfrom pretty_midi import ControlChange\nimport six\nfrom .sequence_encoder import SequenceEncoder\nimport numpy as np\nfrom helpers import vectorize\n\nclass PreprocessingError(Exception):\n pass\n\nclass PreprocessingPipeline():\n #set a random seed\n SEED = 18...
[ [ "numpy.copy", "numpy.asarray" ] ]
jangqh/Text_Classify_V10
[ "ef756ae7f4e080b33692f6419e995d3dec990283" ]
[ "10_bert_tensorflow/data_util_hdf5.py" ]
[ "#import codec\nimport random\nimport numpy as np\nimport multiprocessing\nfrom collections import Counter\nimport os\nimport pickle\nimport h5py\nimport time\nimport json\nimport jieba\nimport tensorflow as tf\nfrom model.config import Config\nimport pdb\n\n#定义常量\nLABEL_SPLITER = '__label__'\n\nPAD_ID = 0\nUNK_ID ...
[ [ "tensorflow.logging.info" ] ]
josuuribe/sapereaude
[ "2e221fa9c5cc5c1a5fa927146e15bfd950766009" ]
[ "backend/entropy/tests/test_fractal.py" ]
[ "import numpy as np\nimport unittest\n\nfrom entropy import petrosian_fd, katz_fd, higuchi_fd\n\nnp.random.seed(1234567)\nRANDOM_TS = np.random.rand(3000)\nSF_TS = 100\nPURE_SINE = np.sin(2 * np.pi * 1 * np.arange(3000) / 100)\n\n\nclass TestEntropy(unittest.TestCase):\n\n def test_petrosian_fd(self):\n p...
[ [ "numpy.random.seed", "numpy.arange", "numpy.random.rand", "numpy.round" ] ]
hmisty/coding
[ "83bc320ba781d40c298a79c1d5b769b3df1bffb5" ]
[ "ml/deeplearning/basic_operations.py" ]
[ "'''\nBasic Operations example using TensorFlow library.\nAuthor: Aymeric Damien\nProject: https://github.com/aymericdamien/TensorFlow-Examples/\n'''\n\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\n# Basic constant operations\n# The value returned by the constructor represents the output\n# o...
[ [ "tensorflow.multiply", "tensorflow.matmul", "tensorflow.Session", "tensorflow.constant", "tensorflow.placeholder", "tensorflow.add" ] ]
yennster/tensorflow
[ "0cc38aaa4064fd9e79101994ce9872c6d91f816b" ]
[ "tensorflow/python/eager/def_function_test.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.variables.Variable", "tensorflow.python.ops.math_ops.equal", "tensorflow.python.ops.array_ops.ones", "tensorflow.python.framework.ops.init_scope", "tensorflow.python.framework.ops.device", "tensorflow.python.platform.test.main", "tensorflow.python.ops.array_ops.p...
vedaldi/dynamic-video-depth
[ "274f5f59604a10121a2445f7b30df4a9ff075946" ]
[ "loggers/loggers.py" ]
[ "# Copyright 2021 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 applicable law or agreed t...
[ [ "numpy.array", "numpy.random.randint", "numpy.isnan", "numpy.random.rand" ] ]
sebPomme/offkeyboard
[ "89b6a5cecdf99593332a6920b3fd649c67254280" ]
[ "offkeyboard/__init__.py" ]
[ "import numpy as np\n\nfrom config import (\n NOTE_MIN,\n NOTE_MAX,\n MIN_VOLUME,\n SAMPLE_RATE,\n SAMPLES_PER_FRAME,\n)\nfrom dsp import (\n FRAMES_PER_FFT,\n SAMPLES_PER_FFT,\n note_to_fftbin,\n freq_from_autocorr\n)\nfrom note_reader import NoteReader\nfrom note_utils import SILENCE_NO...
[ [ "numpy.linalg.norm", "numpy.zeros" ] ]
vedb/data_analysis
[ "b46f58ba424680353d3abd0014a7d0a339bf6e6c" ]
[ "data_analysis/visualization/gaze_quality.py" ]
[ "import matplotlib.pyplot as plt\nfrom matplotlib import cm\nimport numpy as np\nimport cv2\nimport scipy.interpolate\nfrom scipy.stats import multivariate_normal\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\ndef plot_gaze_accuracy(reference_pos, gaze_pos, confidence):\n \"\"\"\"\"\"\n horizont...
[ [ "matplotlib.pyplot.text", "matplotlib.pyplot.xlim", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.column_stack", "matplotlib.pyplot.axes", "numpy.array", "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot...
Karol-Perec/hmr-studio
[ "1a8dea137d1e707cbadbfa62bdd6425a117ec71d" ]
[ "src/util/data_utils2.py" ]
[ "\"\"\"\nUtils for data loading for training.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom glob import glob\nfrom os.path import (\n basename,\n dirname,\n join,\n)\n\nimport tensorflow as tf\n\n\ndef parse_example_proto(exa...
[ [ "tensorflow.matmul", "tensorflow.ones", "tensorflow.reshape", "tensorflow.reverse", "tensorflow.to_float", "tensorflow.tile", "tensorflow.stack", "tensorflow.contrib.image.rotate", "tensorflow.parse_single_example", "tensorflow.cast", "tensorflow.image.decode_jpeg", ...
PawelRosikiewicz/Swissroads
[ "97d65ef8977b111de8feb33d7a3596d6ff5bf6be" ]
[ "src/utils/annotated_pie_charts.py" ]
[ "# ************************************************************************* #\n# Author: Pawel Rosikiewicz # \n# Copyrith: IT IS NOT ALLOWED TO COPY OR TO DISTRIBUTE #\n# these file without written ...
[ [ "matplotlib.font_manager.FontProperties", "numpy.sum", "matplotlib.pyplot.subplots", "numpy.sign", "matplotlib.rcParams.update", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.Circle", "numpy.deg2rad", "matplotlib.pyplot.show", "numpy.linspace", "pandas.Series", ...
haydard/wyrm
[ "ff3f675ea71a45f1dd91ecbc5944229ebb3342ec" ]
[ "wyrm/plot.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"Plotting methods.\n\nThis module contains various plotting methods. There are two types of\nplotting methods: the Primitives and the Composites. The Primitives are\nthe most basic and offer simple, single-plot representations. The\nComposites are composed of several primitives and of...
[ [ "matplotlib.pyplot.text", "matplotlib.ticker.IndexFormatter", "numpy.tile", "numpy.mean", "numpy.where", "matplotlib.pyplot.gcf", "matplotlib.patches.Rectangle", "numpy.max", "matplotlib.pyplot.colorbar", "matplotlib.axes.Axes", "matplotlib.pyplot.subplots", "numpy....
juliomrodrigues/Regressao-Logistica-Classificador
[ "fdbe676c63d54cb0cfe5f77980b74631db8823c9" ]
[ "treinamento_regressao_logistica.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nBase de Dados: Dua, D. and Graff, C. (2019). UCI Machine Learning Repository \r\n[http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School \r\nof Information and Computer Science.\r\n\"\"\"\r\nimport pandas\r\nimport numpy as np\r\nfrom sklearn.preprocessing...
[ [ "sklearn.preprocessing.LabelEncoder", "sklearn.metrics.confusion_matrix", "sklearn.model_selection.StratifiedKFold", "numpy.asarray", "numpy.zeros", "sklearn.preprocessing.StandardScaler", "numpy.mean", "sklearn.metrics.accuracy_score", "sklearn.linear_model.LogisticRegression"...
conferency/find-my-reviewers
[ "92d17053e89b58451c21aa51c5c2b26e4908ff71" ]
[ "utilities/tokeniser.py" ]
[ "import pandas as pd\nimport sqlite3\nimport nltk\nfrom nltk.corpus import stopwords\nimport glob\nfrom io import StringIO\nfrom pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter\nfrom pdfminer.converter import TextConverter\nfrom pdfminer.layout import LAParams\nfrom pdfminer.pdfpage import PDFPage\...
[ [ "pandas.read_sql_query" ] ]
JinyongJeong/Deeplabv3_pytorch_Cityscape_and_Apolloscape
[ "82525382a04b0390f20e8feca9c83c3cd7a1c75c" ]
[ "inference_urban_dataset_ros.py" ]
[ "# camera-ready\nimport rospy\nfrom std_msgs.msg import String\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge, CvBridgeError\n#from cv_bridge.boost.cv_bridge_boost import getCvType\nimport sys\nimport os\ndefault_path = os.path.dirname(os.path.abspath(__file__))\n\nsys.path.append(os.path.join(d...
[ [ "matplotlib.use", "numpy.array", "torch.autograd.Variable", "torch.from_numpy", "numpy.transpose", "torch.argmax", "torch.nn.DataParallel" ] ]
pwamburu/pwamburu.github.io
[ "a17f6d2f799057ce7d0e87671e80f4db3b5c5ebd" ]
[ "portfolio/2021 Bitcoin Sentiment Analysis/Text_Analysis_LM_Dict.py" ]
[ "\n\"\"\" Demonstrate\n 1. NLP (Natural Language Processing)\n 2. Marry bitcoin.txt with the lexicon\n 3. Generate a wordcloud from bitcoin text\n\n.\"\"\"\n\nimport re\nimport nltk\nfrom collections import Counter\nfrom wordcloud import WordCloud # using python 3.7\nimport matplotlib\nmatplotlib.use(\"TkA...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
bigsnarfdude/cnn-rnn
[ "d0a5a57aefd9db5b7368ee15e821c5e5c2a551e7" ]
[ "model.py" ]
[ "#!/usr/bin/env python\n#\n# Copyright 2016 Anil Thomas\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless...
[ [ "numpy.loadtxt", "sklearn.metrics.roc_auc_score" ] ]
srgnuclear/shogun
[ "9288b6fa38e001d63c32188f7f847dadea66e2ae", "9288b6fa38e001d63c32188f7f847dadea66e2ae" ]
[ "examples/undocumented/python_modular/kernel_fisher_modular.py", "examples/undocumented/python_modular/evaluation_cross_validation_multiclass_storage.py" ]
[ "#!/usr/bin/env python\nfrom tools.load import LoadMatrix\nfrom numpy import where\nlm=LoadMatrix()\n\ntraindat = lm.load_dna('../data/fm_train_dna.dat')\ntestdat = lm.load_dna('../data/fm_test_dna.dat')\nlabel_traindat = lm.load_labels('../data/label_train_dna.dat')\nparameter_list = [[traindat,testdat,label_train...
[ [ "numpy.where" ], [ "numpy.random.seed", "numpy.random.randn" ] ]
VigneshBaskar/dvc_tutorial
[ "0b91c7117417ba6a96b66bdee03776217390b670" ]
[ "code/featurization.py" ]
[ "import pandas as pd\nimport numpy as np\nimport scipy.sparse as sparse\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.feature_extraction.text import TfidfTransformer\ntry: import cPickle as pickle # python2\nexcept: import pickle # python3\n\nnp.set_printoptions(suppress=Tru...
[ [ "numpy.set_printoptions", "scipy.sparse.hstack", "sklearn.feature_extraction.text.CountVectorizer", "pandas.read_csv", "sklearn.feature_extraction.text.TfidfTransformer" ] ]
dream8450/musegan
[ "bbbd9f9a7cde3389e4b3194a2543eebeb47870a4", "bbbd9f9a7cde3389e4b3194a2543eebeb47870a4" ]
[ "src/musegan/presets/ops.py", "v1/musegan/modules.py" ]
[ "\"\"\"Tensorflow ops.\"\"\"\nimport tensorflow as tf\n\nCONV_KERNEL_INITIALIZER = tf.truncated_normal_initializer(stddev=0.05)\nDENSE_KERNEL_INITIALIZER = tf.truncated_normal_initializer(stddev=0.05)\n\ndense = lambda i, u: tf.layers.dense(\n i, u, kernel_initializer=DENSE_KERNEL_INITIALIZER)\nconv2d = lambda i...
[ [ "tensorflow.layers.conv2d_transpose", "tensorflow.layers.conv3d", "tensorflow.layers.conv3d_transpose", "tensorflow.layers.batch_normalization", "tensorflow.layers.conv2d", "tensorflow.layers.dense", "tensorflow.truncated_normal_initializer" ], [ "tensorflow.expand_dims", "...
clussier/DeepCDR
[ "011f155c0ffb1abf61ae403bf3b9247398676ac7" ]
[ "prog/utils.py" ]
[ "from __future__ import print_function\n\nimport scipy.sparse as sp\nimport numpy as np\nfrom scipy.sparse.linalg.eigen.arpack import eigsh, ArpackNoConvergence\n\n\ndef encode_onehot(labels):\n classes = set(labels)\n classes_dict = {c: np.identity(len(classes))[i, :] for i, c in enumerate(classes)}\n lab...
[ [ "numpy.extract", "numpy.array", "numpy.zeros", "numpy.ones", "scipy.sparse.eye", "numpy.eye", "numpy.argmax", "scipy.sparse.linalg.eigen.arpack.eigsh", "scipy.sparse.isspmatrix_coo", "scipy.sparse.csr_matrix", "numpy.dtype", "numpy.vstack" ] ]
iSoron/Prescient
[ "6289c06a5ea06c137cf1321603a15e0c96ddfb85" ]
[ "prescient/gosm/sources/sources.py" ]
[ "# ___________________________________________________________________________\n#\n# Prescient\n# Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC\n# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.\n# Government retains certain rights in this software.\n# This s...
[ [ "numpy.isnan", "pandas.concat", "matplotlib.pyplot.savefig", "pandas.date_range", "matplotlib.pyplot.figure", "pandas.Timestamp", "pandas.Series" ] ]
todd-dembrey/srs-paper
[ "c5e6c4e2f3f280d7e81801142d37e384270e00a5" ]
[ "dicom_process/output.py" ]
[ "import math\nimport os\n\nfrom adjustText import adjust_text\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import ImageGrid\nimport numpy as np\n\n\nplt.style.use('classic')\nplt.rc('font', **{'family': 'sans-serif', 'sans-serif': ['DejaVu Sans'], 'size': 8})\nplt.rc('xtick', labelsize='x-small')\...
[ [ "numpy.empty", "numpy.asarray", "matplotlib.pyplot.plot", "numpy.ones", "matplotlib.pyplot.subplots", "matplotlib.pyplot.rc", "numpy.flipud", "numpy.std", "matplotlib.pyplot.hist", "matplotlib.pyplot.style.use", "matplotlib.pyplot.show", "matplotlib.pyplot.figaspect...
Bhanuprakash-ch/h2o-3
[ "c75bc5d2dc644cc8c09df755185a4cc6e34e0d1a" ]
[ "h2o-py/tests/testdir_munging/unop/pyunit_frame_reducers.py" ]
[ "import sys\nsys.path.insert(1,\"../../../\")\nimport h2o\nfrom tests import pyunit_utils\n\n\n\nimport numpy as np\nimport random\n\ndef frame_reducers():\n \n \n\n data = [[random.uniform(-10000,10000) for r in range(10)] for c in range(10)]\n h2o_data = h2o.H2OFrame(python_obj=zip(*data))\n np_dat...
[ [ "numpy.max", "numpy.sum", "numpy.array", "numpy.min" ] ]
michaelaye/dask
[ "ec16e5ff53c4ff660267061323727ddfbb05f588" ]
[ "dask/array/core.py" ]
[ "import copy\nimport math\nimport operator\nimport os\nimport pickle\nimport re\nimport sys\nimport traceback\nimport uuid\nimport warnings\nfrom bisect import bisect\nfrom collections.abc import Iterable, Iterator, Mapping\nfrom functools import partial, wraps\nfrom itertools import product, zip_longest\nfrom numb...
[ [ "numpy.max", "numpy.array", "numpy.isnan", "numpy.empty", "numpy.asarray", "numpy.errstate", "numpy.median", "numpy.ones", "numpy.asanyarray", "numpy.can_cast", "numpy.isscalar", "numpy.prod", "numpy.searchsorted", "numpy.dtype" ] ]
evyatarmichlis/IML.HUJI
[ "b0146f83258ee709356f4d6bc3d812b50ec10f1a" ]
[ "IMLearn/learners/regressors/polynomial_fitting.py" ]
[ "from __future__ import annotations\nfrom typing import NoReturn\nfrom . import LinearRegression\nfrom ...base import BaseEstimator\nimport numpy as np\nimport IMLearn.metrics.loss_functions as loss\n\nclass PolynomialFitting(BaseEstimator):\n \"\"\"\n Polynomial Fitting using Least Squares estimation\n \...
[ [ "numpy.vander" ] ]
medtray/DAME
[ "ce8edcdfafe146d2b82486b8619202aa5342b779" ]
[ "train.py" ]
[ "import argparse\nimport gc\nimport os\nimport random\nfrom typing import AnyStr\nfrom typing import List\nimport ipdb\nimport krippendorff\nfrom collections import defaultdict\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nfrom torch.optim.lr_scheduler import LambdaLR\nfrom torch.utils.data import ...
[ [ "torch.device", "torch.cuda.manual_seed_all", "numpy.random.seed", "pandas.DataFrame", "torch.utils.data.random_split", "torch.manual_seed", "torch.cuda.is_available", "numpy.argmax", "torch.utils.data.DataLoader", "torch.load", "torch.utils.data.Subset" ] ]
itaouil/Geodemographic-Modelling
[ "581cea381ebc381dda8b6d29ef97227137d44021" ]
[ "modules/ann_tuned.py" ]
[ "\"\"\"\n ANN implementation (Keras).\n\"\"\"\n\nimport keras # DNN library\nfrom preprocessing import * # Data preprocessing\nfrom keras.models import Sequential # ANN model\nfrom keras.layers import Dense # ANN layers\nfrom keras.layers import Dropout # ANN regulatization...
[ [ "sklearn.model_selection.GridSearchCV" ] ]
lluisotavio/MLExp
[ "6ef895da867bbcc6dceb2405d62cbe3b436d62d5" ]
[ "numerics/timeint.py" ]
[ "import numpy as np\n \nclass ExplicitIntegrator:\n\n def __init__(self, coeffs, weights, right_operator):\n\n self.coeffs = coeffs\n self.weights = weights\n self.right_operator = right_operator\n self.n_stages = len(self.coeffs)\n\n def step(self, variables_state_initial, dt):...
[ [ "numpy.array", "numpy.zeros" ] ]
yang-233/mmsa
[ "eed7b943746041b735d8a7af8d60b6457f0284f6" ]
[ "preprocess/preprocess_rcnn_data.py" ]
[ "import sys\nsys.path.append(\"/home/ly/workspace/mmsa\")\nimport os\nimport pickle\nimport numpy as np\nfrom typing import *\nfrom tqdm import tqdm\nfrom collections import OrderedDict\nfrom utils.load_yelp import load_data\n\nbase_dir = os.path.join(\"data\",\"yelp-vistanet\")\n\ndef load_rcnn_features(i): \n ...
[ [ "numpy.load" ] ]
DrAtomic/whiteboard_parse
[ "704484df9c89ef92125d062dc6f8a79c3fba0fe6" ]
[ "delentry.py" ]
[ "import pandas as pd\nimport os\n\npwd = os.getcwd()\nx = pd.read_csv(pwd + \"/data/gathered_data.csv\")\n\n\nx = x[0:-100]\n\n\nx.to_csv(pwd + \"/data/gathered_data.csv\", index=False)\n" ]
[ [ "pandas.read_csv" ] ]
styler00dollar/Colab-docker-aimet
[ "9e70d1e3729be8e890bc58e1f5af30a706a15e96" ]
[ "Examples/torch/compression/spatial_svd_cp.py" ]
[ "# =============================================================================\n#\n# @@-COPYRIGHT-START-@@\n#\n# Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the f...
[ [ "torch.device", "torch.cuda.is_available" ] ]
p-s-vishnu/cassava-leaf-disease-classification
[ "41f26cb6b87f27f49db9a4d5dadcebb153b250a5" ]
[ "cassava/train.py" ]
[ "import time\n\nimport numpy as np\nimport torch\nfrom utils import AverageMeter, cutmix, time_since\n\nfrom cassava import config\n\n\ndef train_fn(train_loader, model, criterion, optimizer, epoch, scheduler, device):\n batch_time = AverageMeter()\n data_time = AverageMeter()\n losses = AverageMeter()\n\n...
[ [ "numpy.random.rand" ] ]
GilmoreDM/tropycal
[ "efaca87aee7482c950a604a208a4f9cd58d8cef7" ]
[ "src/tropycal/tracks/nrl_dataset.py" ]
[ "r\"\"\"Functionality for storing and analyzing an entire cyclone dataset.\"\"\"\n\nimport calendar\nimport numpy as np\nimport pandas as pd\nimport re\nimport scipy.interpolate as interp\nimport scipy.stats as stats\nimport urllib\nimport warnings\nimport time\nfrom datetime import datetime as dt,timedelta\n#Impor...
[ [ "matplotlib.pyplot.arrow", "numpy.copy", "numpy.where", "numpy.cos", "numpy.cumsum", "numpy.max", "numpy.sin", "numpy.nan_to_num", "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.nanmin", "matplotlib.pyplot.tick_params", ...
lnsongxf/coding-for-economists
[ "74a6b80293c716ced12acf4bb249fc77ae9e70dd" ]
[ "data_set_prep.py" ]
[ "import pandas as pd\nimport os\nfrom bs4 import BeautifulSoup\nfrom bs4.element import Comment\nimport urllib.request\nimport geopandas as gpd\nimport shapely.geometry\n\n\ndef star_wars_data():\n \"\"\" Saves star wars character data with set\n datatypes and in pickle format.\n \"\"\"\n df = pd.re...
[ [ "pandas.to_datetime", "pandas.Grouper" ] ]
ATMOcanes/Fiedler_notebooks
[ "d6ba1ed0625c9780035258c608d52cd12ad8ae6a" ]
[ "Fiedler_notebooks_originals/Python_versions/n060_sympyschemes.py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\n\nfrom sympy import symbols,solve\nimport numpy as np\nimport matplotlib.pyplot as plt\nget_ipython().run_line_magic('matplotlib', 'inline')\nfrom IPython.core.display import HTML\nimport urllib.request\n\n\n# In[2]:\n\n\nHTML(urllib.request.urlopen('http://metrprof.xyz/metr4323.cs...
[ [ "numpy.linspace", "matplotlib.pyplot.plot" ] ]
pstjohn/Collocation
[ "75d27de7ea25fc0953c1f9185d6399dd5a204182" ]
[ "collocation/BaseCollocation.py" ]
[ "import numpy as np\nimport pandas as pd\nimport casadi as cs\n\n\nclass BaseCollocation(object):\n\n def __init__(self, nk=20, d=2):\n\n # Set up defaults for these collocation parameters (can be re-assigned\n # prior to collocation initialization\n self.nk = nk\n self.d = d\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.isnan", "numpy.asarray", "numpy.zeros", "pandas.DataFrame", "pandas.Series", "numpy.all" ] ]
kitteltom/probabilistic-energy-forecasting
[ "6ebd4130e42d1b0808e5e9499acf3fb401b47315" ]
[ "main.py" ]
[ "import pandas as pd\nimport numpy as np\nimport datetime as dt\nimport argparse\n\nfrom models.kalman_filter import KalmanFilter\nfrom models.kd_ic import KDIC\nfrom models.log_normal_ic import LogNormalIC\nfrom models.deep_ar import DeepAR\nfrom models.last_week import LastWeek\n\nDATA_PATH = './data/smart_meters...
[ [ "pandas.read_csv", "numpy.mean", "numpy.arange", "numpy.unique" ] ]
zwt16300180060/CORLA18
[ "f03af7a7b514746f40426bb204c531fabcd10baf" ]
[ "code/ballot_comparison.py" ]
[ "from __future__ import division, print_function\nimport math\nimport numpy as np\nimport numpy.random\nimport scipy as sp\nimport scipy.stats\n\n\ndef ballot_comparison_pvalue(n, gamma, o1, u1, o2, u2, reported_margin, N, null_lambda=1):\n \"\"\"\n Compute the p-value for a ballot comparison audit using Kapl...
[ [ "numpy.min", "numpy.exp", "numpy.log" ] ]
BerlinUnited/nncg
[ "ddced6e0e2449ab40d037b2d59547829a55544f4" ]
[ "applications/tests.py" ]
[ "from nncg.nncg import NNCG\nfrom applications.daimler.loader import random_imdb, load_images, finish_db\nimport tensorflow as tf\nfrom tensorflow.keras.applications.vgg16 import VGG16\nfrom tensorflow.keras.applications.vgg19 import VGG19\nfrom tensorflow.keras.layers import Flatten, MaxPooling2D, Convolution2D, D...
[ [ "tensorflow.keras.applications.vgg19.VGG19", "tensorflow.keras.applications.vgg16.VGG16", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.models.Sequential", "tensorflow...
SS-hj/onlinehd
[ "be027372d49e81dee07947b55a71f4d8c2ae6857" ]
[ "test.py" ]
[ "from time import time\n\nimport torch\nimport sklearn.datasets\nimport sklearn.preprocessing\nimport sklearn.model_selection\nimport numpy as np\nimport pandas as pd\n\nimport onlinehd\n\n# loads simple mnist dataset\ndef load():\n # train data\n data=pd.read_csv('C:/onlinehd/proj_data/train_set.csv')\n x...
[ [ "numpy.array", "pandas.read_csv", "torch.cuda.is_available", "torch.from_numpy" ] ]
jackyin68/ner-bio-generator
[ "64a5f3ef0208cf7f183ec0977df9286ff6bd53a1" ]
[ "data_utils.py" ]
[ "# encoding = utf8\nimport os\nimport re\nimport math\nimport codecs\nimport random\nimport numpy as np\nimport jieba\n\njieba.initialize()\ncurrent_dir = os.path.dirname(os.path.abspath(__file__))\njieba.load_userdict(os.path.join(current_dir, \"config\", \"user_dict.txt\"))\n\n\ndef create_dico(item_list):\n \...
[ [ "numpy.random.uniform" ] ]
pavanvvce/mesh-transformer-jax
[ "4f87552cc362d4aa2beb70a2089064807dab80eb" ]
[ "app_demo.py" ]
[ "import torch\nfrom transformers import AutoTokenizer, GPTJForCausalLM\nprint(\"Dependencies imported\")\n\n\n# configurations for GPT-J\n\n#tokenizer = AutoTokenizer.from_pretrained(\"gpt2\")\ntokenizer = AutoTokenizer.from_pretrained(\"EleutherAI/gpt-j-6B\")\nprint(\"Loaded tokenizer\")\n#model = GPTJForCausalLM....
[ [ "pandas.read_csv", "torch.load" ] ]
daydreaming666/GenshinArtScanner
[ "fbae3ddd13945a7ff1b9b1c3dc9f0037454e9379" ]
[ "ArtScanner/Tools/model_trainer/train_model.py" ]
[ "import json\nimport random as rd\n\nimport numpy as np\nimport tensorflow as tf\nfrom PIL import ImageFont, Image, ImageDraw\nfrom tensorflow import keras\nfrom tensorflow.keras.backend import ctc_decode\nfrom tensorflow.keras.layers import Input, Reshape, Dense, Dropout, Bidirectional, LSTM\nfrom tensorflow.keras...
[ [ "numpy.random.choice", "tensorflow.ones", "tensorflow.keras.models.Model", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.math.count_nonzero", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.LSTM", "numpy.uint8", "tens...
TeaKatz/NLP_Preprocessors
[ "ebecbbced15d325f0c0c1c3e9024879fcd9ad614" ]
[ "src/nlp_preprocessors/tokenizer/SignalTokenizer.py" ]
[ "import math\nimport librosa\nimport numpy as np\n\nfrom .utilities import array2str\nfrom .utilities import shorten_signal\nfrom .BaseTokenizer import BaseTokenizer\nfrom .ImageTokenizer import ImageTokenizer\n\n\nclass SignalTokenizer(BaseTokenizer):\n def __init__(self, \n num_embeddings: int,...
[ [ "numpy.random.seed", "numpy.array", "numpy.pad" ] ]
RunningGump/coursera-ml-py
[ "7287a0c143660e4e10ea019607c9fc818fe1367a" ]
[ "machine-learning-ex8/ex8/ex8_cofi.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.io as scio\nimport scipy.optimize as opt\n\nimport cofiCostFunction as ccf\nimport checkCostFunction as cf\nimport loadMovieList as lm\nimport normalizeRatings as nr\n\n\nplt.ion()\nnp.set_printoptions(formatter={'float': '{: 0.6f}'.format})\n\n# ==...
[ [ "matplotlib.pyplot.ion", "matplotlib.pyplot.colorbar", "numpy.dot", "numpy.set_printoptions", "matplotlib.pyplot.xlabel", "scipy.io.loadmat", "numpy.random.randn", "matplotlib.pyplot.figure", "numpy.where", "scipy.optimize.fmin_cg", "matplotlib.pyplot.ylabel", "nump...
jakelishman/qiskit-aer
[ "61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9", "61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9" ]
[ "qiskit/providers/aer/pulse/controllers/unitary_controller.py", "qiskit/providers/aer/pulse/controllers/mc_controller.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2019, 2020.\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/L...
[ [ "numpy.array", "numpy.zeros", "numpy.random.RandomState", "numpy.exp", "scipy.linalg.blas.get_blas_funcs", "numpy.iinfo" ], [ "numpy.array", "numpy.zeros", "numpy.random.RandomState", "numpy.sum", "numpy.arange", "scipy.linalg.blas.get_blas_funcs", "numpy.ii...
schlegelp/neuprint-python
[ "78098828d8049e3a052b9895256653568c396063" ]
[ "neuprint/neuroncriteria.py" ]
[ "import re\nimport copy\nimport inspect\nimport functools\nimport collections.abc\nfrom itertools import chain\nfrom textwrap import indent, dedent\nfrom collections.abc import Iterable, Collection\n\nimport numpy as np\nimport pandas as pd\n\nfrom .utils import make_args_iterable, IsNull, NotNull\nfrom .client imp...
[ [ "numpy.issubdtype", "numpy.asarray" ] ]
solalatus/justcause
[ "af6240cbcf33ba42b8e784703fb0d92e1396f937" ]
[ "tests/test_evaluation.py" ]
[ "from itertools import islice\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.linear_model import LinearRegression\n\nfrom justcause.evaluation import calc_scores, evaluate_ite, summarize_scores\nfrom justcause.learners import SLearner\nfrom justcause.metrics import pehe_score\n\n\ndef test_single_evaluati...
[ [ "numpy.full", "sklearn.linear_model.LinearRegression", "pandas.DataFrame", "numpy.mean", "numpy.arange" ] ]
yuhonghong66/CNTK
[ "75b0141b4844160a20f47c54b673e8da5bd1dbea" ]
[ "bindings/python/cntk/tests/onnx_test_helper.py" ]
[ "# Copyright (c) Microsoft. All rights reserved.\n# Licensed under the MIT license. See LICENSE.md file in the project root\n# for full license information.\n# ==============================================================================\n\nimport os\nimport re\nimport numpy as np\nimport scipy\nimport cntk as C\n...
[ [ "numpy.array", "numpy.arange", "numpy.shape", "numpy.transpose" ] ]
CS6780/approx-clustering
[ "7816d0add92d5458a1534e30ea15ebfa83b01605" ]
[ "src/submodular_demo.py" ]
[ "\nfrom sklearn.datasets.samples_generator import make_blobs\nfrom sklearn.metrics.pairwise import pairwise_distances\n\nimport numpy as np\nimport math\nimport random\n\n# np.random.seed(17)\n\n# H_PERC = 100\n\n\n\n##############################################################################\n\n\n\n#############...
[ [ "numpy.random.choice", "numpy.zeros", "numpy.random.random_sample", "sklearn.metrics.pairwise.pairwise_distances", "sklearn.datasets.samples_generator.make_blobs" ] ]
delelawson/Data-Wrangling-Challenge
[ "f531d7db1cd2b8a36e17690c760bf9415832090b" ]
[ "Road_safety_Challenge/Script/Python_script.py" ]
[ "#step 1: Import the required libraries needed for this script\n# using pandas\n# using beautifulsoup would have been a good option also but its a framework\n# so for this task , we are using only pandas library\nimport pandas as pd\n\n\n# step 2: Create a function that runs the necessary scripts and return the fi...
[ [ "pandas.read_html" ] ]
flowersteam/spatio-temporal-language-transformers
[ "a33a9bc4748586ef08f9768de2aafd76de71823c" ]
[ "src/utils/util.py" ]
[ "import numpy as np\nimport random\nimport torch\nimport os\nimport pickle\nimport json\n\nimport logging\n\n\ndef setup_logger(logger_name, log_file, level=logging.INFO):\n l = logging.getLogger(logger_name)\n formatter = logging.Formatter('%(message)s')\n fileHandler = logging.FileHandler(log_file, mode=...
[ [ "numpy.random.seed", "torch.manual_seed", "tensorflow.set_random_seed" ] ]
ggzhang0071/pytorch_geometric-1
[ "80717cec2abfa6ff0951834cf4d7b1641b7952b1" ]
[ "prune.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport networkx as nx\n\ndef community_layout(g, partition):\n \"\"\"\n Compute the layout for a modular graph.\n\n\n Arguments:\n ----------\n g -- networkx.Graph or networkx.DiGraph instance\n graph to plot\n\n partition -- dict mappin...
[ [ "matplotlib.pyplot.show" ] ]
Meta-HG/MetaHG
[ "0a4448a5a489c8efe0d927895183e09d9874685a" ]
[ "metalearning/meta.py" ]
[ "import torch\nimport numpy as np\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch import optim\nfrom metalearning.learner import Learner\nfrom utils import get_performance\n\n\n\nclass Meta(nn.Module):\n def __init__(self, args):\n super(Meta, self).__init__()\n\n self.updat...
[ [ "torch.autograd.grad", "numpy.array", "torch.no_grad", "torch.nn.functional.softmax" ] ]
marekventur/ReAgent
[ "c114235b9810fe66a4ba854fbf37fbfb3251e6f4" ]
[ "reagent/evaluation/ope_adapter.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport logging\n\nimport torch\nfrom reagent.evaluation.cpe import (\n CpeEstimate,\n CpeEstimateSet,\n bootstrapped_std_error_of_mean,\n)\nfrom reagent.evaluation.evaluation_data_page import EvaluationDataP...
[ [ "torch.zeros", "torch.argmax", "torch.tensor", "torch.mean", "torch.dot" ] ]
XieHanS/ECG_UNet
[ "199bc9716e218d9546681535f9302b02be721342" ]
[ "generate_labels.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Apr 21 13:37:37 2019\r\n\r\n@author: Winham\r\n\r\ngenerate_labels.py: 用于生成训练时的标签,将json文件中的信息转换为.npy文件存储\r\n注意:运行前先在同目录下新建一个文件夹119_LABEL\r\n\r\n\"\"\"\r\n\r\nimport os\r\nimport numpy as np\r\nimport json\r\n\r\nMask_path = 'G:/ECG_UNet/119_MASK/'\r\nLabel_path =...
[ [ "numpy.round", "numpy.save", "numpy.zeros" ] ]
chanhakim/deepthought
[ "9f5dd5c7a21da51b65d6049e7a19e29fc3a072f9" ]
[ "deepthought3/.pylearn2ext/HingeLoss.py" ]
[ "\"\"\"\nCreated on Apr 30, 2014\n\n@author: \noriginal code by Kyle Kastner from\nhttps://github.com/kastnerkyle/pylearn2/blob/svm_layer/pylearn2/models/mlp.py\nadapted by Sebastian Stober according to recent API changes in pylearn2\n\"\"\"\n\nimport numpy as np\n\n# TODO: replace imports\n# from theano import con...
[ [ "numpy.zeros" ] ]
Chenyang-Lu/mono-semantic-occupancy
[ "b1063662fcf5b99662c42deec8bb50e2654ab030" ]
[ "data_loader.py" ]
[ "import pandas as pd\nimport os\nimport torch\nimport random\nfrom skimage import io, transform\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, utils\n\n\nclass OccMapDataset(Dataset):\n\n def __init__(self, csv_file, tra...
[ [ "pandas.read_csv", "torch.utils.data.DataLoader", "numpy.expand_dims", "torch.from_numpy" ] ]
mattdangerw/gnn
[ "f39d3ea0d8fc6e51cf58814873fc1502c12554ae" ]
[ "tensorflow_gnn/graph/keras/layers/parse_example.py" ]
[ "\"\"\"The Keras wrapper for tfgnn.parse_example() and related functionality.\"\"\"\n\nimport tensorflow as tf\n\nfrom tensorflow_gnn.graph import graph_tensor as gt\nfrom tensorflow_gnn.graph import graph_tensor_io as io\n\n\n# Function dispatch does not work for extension types outside TF (b/205710036)\n# so this...
[ [ "tensorflow.keras.utils.register_keras_serializable" ] ]
wilsaj/pint
[ "a2b2a6ea9ff480a168358af642cf36c7f3c5d0e4" ]
[ "sonde/formats/espey.py" ]
[ "\"\"\"\n sonde.formats.espey\n ~~~~~~~~~~~~~~~~~\n\n This module implements the weird espey YSI format\n\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom datetime import datetime\nimport pkg_resources\nimport re\nfrom StringIO import StringIO\nimport struct\nimport time\nimport warnings\n\nimport n...
[ [ "numpy.array", "numpy.dtype" ] ]