repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
s0nskar/sunpy
[ "60ca4792ded4c3938a78da7055cf2c20e0e8ccfd" ]
[ "examples/gallery/solar_cycle_example.py" ]
[ "\"\"\"\n===============\nThe Solar Cycle\n===============\n\nThis example shows the current and possible next solar cycle.\n\"\"\"\nimport datetime\nimport matplotlib.pyplot as plt\n\nimport sunpy.lightcurve as lc\nfrom sunpy.data.sample import NOAAINDICES_LIGHTCURVE, NOAAPREDICT_LIGHTCURVE\n\n####################...
[ [ "matplotlib.pyplot.text", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
cameronfr/trusat-backend
[ "3c88b271e882b042b9a5794879d731fdb8b01fb9" ]
[ "server.py" ]
[ "from http.server import ThreadingHTTPServer, HTTPServer, BaseHTTPRequestHandler\nfrom http import cookies\nimport ssl\nfrom io import BytesIO\nimport json\nimport secrets\nimport datetime as dt\nimport jwt\nimport copy\nfrom jwt import encode, decode\nfrom datetime import datetime, timedelta\nfrom eth_account imp...
[ [ "numpy.base_repr" ] ]
zroger49/hac
[ "5905369344c985d5293d572a610c82308306e385" ]
[ "train.py" ]
[ "import json\nimport os\nimport argparse\nimport scipy.stats as stats \nimport numpy as np\nimport pandas as pd\nimport torch\nimport random\nimport sys\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.nn as nn\nimport time\nimport torch.utils.data as data\n\nfrom sklearn.model_selection import Stratifi...
[ [ "sklearn.model_selection.StratifiedKFold", "numpy.random.seed", "torch.save", "torch.random.manual_seed", "torch.cuda.is_available", "torch.utils.data.DataLoader", "pandas.concat", "pandas.read_csv", "torch.nn.CrossEntropyLoss" ] ]
zhuokaizhao/artifice
[ "ed6d80ad4fe5a56d8f2ae661cf702eeea18439e4", "ed6d80ad4fe5a56d8f2ae661cf702eeea18439e4" ]
[ "artifice/img.py", "artifice/dat.py" ]
[ "\"\"\"\nUtil functions for manipulating images in artifice.\n\"\"\"\n\nimport numpy as np\nfrom PIL import Image\nfrom skimage import draw\n\nfrom artifice.log import logger # noqa: F401\n\n\n\"\"\"\nBasic image utilities.\n\"\"\"\n\n\ndef grayscale(image):\n \"\"\"Convert an n-channel, 3D image to grayscale.\n\...
[ [ "numpy.max", "numpy.random.normal", "numpy.array", "numpy.ceil", "numpy.min", "numpy.logical_and", "numpy.where", "numpy.atleast_3d", "numpy.stack", "numpy.any", "numpy.sqrt", "numpy.clip", "numpy.squeeze", "numpy.floor" ], [ "tensorflow.reduce_min",...
Belval/Scanner3D
[ "47bf82a528c0f9e804d0ab3c4174199d8ca1469e" ]
[ "scanner3d/algorithms/icp.py" ]
[ "\"\"\"\nThis is a manual implementation of (Point-to-point) ICP, it is not as optimized\nas Open3D's nor does as fully-featured.\n\nIt's also quite slow.\n\"\"\"\n\nimport numpy as np\nfrom scipy.spatial.distance import cdist\n\nfrom scanner3d.exceptions import PointCloudSizeMismatch\n\n\ndef find_transform(pcd1, ...
[ [ "numpy.array", "numpy.dot", "numpy.sum", "numpy.linalg.det", "numpy.mean", "numpy.identity", "numpy.arange", "scipy.spatial.distance.cdist" ] ]
NekroDarkmoon/FantasyGenerator
[ "5720bfade6bd15fe50666735f85ebb55b854f98d" ]
[ "magic_item_gen.py" ]
[ "import random\nfrom numpy.random import choice\n\n# TABLES\n\ntable_a = ['Potion of healing', 'Spell scroll (cantrip)', 'Potion of climbing',\n 'Spell scroll (1st level)', 'Spell scroll (2nd level)',\n 'Potion of healing (greater)', 'Bag of holding', 'Driftglobe']\n\ntable_b = ['Potion of heali...
[ [ "numpy.random.choice" ] ]
lharri73/speedtest
[ "885c2d5e8131929fdc3abac85234e331acba2a03" ]
[ "src/graph.py" ]
[ "#!/usr/bin/env python\nimport sys\nfrom matplotlib import pyplot as plt\nimport numpy as np\nimport csv\nfrom datetime import datetime, timezone\nimport pytz\n\ndef main():\n if len(sys.argv) != 2:\n print(\"usage: ./graph.py [path_to_csv]\")\n exit(1);\n arr = np.empty((0,5), dtype=\"float\")\...
[ [ "numpy.array", "numpy.empty", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.ones", "matplotlib.pyplot.figure", "matplotlib.pyplot.gcf", "matplotlib.pyplot.show", "numpy.vstack" ] ]
deezcov/rareflow
[ "481c6ef5421374e328a5aae99e0debc100c993bc" ]
[ "rareflow/datasets/movielens.py" ]
[ "from __future__ import absolute_import, division, print_function\nimport os\nimport itertools\nimport zipfile\nimport numpy as np\nimport scipy.sparse as sp\nfrom rareflow.datasets.core import maybe_download_data, Dataset\n\n_MOVIELENS_CONFIG = {\n 'URL_PREFIX': 'http://files.grouplens.org/datasets/movielens/',...
[ [ "scipy.sparse.lil_matrix" ] ]
DKosenkov/PyFREC
[ "a578f649b1309f1e23412e3695cce2b9e48fda3d" ]
[ "src/transformfrags.py" ]
[ "from couplib.autoarr import AutoArr\nfrom couplib.myreportservice import *\n#from couplib.vrrotmat2vec import Vrrotmat2Vec\n\nfrom couplib.parselist import ParseList\nimport numpy as np\nimport math\nimport copy\n\nfrom configuration import *\nfrom interfaces import AtomInterface\nfrom interfaces import ExciteStat...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.norm", "numpy.linalg.svd", "numpy.sqrt", "numpy.dtype" ] ]
chifai/CarND-Advanced-Lane-Lines
[ "eb0ff8c9dcffba2b2c3428eefce2e1dafc1e58c4" ]
[ "CImgProcessor.py" ]
[ "import json\nimport numpy as np\nimport cv2\nimport matplotlib.image as mpimg\nclass CImgProcessor():\n def __init__(self):\n self.__nx = 9\n self.__ny = 6\n self.__cam_mtx = None\n self.__dist_coeff = None\n self.__unwraped_mat = None\n self.__wraped_mat = None\n ...
[ [ "numpy.max", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.float32", "numpy.arctan2", "numpy.sqrt", "numpy.absolute", "numpy.linalg.inv" ] ]
Crissman/ray
[ "fece8db70d703da1aad192178bd50923e83cc99a" ]
[ "rllib/execution/replay_buffer.py" ]
[ "import collections\nimport logging\nimport numpy as np\nimport platform\nimport random\nfrom typing import List, Dict\n\n# Import ray before psutil will make sure we use psutil's bundled version\nimport ray # noqa F401\nimport psutil # noqa E402\n\nfrom ray.rllib.execution.segment_tree import SumSegmentTree, Min...
[ [ "numpy.array", "numpy.abs", "numpy.zeros", "numpy.mean" ] ]
nickybu/spiking_grid_cell_model
[ "87851335474935648c6914eba21fbf6c3213f17c" ]
[ "analysis.py" ]
[ "# Handles plotting of results after simulation has been run and data written to storage.\n\nimport argparse\nimport random\nimport cPickle as pickle\nimport matplotlib.colors as mcolors\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport utilities as util\nfrom pyNN.utility.plotting import Figure, Panel\n...
[ [ "numpy.array", "matplotlib.pyplot.savefig", "matplotlib.pyplot.Normalize", "matplotlib.pyplot.clf", "matplotlib.colors.LinearSegmentedColormap.from_list" ] ]
muzik999/road_connectivity
[ "8d9893752a633f9339e91b7b697f700ca669b729" ]
[ "utils/loss.py" ]
[ "import cv2\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass CrossEntropyLoss2d(nn.Module):\n def __init__(self, weight=None, size_average=True, ignore_index=255, reduce=True):\n super(CrossEntropyLoss2d, self).__init...
[ [ "torch.nn.NLLLoss", "torch.autograd.Variable", "torch.nn.functional.log_softmax", "torch.nn.functional.softmax", "torch.mean" ] ]
gdgrant/reptile-development
[ "b71741d66e5c3c1df2b6183192ced3161015d74d" ]
[ "model.py" ]
[ "# Required packages\r\nimport tensorflow as tf\r\nimport numpy as np\r\nimport pickle\r\nimport os, sys, time\r\nfrom itertools import product\r\nimport matplotlib.pyplot as plt\r\n#plt.switch_backend('agg') # For remote plot generation\r\n\r\n# Model modules\r\nfrom parameters import *\r\nimport omniglot_st...
[ [ "numpy.product", "tensorflow.group", "numpy.mean", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.trainable_variables", "tensorflow.argmax", "tensorflow.train.Saver", "tensorflow.layers.batch_n...
josegcpa/haemorasis
[ "f662ab909676e7e4be9ce94cd635f2005a891bff" ]
[ "scripts/python/quality_control.py" ]
[ "\"\"\"\nPredicts which tiles are of good quality in WBS.\n\nUsage:\n python3 quality_control.py --help\n\"\"\"\n\nimport argparse\nfrom tqdm import tqdm\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom glob import glob\n\nfrom quality_net_utilities import *\nfrom image_generator import *\n\nn_channe...
[ [ "tensorflow.data.Dataset.from_generator", "tensorflow.keras.models.load_model" ] ]
Hzx66666/FairMOT_PS
[ "c0b2ef18cd712ebd2512ce73672667a72a9d4f04" ]
[ "src/gen_labels_20.py" ]
[ "import os.path as osp\nimport os\nimport numpy as np\n\n\ndef mkdirs(d):\n if not osp.exists(d):\n os.makedirs(d)\n\n\nseq_root = '/data/yfzhang/MOT/JDE/MOT20/images/train'\nlabel_root = '/data/yfzhang/MOT/JDE/MOT20/labels_with_ids/train'\nmkdirs(label_root)\nseqs = [s for s in os.listdir(seq_root)]\n\nt...
[ [ "numpy.loadtxt" ] ]
TheSDK-blocks/plot_format
[ "4597d471f141d2d40d620db8e481d3489b28022e" ]
[ "plot_format/__init__.py" ]
[ "\"\"\"\n===========\nPlot Format\n===========\n\nGlobal plot formatting options. Goal is to produce IEEE journal compatible\nfigures easily. Each plot format setting set in this file can be overriden in\nindividual plots, or by setting the respective rcParams again.\n\nReference:\nhttps://matplotlib.org/3.1.1/tu...
[ [ "matplotlib.pyplot.gcf" ] ]
rvinas/tensorflow
[ "2e6446f8a9be31c59080b643d04f9b463c4201cf" ]
[ "tensorflow/python/ops/image_ops_test.py" ]
[ "# Copyright 2015 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.image_ops.image_gradients", "tensorflow.python.ops.image_ops.random_flip_up_down", "numpy.random.rand", "numpy.array_equal", "numpy.tile", "tensorflow.python.ops.io_ops.read_file", "tensorflow.python.ops.array_ops.unstack", "tensorflow.python.ops.image_ops.rg...
codeforpdx/opentransit-metrics
[ "93cc4d413b97ab25ca21115404896b2462c36fda" ]
[ "backend/models/vehicle_positions.py" ]
[ "import requests\nimport os\nimport re\nimport json\nimport math\nfrom . import config\nimport time\nfrom pathlib import Path\nfrom datetime import datetime, date\nimport pandas as pd\nimport gzip\nimport boto3\nimport aiohttp\nimport asyncio\nimport functools\n\n# Properties of each vehicle as stored by opentransi...
[ [ "pandas.read_csv" ] ]
philipp-gaspar/tb-tools
[ "b6a5028875c25ebdcce50f4e86a14179e484fa76" ]
[ "src/murabei_imaging/data_process.py" ]
[ "import sys\nimport os\n\nimport pandas as pd\nimport numpy as np\nimport tensorflow as tf\n\nfrom src.utils import setup_murabei_imaging\n\nif __name__ == '__main__':\n # --------------------------- #\n # UNPACK ANALYSIS PATHS #\n # =========================== #\n paths = setup_murabei_imaging(mo...
[ [ "tensorflow.image.convert_image_dtype", "pandas.read_csv", "tensorflow.image.decode_jpeg", "tensorflow.io.read_file" ] ]
dchandan/PySCRIP
[ "8150ecab2aadd356d23afca6158c33bc35d0adc7" ]
[ "PySCRIP/share.py" ]
[ "import numpy as np\n\n__all__ = [\"ll1lats\", \"ll1lons\"]\n\nll1lats = np.arange(-89.5, 90)\nll1lons = np.arange(0, 360) # longitudes centered on 180\n" ]
[ [ "numpy.arange" ] ]
DragosBobolea/models
[ "b31a575f363ca464d22e4a21e2846075fb4c0843" ]
[ "research/object_detection/export_inference_graph.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.app.run", "tensorflow.app.flags.mark_flag_as_required", "tensorflow.gfile.GFile" ] ]
gexarcha/dsc
[ "d0abc4cc799f48fe0f94a7909024ccd5d3e10aff" ]
[ "examples/audio/data.py" ]
[ "#\n# Lincense: Academic Free License (AFL) v3.0\n#\n\n\nimport numpy as np\nimport tables as tb\n\ndef read_chunks(N=1000, sz=30, disc=1):\n\th5f = tb.open_file('/users/ml/xoex6879/data/TIMIT/TIMIT'+str(disc)+'_TRAIN.h5','r')\n\tit = h5f.walk_nodes(h5f.root)\n\taudio_samples = []\n\tfor node in it:\n\t\tif node._...
[ [ "numpy.random.randint", "numpy.zeros" ] ]
PDEUXA/AIF_CYCLEGAN
[ "a1323925e54c09ad99e4f09321f16e230d6e404e" ]
[ "data/displaying.py" ]
[ "import matplotlib.pyplot as plt\n\n\ndef generate_and_save_images(model, epoch, test_input,moldename):\n # Notice `training` is set to False.\n # This is so all layers run in inference mode (batchnorm).\n predictions = model(test_input, training=False)\n\n fig = plt.figure(figsize=(8,8))\n plt.imsho...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
theobori/bot-template
[ "3aba0ed127c435e25b29be163f870f5088a611d8" ]
[ "utils/utilities.py" ]
[ "\"\"\"some util features\"\"\"\n\nimport discord\nimport pandas as pd\n\nfrom typing import Tuple\n\nasync def basic_message(ctx: object, msg: str, footer: str = None) -> object:\n \"\"\"\n Sends a message and returns the object\n \"\"\"\n\n embed = discord.Embed(color=0x000000, description=msg)\n\...
[ [ "pandas.DataFrame" ] ]
EugenePizzerbert/OpenCV-CVAT
[ "bef34f45ab58fcd1511a27147c661b3eb0dc0e32" ]
[ "cvat/apps/engine/annotation.py" ]
[ "\n# Copyright (C) 2018 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport os\nimport copy\nfrom django.utils import timezone\nfrom collections import OrderedDict\nimport numpy as np\nfrom scipy.optimize import linear_sum_assignment\nfrom collections import OrderedDict\nfrom distutils.util import strtob...
[ [ "scipy.optimize.linear_sum_assignment" ] ]
NPCC-Joe/Radiomics-pyradiomics
[ "c8ceee27c1b7fe002a14493c3bfd4e9ab439d559" ]
[ "radiomics/gldm.py" ]
[ "import numpy\n\nfrom radiomics import base, cMatrices, deprecated\n\n\nclass RadiomicsGLDM(base.RadiomicsFeaturesBase):\n r\"\"\"\n A Gray Level Dependence Matrix (GLDM) quantifies gray level dependencies in an image.\n A gray level dependency is defined as a the number of connected voxels within distance :math...
[ [ "numpy.sum", "numpy.where", "numpy.arange", "numpy.log2", "numpy.spacing" ] ]
MohammadJRanjbar/MultiLayer-Perceptron-MLP-
[ "b6f449415048477fbd6e8c952106e47a11bbda5f" ]
[ "MLP.py" ]
[ "import numpy as np\r\ndef sigmoid(x):\r\n return 1 / (1 + np.exp(-x))\r\ndef sigmoid_derivative(x):\r\n return x * (1 - x)\r\nX = np.array([[0, 0], [0, 1], [1, 0], [1, 1]])\r\nY = np.array([[0], [1], [1], [0]])\r\nepochs = 10000\r\nlr = 0.1\r\nW1 = np.random.uniform(size=(2, 2))\r\nB1 = np.random.uniform(s...
[ [ "numpy.array", "numpy.dot", "numpy.sum", "numpy.exp", "numpy.random.uniform" ] ]
noahbouchier/segregation
[ "88bd9608251b8bc42eae9265adb7941279b9868c" ]
[ "segregation/tests/test_inference.py" ]
[ "import unittest\n\nimport geopandas as gpd\nimport numpy as np\nfrom libpysal.examples import load_example\nfrom segregation.inference import SingleValueTest, TwoValueTest\nfrom segregation.multigroup import MultiDissim\nfrom segregation.singlegroup import Dissim\n\n\nclass Inference_Tester(unittest.TestCase):\n ...
[ [ "numpy.random.seed" ] ]
agramfort/POT
[ "faa4744597f93e7005bd48729441562e092e3ab6" ]
[ "ot/optim.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nOptimization algorithms for OT\n\"\"\"\n\nimport numpy as np\nfrom scipy.optimize.linesearch import scalar_search_armijo\nfrom .lp import emd\nfrom .bregman import sinkhorn\n\n# The corresponding scipy function does not work for matrices\ndef line_search_armijo(f,xk,pk,gfk,old_fval...
[ [ "numpy.log", "numpy.sum", "numpy.atleast_1d", "numpy.outer", "scipy.optimize.linesearch.scalar_search_armijo" ] ]
jaimeliew1/Project_Euler_Solutions
[ "963c9c6d6571cade8f87341f97a6a2cd1af202bb" ]
[ "Python/500.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSolution to Project Euler problem X\n\nAuthor: Jaime Liew\nhttps://github.com/jaimeliew1/Project_Euler_Solutions\n\"\"\"\nfrom EulerFunctions import timeit, primelist\nfrom numpy import argmin\n\ndef sequence_slow(N, primes):\n A = [1, 0]\n i_cand = [0, 1]\n\n for n in ran...
[ [ "numpy.argmin" ] ]
simecek/rbp
[ "6bae3d37c4800b89efbb16861c79bf5f6fcb40d9" ]
[ "tests/random/test_random_intervals.py" ]
[ "import pytest\nimport pandas as pd\nfrom pandas.testing import assert_frame_equal\nimport io\nfrom rbp.random import gen_random_intervals\n\n\ndef test_gen_random_intervals():\n df = gen_random_intervals(\n sample_size=2, interval_size=100, reference='hg19'\n )\n expected_intervals = io.StringIO(\n...
[ [ "pandas.testing.assert_frame_equal", "pandas.read_csv" ] ]
RahulSajnani/DRACO-Weakly-Supervised-Dense-Reconstruction-And-Canonicalization-of-Objects
[ "d697905da990487589f88068c886a32d2ef57118" ]
[ "DRACO/Loss_Functions/photometric_loss.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport torch.nn as nn\nimport glob\nimport os\nimport sys\nimport torch\nimport pandas as pd\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, utils\nimport torchvision\nimport cv2\nimport json\nimport torch.nn.functional as ...
[ [ "torch.nn.AvgPool2d", "torch.clamp", "torch.cuda.is_available", "torch.nn.ReflectionPad2d", "torch.mean" ] ]
taKana671/PhotoEditor
[ "6b658e088fcaeb84f49db2eeb282f9cb2f469264" ]
[ "tests/pixelate_board_test.py" ]
[ "import os\nimport sys\nsys.path.append(os.path.join(os.path.dirname(__file__), '..'))\nsys.path.append(os.path.join(os.path.dirname(__file__), '../photoeditor'))\n\nimport math\nimport tkinter as tk\nfrom unittest import TestCase, mock, main\n\nimport cv2\nimport numpy as np\nfrom TkinterDnD2 import *\n\nfrom phot...
[ [ "numpy.array" ] ]
qihao-huang/AD-Depth-Estimation
[ "4c93a50efc30fc5b44e2b43412d78bc5f98fa430", "4c93a50efc30fc5b44e2b43412d78bc5f98fa430" ]
[ "FeatDepth/scripts/infer_singleimage.py", "BoostYourOwnDepth-main/boost_depth.py" ]
[ "from __future__ import absolute_import, division, print_function\r\nimport os\r\nimport cv2\r\nimport sys\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom mmcv import Config\r\n\r\nimport torch\r\nfrom torch.utils.data import DataLoader\r\n\r\nsys.path.append('.')\r\nfrom mono.model.registry import...
[ [ "matplotlib.pyplot.imsave", "numpy.percentile", "torch.no_grad", "torch.utils.data.DataLoader", "torch.load" ], [ "torch.device", "torch.min", "numpy.finfo", "torch.max" ] ]
samhmiller/orbitdeterminator
[ "78bc221e52053c14d39fb6c7c54b4bf18f071b8b" ]
[ "orbitdeterminator/main.py" ]
[ "'''\nRuns the whole process in one file for a .csv positional data file (time, x, y, z)\nand generates the final set of keplerian elements along with a plot and a filtered.csv data file\n'''\n\n\nfrom util import (read_data, kep_state, rkf78, golay_window)\nfrom filters import (sav_golay, triple_moving_average)\nf...
[ [ "numpy.savetxt", "numpy.zeros", "numpy.sum", "numpy.mean", "matplotlib.pylab.show", "matplotlib.pylab.figure", "numpy.resize", "numpy.transpose", "numpy.ravel" ] ]
simonanez/deep-learning-cs7643
[ "2ccd3ca336e49abe83ba6516919314db72f9bb8c" ]
[ "assignment1/models/softmax_regression.py" ]
[ "# Do not use packages that are not in standard distribution of python\nimport numpy as np\n\nfrom ._base_network import _baseNetwork\n\nclass SoftmaxRegression(_baseNetwork):\n def __init__(self, input_size=28*28, num_classes=10):\n '''\n A single layer softmax regression. The network is composed ...
[ [ "numpy.matmul", "numpy.zeros", "numpy.random.seed", "numpy.random.randn", "numpy.multiply" ] ]
VA7NFH/nexus-aurora-farmm-rpi
[ "790b386266ffba89dfd792199f297288236ccd7c" ]
[ "visualiser.py" ]
[ "import numpy as np\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\nimport PySimpleGUI as sg\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom pygame import time\n\nfrom mpl_toolkits import mplot3d\nfrom mpl_toolkits.mplot3d import axes3d\n\n# Argh lots of imports\n\nfrom main import *\n\n...
[ [ "matplotlib.use", "numpy.mean", "matplotlib.pyplot.figure", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg", "numpy.deg2rad", "matplotlib.pyplot.axes" ] ]
ayoubbenaissa/BYOGAN
[ "bd5f38f6ab9d2d5516a0f74b9a5f094c1cfd920d" ]
[ "byogan-api/LatentVector/LatentVector.py" ]
[ "import torch #top-level package\nfrom torch.autograd.variable import Variable #differentiation operations on tensors\nfrom torch.distributions.normal import Normal #also called Gaussian\nfrom torch.distributions.multivariate_normal import MultivariateNormal\n\n#the Latent Vector shape depends on the network type o...
[ [ "torch.zeros", "torch.device", "torch.squeeze", "torch.tensor", "torch.eye", "torch.randn" ] ]
coestreich/gtsam
[ "fc171877f03b70236c5cc59537d5f34f1eb88c86" ]
[ "python/gtsam/tests/test_JacobianFactor.py" ]
[ "\"\"\"\nGTSAM Copyright 2010-2019, Georgia Tech Research Corporation,\nAtlanta, Georgia 30332-0415\nAll Rights Reserved\n\nSee LICENSE for the license information\n\nJacobianFactor unit tests.\nAuthor: Frank Dellaert & Duy Nguyen Ta (Python)\n\"\"\"\nimport unittest\n\nimport numpy as np\n\nimport gtsam\nfrom gtsa...
[ [ "numpy.array" ] ]
Aganlengzi/PaddleCustomDevice
[ "0aa0d2e1b2e5db556777604e6fe851a7d0697456" ]
[ "backends/npu/tests/unittests/test_compare_op_npu.py" ]
[ "# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.random.random", "numpy.array", "numpy.arange" ] ]
NishanthJKumar/PGMax
[ "7c71b1456cd84e40b4974649adbf6eecaf0276a7" ]
[ "tests/factor/test_factor.py" ]
[ "import re\n\nimport numpy as np\nimport pytest\n\nfrom pgmax import factor, vgroup\n\n\ndef test_enumeration_factor():\n variables = vgroup.NDVarArray(num_states=3, shape=(1,))\n\n with pytest.raises(\n NotImplementedError, match=\"Please implement compile_wiring in for your factor\"\n ):\n ...
[ [ "numpy.array", "numpy.arange", "numpy.zeros" ] ]
targetsm/dace
[ "297b12804a334df8cc6fad5250d5fb0cce20dc6e", "297b12804a334df8cc6fad5250d5fb0cce20dc6e" ]
[ "tests/nested_vector_type_test.py", "tests/persistent_tb_map_cudatest.py" ]
[ "# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.\n\nimport dace\nfrom dace.memlet import Memlet\nimport dace.libraries.blas as blas\nimport numpy as np\nimport scipy\n\nvec_width = 4\nvtype = dace.vector(dace.float32, vec_width)\n\nn = dace.symbol(\"n\")\n\n# ---------- ----------\n# Cre...
[ [ "numpy.linalg.norm", "numpy.zeros", "numpy.copy", "scipy.linalg.blas.saxpy", "numpy.float32", "numpy.random.randint", "numpy.int32" ], [ "numpy.dot", "numpy.random.rand", "numpy.zeros" ] ]
rahlk/MOOSE
[ "25bc1a84f07e30ab0dbb638cd2aa1ce416c510ff" ]
[ "src/utils/XTREE/tools/tune/dEvol.py" ]
[ "from __future__ import division, print_function\nfrom model import rf\nimport numpy as np\nimport random\nfrom time import time\nfrom pdb import set_trace\n\nclass settings:\n iter=50\n N=100\n f=0.5\n cf=0\n maxIter=100\n lives=10\n\ndef flatten(x):\n \"\"\"\n Takes an N times nested list of list like [[a...
[ [ "numpy.random.choice" ] ]
tjohn327/Hand_pose_DKE
[ "5505d5ef22c30853c3be265e6218605809cbad97" ]
[ "test/test_compare.py" ]
[ "import keras\nfrom keras.datasets import mnist\nfrom keras import optimizers\nfrom keras.models import Sequential,Model\nfrom keras.layers import Dense, Dropout, Flatten, Activation,Input\nfrom keras.layers import Conv2D, MaxPooling2D\nfrom keras.applications import VGG16\nfrom keras.optimizers import SGD\nfrom ke...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.unique", "matplotlib.pyplot.subplot" ] ]
JoseChavez98/Poisson-Disk-Sampling
[ "025a15c30565110b7ccf5ec189b8091e66541737" ]
[ "src/kdtree/drawingfunctions.py" ]
[ "from mpl_toolkits.mplot3d import axes3d\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef getPointsPositions(file,positions,num_points,k):\n\tfor i in range(num_points):\n\t\tline = file.readline()\n\t\tarr = line.split(\" \")\n\t\tfor j in range(k):\n\t\t\tpositions[j].append(int(arr[j]))\n\ndef drawFro...
[ [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.plot" ] ]
LindgeW/BiaffineNER
[ "f14ba26261b042f7c9eb7b8713e7edf6114808da" ]
[ "utils/dataset.py" ]
[ "import numpy as np\n\n\nclass DataSet(object):\n '''\n data_path-> instance对象集 -> 生成batch -> to_index (vocab) -> padding -> to_tensor\n -> 创建vocab\n\n bert_path -> bert_model / bert_tokenizer (vocab)\n\n embed_path -> pre_embeds / pre_vocab\n '''\n def __len__(self):\n raise No...
[ [ "numpy.random.permutation", "numpy.random.shuffle" ] ]
chasingw/pointpillars_pytorch_trt
[ "941075a23d86991393ea71ddbeb916ca80b73400" ]
[ "pytorch/pcdet/utils/box_coder_utils.py" ]
[ "import numpy as np\nimport torch\n\n\nclass ResidualCoder(object):\n def __init__(self, code_size=7, encode_angle_by_sincos=False, **kwargs):\n super().__init__()\n self.code_size = code_size\n self.encode_angle_by_sincos = encode_angle_by_sincos\n if self.encode_angle_by_sincos:\n ...
[ [ "torch.cos", "torch.cat", "torch.sqrt", "numpy.array", "torch.sin", "torch.split", "torch.atan2", "torch.log", "torch.exp", "torch.clamp_min" ] ]
UnitedThruAction/Data
[ "c589df73eb1c5f3a466357f863d63f0f8e209105" ]
[ "Tools/ElectionData.py" ]
[ "\"\"\"Collect information from the NY State Board of Elections website (http://www.elections.ny.gov/2016ElectionResults.html) and publish in a way more sensible format.\n\nCode is given for 2016 and 2014 below, but could easily be extended. Note the NY State Board of Elections uses inconsistent names on their web...
[ [ "pandas.notnull", "pandas.DataFrame", "pandas.read_excel", "pandas.qcut", "pandas.read_csv" ] ]
tdiprima/code
[ "73b09edc1b9850c557a79296655f140ce5e853db", "73b09edc1b9850c557a79296655f140ce5e853db" ]
[ "recipes/Python/579021_Delaunay_triangulation/recipe-579021.py", "recipes/Python/578104_OpenKinect_Mouse_Control_Using/recipe-578104.py" ]
[ "import numpy\nimport math\nimport copy\n\nclass Delaunay2d:\n\n EPS = 1.23456789e-14\n\n def __init__(self, points):\n\n # data structures\n self.points = points[:] # copy\n self.triangles = [] # cells\n self.edge2Triangles = {} # edge to triangle(s) map\n self.boundaryEdges = set()\n self.appl...
[ [ "numpy.dot", "numpy.zeros" ], [ "numpy.mean" ] ]
Residencia-Fiep-Turma-2/Biodiversidade-Marcia-Natalia-Pedro
[ "8e29d64f17c78f31c6d45e765ec7ac1db882b427" ]
[ "withpandas.py" ]
[ "import pandas as pd\nimport numpy as np\n\nclass PandasFiltros:\n \n def __init__(self):\n self.path = input(\"Digite o caminho do arquivo: \")\n self.file = pd.read_csv(self.path, sep=\";\")\n\n def NumIndiv(self): #Filtra o numero de indivíduos no estado indicado\n sigla = input(\"...
[ [ "pandas.read_csv" ] ]
vishalbelsare/dora
[ "5a56611d4ac6cbc0a7982100a5e1c9e13aac02f0" ]
[ "dora/active_sampling/gp_sampler.py" ]
[ "\"\"\"\nGaussian Process Sampler Module.\n\nProvides the Gaussian Process Sampler Class which contains the strategies for\nactive sampling a spatial field using a non-parametric, Bayesian model\n\"\"\"\nimport logging\n\nfrom dora.active_sampling.base_sampler import Sampler, random_sample\n\nimport revrand.legacyg...
[ [ "numpy.asarray", "numpy.random.seed", "numpy.sum", "numpy.ones", "numpy.atleast_1d", "numpy.argmax", "numpy.sqrt" ] ]
Chandemonium/GeneticOptimizer
[ "178530b8476818d3b98909e8f8a458509a12a951" ]
[ "Genetic_Optimizer_Example.py" ]
[ "#!/usr/bin/python\n\nimport os\nimport sys\nimport numpy as np\nimport subprocess\nimport time\nimport threading\nimport random\n\nclass GeneticOptimizer():\n def __init__(self):\n self.parameters_random = []\n self.parameters_7 = []\n\n def TrulyRandomNumbers(self, num):\n x = self.para...
[ [ "numpy.random.uniform" ] ]
bjdarrer/tf2-model-g
[ "26cf7bba9f1cc13e226834b3565c7b8df5fcc40a" ]
[ "examples/triangular_1e.py" ]
[ "from scipy import signal\nimport numpy as np\nimport matplotlib.pyplot as plt\nx = np.linspace(-5, 5, 500)\ntriangle = signal.sawtooth(2 * np.pi * 1/5 * (x + 5), 0.5) - 1\nplt.plot(x, triangle)\nplt.show()\n\ndef triangle2(length, amplitude):\n section = length // 4\n x = np.linspace(0, amplitude, section+1)...
[ [ "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.plot", "scipy.signal.sawtooth" ] ]
chandu088/p
[ "878456367105924accc5b235263b0bb209d877c8", "878456367105924accc5b235263b0bb209d877c8" ]
[ "polyaxon/datasets/mnist.py", "examples/reinforcement_learning_examples/trpo_cartpole.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nimport gzip\nimport json\nimport os\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom polyaxon import Modes\nfrom polyaxon.datasets.converters import ImagesToTFExampleConverter, PNGNumpyImageReader\nfrom polyaxon.data...
[ [ "tensorflow.Session", "tensorflow.gfile.Exists", "tensorflow.python_io.TFRecordWriter", "numpy.frombuffer" ], [ "tensorflow.app.run", "tensorflow.logging.set_verbosity" ] ]
B-Manifold/pytorch_fnet_UwUnet
[ "be168ac3d7ecc545f7360f45b130e901f68ea5b6" ]
[ "fnet/nn_modules/fnet_nn_UwU.py" ]
[ "import torch\nimport pdb\n\nclass Net(torch.nn.Module):\n def __init__(self):\n super().__init__()\n mult_chan = 32\n depth = 4\n starting_chan = 200\n intermediate_chan = 100\n final_chan = 17\n self.spec_conv = SubNet2Conv(starting_chan,intermediate_chan) #Firs...
[ [ "torch.cat", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.split", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
Louquinze/auto-sklearn
[ "b2ac331c500ebef7becf372802493a7b235f7cec", "b2ac331c500ebef7becf372802493a7b235f7cec" ]
[ "autosklearn/metalearning/metafeatures/metafeatures.py", "autosklearn/pipeline/components/data_preprocessing/rescaling/normalize.py" ]
[ "from collections import defaultdict, OrderedDict, deque\nimport copy\n\nimport numpy as np\n\nimport pandas as pd\n\nimport scipy.stats\nfrom scipy.linalg import LinAlgError\nimport scipy.sparse\n\n# TODO use balanced accuracy!\nfrom sklearn.multiclass import OneVsRestClassifier\nfrom sklearn.utils import check_ar...
[ [ "numpy.nanmax", "numpy.array", "pandas.isna", "numpy.random.RandomState", "numpy.sum", "sklearn.multiclass.OneVsRestClassifier", "pandas.notna", "numpy.mean", "sklearn.utils.multiclass.type_of_target", "numpy.nanmin", "numpy.nanmean", "numpy.arange", "numpy.isfi...
miguelvr/ClassyVision
[ "38a59270e16fda83e160c5888b96c777cb78757b" ]
[ "classy_vision/generic/opts.py" ]
[ "#!/usr/bin/env python3\n# 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 argparse\nimport os\n\nimport torch\nfrom classy_vision.generic.util import is_pos_int\n\n\ndef add_g...
[ [ "torch.cuda.is_available" ] ]
leofansq/3D-Detection
[ "ec72bad31a14e54fe02196f19d03891683a7ee15" ]
[ "scripts/offline_eval/plot_ap.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef main():\n \"\"\"Plots AP scores from the native eval script and prints top 5 checkpoints\n for each metric\n \"\"\"\n\n # Output from native eval\n results_file = '/home/cecilia/leo_projects/bishe2019/3D-Detection/avod/data/outputs/pyr...
[ [ "numpy.ceil", "numpy.asarray", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "numpy.argsort", "numpy.hstack" ] ]
guillecg/drlnd
[ "b2d8fda6b90efbf1ca9b5ad98a504debb59a10ef" ]
[ "p3_collab_compet/models/utils.py" ]
[ "import random\n\nimport numpy as np\n\nimport torch\n\nfrom collections import namedtuple, deque\n\nimport copy\n\n\nclass ReplayBuffer:\n \"\"\"Fixed-size buffer to store experience tuples.\"\"\"\n\n def __init__(self, buffer_size, device, seed=42):\n \"\"\"Initialize a ReplayBuffer object.\n\n ...
[ [ "numpy.ones", "numpy.vstack", "numpy.random.standard_normal" ] ]
Morioki/AdventOfCode
[ "9a72df9193ddb22b8269fee17a57b0fc952f43ed" ]
[ "2021/p5.py" ]
[ "import pathlib\nimport sys\nimport itertools\nimport numpy as np\n\ndef parse(puzzle_input):\n \"\"\"Parse input\"\"\"\n lines = [str(line) for line in puzzle_input.split('\\n')]\n points = [ tuple([ tuple([el for el in point.split(',')]) for point in line.split(' -> ')]) for line in lines]\n\n return ...
[ [ "numpy.count_nonzero", "numpy.zeros" ] ]
DeepRank/deeprank-gnn-2
[ "9d1b5f254ae25364bec88ba6e82a6aa1022fc699" ]
[ "deeprankcore/alignmentNet.py" ]
[ "import torch\nfrom torch import nn\n\n__author__ = \"Daniel-Tobias Rademaker\"\n\n####################################################\n# Single GNN-layer #\n####################################################\n\n\nclass GNN_layer(nn.Module):\n def __init__( # pylint: disable=to...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Sigmoid", "torch.nn.SiLU", "torch.nn.BatchNorm1d" ] ]
ShenghuanSun/Clustering_BMI_HW2
[ "d93478e9288d2d6d1dbafe65e6655730baf24a8a" ]
[ "test/test_clusters.py" ]
[ "import pytest\nimport glob\nimport pandas as pd\nimport numpy as np\nimport os \nimport sys\nsys.path.append(\"..\")\n\nfrom clusters.algs import Ligand, HierarchicalClustering, PartitionClustering,Silhouette_Coefficient, ClusterNode, getEuclidean, Rand_Index\nimport matplotlib.pyplot as plt\nimport time\nimport n...
[ [ "pandas.DataFrame", "matplotlib.pyplot.plot", "sklearn.datasets.make_blobs", "numpy.zeros" ] ]
Mattlk13/nnabla
[ "09b7dfd03bd88366d1d1f6cc61492b42175e35e7", "09b7dfd03bd88366d1d1f6cc61492b42175e35e7" ]
[ "python/test/function/test_r_div_scalar.py", "python/test/function/test_fft.py" ]
[ "# Copyright (c) 2017 Sony Corporation. 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 requir...
[ [ "numpy.random.RandomState" ], [ "numpy.prod", "numpy.arange", "numpy.random.RandomState" ] ]
Berumotto1/ml-platform-sdk-python
[ "fc30300552bbeed5d97e8846beb040c9d262d23e" ]
[ "samples/bert_glue_pytorch/main.py" ]
[ "# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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 o...
[ [ "torch.distributed.get_world_size", "torch.utils.data.RandomSampler", "torch.cuda.is_available", "torch.load", "torch.nn.DataParallel", "torch.distributed.init_process_group", "torch.manual_seed", "torch.tensor", "torch.utils.data.DataLoader", "numpy.argmax", "torch.dis...
mingrui/NCRF
[ "d3dcb50739a9eb8621d42ea98b7d0496afe430ca" ]
[ "wsi/data/image_producer.py" ]
[ "import os\n\nimport numpy as np\nfrom torch.utils.data import Dataset\nfrom PIL import Image\n\nnp.random.seed(0)\n\nfrom torchvision import transforms # noqa\n\nfrom wsi.data.annotation import Annotation # noqa\n\n\nclass GridImageDataset(Dataset):\n \"\"\"\n Data producer that generate a square grid, e.g...
[ [ "numpy.rot90", "numpy.array", "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "numpy.random.randint", "numpy.fliplr" ] ]
Mic-JasonTang/Practical_Python_and_OpenCV
[ "32624ae286374fa6587f2bb36397c7758d303e7a" ]
[ "image_processing/masking.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: MR_Radish\n# @Date: 2018-07-25 15:54:44\n# @E-mail: ty_2016@foxmail.com\n# @FileName: masking.py\n# @TODO: 按照指定图形覆盖图片\n\nimport numpy as np\nimport argparse\nimport cv2\n\nap = argparse.ArgumentParser()\nap.add_argument(\"-i\", \"---image\", required=True, help=\"Pat...
[ [ "numpy.zeros" ] ]
hanhou/ibllib
[ "bc29ecb44212d8dd899be987cf407b28e9c0d3be", "bc29ecb44212d8dd899be987cf407b28e9c0d3be" ]
[ "ibllib/io/extractors/camera.py", "ibllib/tests/qc/test_task_metrics.py" ]
[ "\"\"\" Camera extractor functions\nThis module handles extraction of camera timestamps for both Bpod and FPGA.\n\"\"\"\nimport logging\nfrom functools import partial\n\nimport cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom oneibl.stream import VideoStreamer\nimport ibllib.dsp.utils as dsp\nfrom i...
[ [ "numpy.median", "numpy.where", "numpy.full", "numpy.zeros_like", "numpy.empty", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.in1d", "matplotlib.pyplot.subplot", "numpy.array", "numpy.delete", "numpy.pad", "numpy.zeros", "numpy.round", "numpy.ma.m...
kulexpipiens/RUGMLProject
[ "095c86e8dce9ecba1800e5cd1883407bead79033" ]
[ "plot4.py" ]
[ "import csv\nimport os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport glob\n\n# dpi of figure\nDPI=500\n# number of previous values to calculate average\nTREND_ACCURACY=1000\n\ncolors = [\"#000000\", \"#0000FF\", \"#A52A2A\", \"#7FFF00\", \"#DC143C\", \"#006400\", \"#FF8C00\", \"#FF1493\", \"#FFD700\"...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.mean", "matplotlib.pyplot.ylabel" ] ]
jiwoncpark/lenstronomy
[ "c1d12580f8d8cf1d065d80568a58c0694e23945a" ]
[ "lenstronomy/LensModel/Solver/lens_equation_solver.py" ]
[ "import numpy as np\nimport lenstronomy.Util.util as util\nimport lenstronomy.Util.image_util as image_util\nfrom scipy.optimize import minimize\n\n\nclass LensEquationSolver(object):\n \"\"\"\n class to solve for image positions given lens model and source position\n \"\"\"\n def __init__(self, lensMod...
[ [ "numpy.random.normal", "numpy.array", "numpy.zeros", "numpy.random.uniform", "numpy.sqrt", "numpy.argsort", "scipy.optimize.minimize" ] ]
FedeClaudi/pyrnn
[ "a3b6a32b0d00d8d732c484f4a35cf581f345b4b0" ]
[ "examples/three_bit_memory.py" ]
[ "import numpy as np\nfrom numpy import random as rnd\nimport matplotlib.pyplot as plt\nimport torch\nfrom myterial import salmon, light_green_dark, indigo_light\nfrom pyrnn._plot import clean_axes\nimport torch.utils.data as data\nimport sys\nfrom rich.progress import track\n\n\"\"\"\n 3 bit memory task\n ...
[ [ "torch.zeros", "matplotlib.pyplot.subplots", "numpy.random.seed" ] ]
tbulding/quickstart-aws-utility-meter-data-analytics-platform
[ "7d49526690f158760dbb37cc31a5c4d124417211" ]
[ "assets/functions/ml_pipeline/upload_result/app.py" ]
[ "'''\nInput event payload expected to be in the following format:\n\n{\n\"Batch_start\": \"MAC000001\",\n\"Batch_end\": \"MAC000010\",\n\"Data_start\": \"2013-06-01\",\n\"Data_end\": \"2014-01-01\",\n\"Forecast_period\": 7\n}\n\n'''\n\nimport boto3, os\nimport json\nimport pandas as pd\nimport numpy as np\n\nfrom p...
[ [ "pandas.Timestamp", "pandas.read_sql", "pandas.Timedelta", "pandas.DataFrame" ] ]
felipeparpinelli/sagemaker-deployment
[ "9e3aff56c2b2335c77791700204e72e7942bbdc8" ]
[ "serve/predict.py" ]
[ "import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\nfrom utils import review_to_words, convert_and_p...
[ [ "torch.no_grad", "torch.from_numpy", "torch.cuda.is_available", "torch.load", "numpy.hstack" ] ]
omiderfanmanesh/Machine-Learning-Project-Template
[ "7706d8435b7b4c8fc93389f9d138be266f2438f7" ]
[ "eda/bank_analyser.py" ]
[ "# Copyright (c) 2021, Omid Erfanmanesh, All rights reserved.\n\nimport numpy as np\nimport pandas as pd\n\nfrom eda.based import BasedAnalyzer\n\n\nclass BankAnalyzer(BasedAnalyzer):\n def __init__(self, dataset, cfg):\n super(BankAnalyzer, self).__init__(dataset, cfg)\n\n def age(self):\n sel...
[ [ "pandas.pivot_table" ] ]
xhchrn/open_lth
[ "6b3d04a12a2f868ce851bd09b330ea57957c1de6" ]
[ "datasets/svhn.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 numpy as np\nimport os\nfrom PIL import Image\nimport sys\nimport torchvision\n\nfrom datasets import base\nfrom platforms.pla...
[ [ "numpy.array", "numpy.transpose" ] ]
Wesley-Tse/mtcnn
[ "be1d5a1d0b40bf9b35f9710a4e51471281953ee7" ]
[ "Module/module.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# @Author : Wesley\n# @Time : 2020.11.22 17:58\n\nimport torch\nfrom torch import nn\n\n\nclass PNet(nn.Module):\n def __init__(self):\n super(PNet, self).__init__()\n self.convolution = nn.Sequential(\n # N * 3 * 12 * 12\n ...
[ [ "torch.zeros", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Sigmoid", "torch.nn.BatchNorm2d", "torch.nn.Conv2d", "torch.nn.PReLU", "torch.nn.BatchNorm1d" ] ]
derenlei/bert-extractive-summarizer
[ "64f73851d541bab40e62f09c799cbd7cce70cc69" ]
[ "summarizer/model_processors.py" ]
[ "from typing import List, Optional, Tuple, Union\n\nimport numpy as np\nfrom transformers import *\n\nfrom summarizer.bert_parent import BertParent\nfrom summarizer.cluster_features import ClusterFeatures\nfrom summarizer.sentence_handler import SentenceHandler\n\n\nclass ModelProcessor(object):\n\n aggregate_ma...
[ [ "numpy.random.seed", "numpy.asarray" ] ]
Neil-Symington/AEM_interp_uncert
[ "dd5716083b8122111613c7ac4b7a27a249577b3e" ]
[ "code/utility_functions.py" ]
[ "import numpy as np\nimport math\n\ndef line_length(line):\n '''\n Function to return length of line\n @param line: iterable containing two two-ordinate iterables, e.g. 2 x 2 array or 2-tuple of 2-tuples\n\n @return length: Distance between start & end points in native units\n '''\n return math.sq...
[ [ "numpy.abs", "numpy.zeros", "numpy.cumsum" ] ]
sancierra/dace
[ "54e707ee675ca3ac68199d6b0e132c8639fb4cd2" ]
[ "tests/fpga/kernels_detection.py" ]
[ "# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.\n\n# Tests for kernels detection\n\nimport dace\nimport numpy as np\nimport pytest\nfrom dace.transformation.interstate import FPGATransformSDFG, InlineSDFG\n\n\ndef count_kernels(cachedir: str):\n '''\n Test utility functions: Count...
[ [ "numpy.allclose", "numpy.dot", "numpy.random.rand" ] ]
KlayClarke/samila
[ "0949c8c854ca76ebd61c568600915e19977f785d" ]
[ "samila/genimage.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Samila generative image.\"\"\"\nimport random\nimport itertools\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom .functions import _GI_initializer, plot_params_filter, generate_params_filter\nfrom .functions import float_range, save_data_file, save_fig_file, save_fig_buf, sa...
[ [ "matplotlib.pyplot.figure" ] ]
dwillmer/Cirq
[ "0ff2894e053e4ce3bb1b54e9b9de1cc4345d10b3" ]
[ "cirq/circuits/circuit.py" ]
[ "# Copyright 2018 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "numpy.product", "numpy.empty_like" ] ]
lflage/ASAP-Essay
[ "139d1eae2514a31ccb092256ec82c32bb11df2ae" ]
[ "Get_features_to_CSV.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Oct 9 10:07:34 2018\n\n@author: lucas\n\"\"\"\n\n\nimport pandas as pd\n#from ASAP_essay import ASAP_essay\nimport ASAP_essay as asap\nfrom textstat.textstat import textstat\nfrom py4j.java_gateway import JavaGateway\n\n# Primeiramente iniciamos a conexão com java p...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
gutierrezps/NeuroKit
[ "a30f76e64b4108abdc652a20391dc0288c62501d" ]
[ "neurokit2/misc/expspace.py" ]
[ "import numpy as np\n\n\ndef expspace(start, stop, num=50, out=int, base=1):\n \"\"\"Exponential range.\n\n Creates a list of integer values (by default) of a given length from start to stop, spread by\n an exponential function.\n\n Parameters\n ----------\n start : int\n Minimum range valu...
[ [ "numpy.round", "numpy.log2", "numpy.log" ] ]
AdamLohSg/GTA
[ "bf6a745a6e28e365466e76360a15ca10ce61e009" ]
[ "data/data_loader_dad.py" ]
[ "import os\nimport pickle\nimport numpy as np\nimport pandas as pd\n\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom sklearn.preprocessing import StandardScaler, MinMaxScaler\n\nfrom utils.timefeatures import time_features\n\nimport warnings\nwarnings.filterwarnings('ignore')\n\n\n\nclass Data...
[ [ "pandas.to_datetime", "numpy.concatenate", "numpy.isnan", "numpy.nan_to_num", "numpy.asarray", "sklearn.preprocessing.StandardScaler", "pandas.DataFrame", "sklearn.preprocessing.MinMaxScaler" ] ]
lc82111/PyTorchCV
[ "0061fcfe97d743f4f2bfdec7a459efa280d2ed70" ]
[ "loss/modules/det_modules.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# Author: Donny You(youansheng@gmail.com)\n\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport math\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom...
[ [ "torch.nn.functional.smooth_l1_loss", "torch.nn.MSELoss", "torch.autograd.Variable", "torch.clamp", "torch.nn.functional.cross_entropy", "torch.eye", "torch.nn.BCELoss", "torch.nn.functional.softmax", "torch.zeros_like", "torch.log", "torch.exp" ] ]
treyvoid/Wordcloud-generator
[ "615344e12009e2b147279614c6958e86df914aee" ]
[ "wc.py" ]
[ "# %%\n\"\"\"\n# Project - Word Cloud\n\"\"\"\n\n# %%\n\"\"\"\nFor this project, you'll create a \"word cloud\" from a text by writing a script. This script needs to process the text, remove punctuation, ignore case and words that do not contain all alphabets, count the frequencies, and ignore uninteresting or irr...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
penseesface/NeuralVoicePuppetry
[ "7eb3d6660c5212615415a4273874f848bc4d7d53" ]
[ "Unet_train/models/VGG_LOSS.py" ]
[ "import os\nimport torch\nimport torch.nn as nn\nimport torchvision.transforms as transforms\n# from util.image_pool import ImagePool\n# from .base_model import BaseModel\n# from . import networks\nimport numpy as np\nimport functools\nfrom torchvision import models\nfrom collections import namedtuple\n\nclass VGG1...
[ [ "torch.nn.Sequential", "torch.nn.MSELoss" ] ]
lawsuisum/fedavgpy
[ "f6333880056da208aa78d284594ba094733be30e" ]
[ "src/trainers/fedavg4.py" ]
[ "from src.trainers.base import BaseTrainer\nfrom src.models.model import choose_model\nfrom src.models.worker import LrdWorker\nfrom src.optimizers.gd import GD\nimport numpy as np\nimport torch\n\n\ncriterion = torch.nn.CrossEntropyLoss()\n\n\nclass FedAvg4Trainer(BaseTrainer):\n \"\"\"\n Scheme I and Scheme...
[ [ "numpy.random.seed", "numpy.array", "torch.nn.CrossEntropyLoss", "torch.zeros_like" ] ]
orhonovich/q-squared
[ "cab6027dc9a50cf73d80caf0858da05c2323c433" ]
[ "precision_recall.py" ]
[ "# Copyright 2020 The Q2 Authors\r\n# \r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n# \r\n# https://www.apache.org/licenses/LICENSE-2.0\r\n# \r\n# Unless required by ap...
[ [ "numpy.array", "sklearn.metrics.precision_recall_curve", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "pandas.DataFrame", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.figure...
wangguanquan/HanLP
[ "c46dc719ce1ad2e64d793eedce5f7f641592f7b7" ]
[ "hanlp/components/ner.py" ]
[ "# -*- coding:utf-8 -*-\n# Author: hankcs\n# Date: 2019-09-14 20:33\nfrom abc import ABC\nfrom typing import Union, Any, Tuple, Iterable\n\nimport tensorflow as tf\nfrom hanlp.components.taggers.transformers.transformer_transform import TransformerTransform\n\nfrom hanlp.common.transform import Transform\n\nfrom ha...
[ [ "tensorflow.keras.losses.SparseCategoricalCrossentropy" ] ]
t1nak/ba900
[ "c2fdc71553ab20127b7cdcdc7ea382d7c6c0ac4b" ]
[ "ba900/extract_data.py" ]
[ "from more_itertools import unique_everseen\nfrom collections import Counter\nfrom lxml import etree\nimport pandas as pd\nimport numpy as np\nfrom iteration import *\nimport os\n\ndef save_yearly_data(years, dirin, dirout):\n\n\tall_data = []\n\tfor y in years:\n\t\tpaths = []\n\t\trootdir = dirin+str(y)+'/'\n\t\t...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
sblack-usu/ulmo
[ "3213bf0302b44e77abdff1f3f66e7f1083571ce8" ]
[ "test/usgs_eddn_test.py" ]
[ "from __future__ import print_function\nfrom datetime import datetime\nimport pandas as pd\nfrom pandas.util.testing import assert_frame_equal\nimport ulmo\nimport ulmo.usgs.eddn.parsers as parsers\nimport test_util\n\nfmt = '%y%j%H%M%S'\n\nmessage_test_sets = [\n {\n 'dcp_address': 'C5149430',\n '...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.np.unique" ] ]
p-b-j/census2020-das-e2e
[ "e17d99628f2f3d97caa6d0e959e5b61bcdb0d4d6" ]
[ "optimization/utils.py" ]
[ "\"\"\" Utility functions for creating and solving optimization problems \"\"\"\n\nimport os\nimport logging\nimport time\nimport das_framework.ctools.clogging as clogging\nimport gurobipy as gb\nimport numpy as np\nfrom constants import *\n\n\ndef getGurobiEnvironment(config, retries=10):\n \"\"\" Create a new ...
[ [ "numpy.random.uniform" ] ]
sida-wang/py-rse
[ "f5860c3339d987efb8d54e110b0321386708b06a" ]
[ "zipf/bin/test_zipfs.py" ]
[ "from collections import Counter\n\nimport pytest\nimport numpy as np\n\nimport plotcounts\nimport countwords\nimport collate\n\n\ndef test_alpha():\n \"\"\"Test the calculation of the alpha parameter.\n\n The test word counts satisfy the relationship,\n r = cf**(-1/alpha), where\n r is the rank,\n ...
[ [ "numpy.arange" ] ]
rajshah4/pytorch-widedeep
[ "6540cd3cb33b2d7f0ad55e73371094e0d4f9907b" ]
[ "pytorch_widedeep/models/tabnet/_utils.py" ]
[ "import numpy as np\nfrom scipy.sparse import csc_matrix\n\nfrom pytorch_widedeep.wdtypes import WideDeep\n\n\ndef create_explain_matrix(model: WideDeep) -> csc_matrix:\n \"\"\"\n Returns a sparse matrix used to compute the feature importances after\n training\n\n Parameters\n ----------\n model: ...
[ [ "scipy.sparse.csc_matrix", "numpy.zeros" ] ]
rajammanabrolu/C2PO
[ "eab56925a84b34ffcf1183932148523c1db5c67c" ]
[ "C2PO/src/interactive/functions.py" ]
[ "import torch\n\nfrom src.data.utils import TextEncoder\nimport src.data.config as cfg\nimport src.data.data as data\nimport src.models.models as models\nfrom src.evaluate.sampler import BeamSampler, GreedySampler, TopKSampler\n\nimport utils.utils as utils\n\n\ndef load_model_file(model_file):\n model_stuff = d...
[ [ "torch.zeros", "torch.no_grad", "torch.LongTensor" ] ]
philschatz/manim
[ "e3359a571d9a02a08979b3e037ddada3e874eb7c", "e3359a571d9a02a08979b3e037ddada3e874eb7c" ]
[ "manim/mobject/mobject_update_utils.py", "manim/animation/animation.py" ]
[ "\"\"\"Utility functions for continuous animation of mobjects.\"\"\"\n\n__all__ = [\n \"assert_is_mobject_method\",\n \"always\",\n \"f_always\",\n \"always_redraw\",\n \"always_shift\",\n \"always_rotate\",\n \"turn_animation_into_updater\",\n \"cycle_animation\",\n]\n\n\nimport inspect\nim...
[ [ "numpy.linalg.norm", "numpy.clip" ], [ "numpy.clip" ] ]
AkashKhamkar/Stock_Price_Prediction
[ "12bdf7c4490a280965a2d6895d96c20301ba678f" ]
[ "stock_price_prediction.py" ]
[ "import pandas as pd\r\nimport datetime\r\nimport numpy as np \r\nimport pandas_datareader.data as web\r\nfrom pandas import Series, DataFrame\r\nfrom math import ceil \r\nfrom sklearn import preprocessing \r\nfrom sklearn.model_selection import train_test_split \r\nfrom sklearn.linear_model import LinearRegression...
[ [ "numpy.array", "sklearn.linear_model.Lasso", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "sklearn.preprocessing.PolynomialFeatures", "sklearn.linear_model.Ridge", "sklearn.preprocessing.scale", ...
sciatti/mazesolving
[ "5b7fb11e52e57112bca7d8051d84bd3c6c01fe16" ]
[ "sidewinder.py" ]
[ "import generator_utils as util\nimport random\nimport numpy as np\n\nclass node:\n def __init__(self, walls_in):\n self.walls = walls_in\n\ndef sidewinder(rows, cols, gif):\n if gif:\n return sidewinder_gif(rows, cols)\n \n grid = [[node(['L','R','T','B']) for j in range(cols)] for i in r...
[ [ "numpy.zeros" ] ]
96imranahmed/Born-Again-Tree-Ensembles
[ "ea68e8a09007ec30cf1e57f5199f069e7be2841d" ]
[ "src/tree.py" ]
[ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport copy\nfrom networkx.drawing.nx_agraph import write_dot, graphviz_layout\nimport collections\n\n\nclass DecisionTree(object):\n d_tree_dict = None\n columns = None\n\n def __init__(self, dict_in, columns...
[ [ "matplotlib.pyplot.savefig", "numpy.array" ] ]