repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
jinxu06/pixel-cnn | [
"9cad98f3f801bd772815dbb403fb6649ff704dfa"
] | [
"data/svhn_data.py"
] | [
"\"\"\"\nUtilities for downloading and unpacking the CIFAR-10 dataset, originally published\nby Krizhevsky et al. and hosted here: https://www.cs.toronto.edu/~kriz/cifar.html\n\"\"\"\n\nimport os\nimport sys\nimport numpy as np\nfrom PIL import Image\n\ndef read_imgs(dir):\n loadmat(dir)\n dirpath, dirnames, ... | [
[
"numpy.amax",
"numpy.random.RandomState"
]
] |
philip-shen/note_python | [
"db0ad84af25464a22ac52e348960107c81e74a56"
] | [
"Zip_UnZip/test/test_json.py"
] | [
"# 3/28/2020 Convert Nested JSON to Pandas DataFrame and Flatten List in a Column \n# https://gist.github.com/rafaan/4ddc91ae47ea46a46c0b\n########################################################\n\nimport json\nfrom pandas.io.json import json_normalize\nimport pandas as pd\n\nimport os,sys,time\n\nstrabspath=os.pa... | [
[
"pandas.DataFrame"
]
] |
simchanu29/simple_teleop | [
"aa70d7edb05c7eddc88b00cf3e49cc718cc51838"
] | [
"src/message_handler/Interpreter_position_speed.py"
] | [
"import rospy\nfrom std_msgs.msg import Float32\nfrom Interpreter import Interpreter\nimport numpy as np\n\n\nclass Interpreter_position_speed(Interpreter):\n def __init__(self, interpreter_info):\n super(Interpreter_position_speed, self).__init__(interpreter_info)\n self.cmd.val = 0.0 # position\... | [
[
"numpy.clip"
]
] |
Delegation-numerique-en-sante/mesconseilsprevention | [
"7e4598ac05d69b0aa8b7c8ad05329b3deb2a933f"
] | [
"api/test_preprocess.py"
] | [
"from pandas._testing import assert_frame_equal\nimport pandas\nimport pytest\n\nfrom preprocess import MAX_AGE\n\n\ndef test_format_list():\n from preprocess import format_list\n\n assert format_list(\n [\n \"La santé des adolescents (11 à 17 ans)\",\n \"La santé des jeunes adult... | [
[
"pandas.DataFrame",
"pandas._testing.assert_frame_equal"
]
] |
CR320/DeeCamp-10Group-Unsupervised-Defect-Segmentation | [
"f5f75093f21cee03b0b3c4c085fd9e22d75fc47e"
] | [
"model/trainer.py"
] | [
"\"\"\"training container\n\nauthor: Haixin wang\ne-mail: haixinwa@gmail.com\n\"\"\"\n\n\nimport torch\nimport torch.nn as nn\n\n\nclass Network(nn.Module):\n def __init__(self, model, loss):\n super(Network, self).__init__()\n self.model = model\n self.loss = loss\n\n def forward(self, i... | [
[
"torch.save",
"torch.stack",
"torch.load"
]
] |
sethmerkel/qiskit-aer | [
"b95e95fd4aa073a13b9599053dbdf29a06b35a2e"
] | [
"test/terra/backends/aer_simulator/instructions/test_save_state.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio... | [
[
"numpy.all",
"numpy.allclose"
]
] |
delgadom/geoclaw | [
"8893cf487e2972bf67e455bbb58b236ec24150bb"
] | [
"examples/tsunami/chile2010/setplot.py"
] | [
"\n\"\"\" \nSet up the plot figures, axes, and items to be done for each frame.\n\nThis module is imported by the plotting routines and then the\nfunction setplot is called to set the plot parameters.\n \n\"\"\" \n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nimport numpy as np... | [
[
"numpy.linspace",
"numpy.loadtxt"
]
] |
pmacosta/putil | [
"416cea52df8221981727e25d133e9b4e3f464798"
] | [
"docs/support/plot_example_7.py"
] | [
"# plot_example_7.py\n# Copyright (c) 2013-2016 Pablo Acosta-Serafini\n# See LICENSE for details\n# pylint: disable=C0111,C0410\n\nfrom __future__ import print_function\nimport numpy, putil.plot\n\ndef figure_iterator_example(no_print):\n source1 = putil.plot.BasicSource(\n indep_var=numpy.array([1, 2, 3,... | [
[
"numpy.array"
]
] |
duolinwang/DM3Loc | [
"efb859841a40e92ae7fd78c01140144fc2405233"
] | [
"Multihead_train.py"
] | [
"import datetime\nimport itertools\nfrom collections import OrderedDict\nimport argparse\nimport os\nimport sys\n\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"\nbasedir='./'\nsys.path.append(basedir)\n#sys.path.append(os.path.dirname(os.path.abspath(__file__)))\n\nimport tensorflow as tf\n\ngpu_options = tf.GPUOpti... | [
[
"sklearn.utils.class_weight.compute_class_weight",
"tensorflow.Session",
"tensorflow.ConfigProto",
"sklearn.model_selection.KFold",
"tensorflow.GPUOptions"
]
] |
ahojukka5/scikit-fem | [
"f80b8c9ea8742c23586818e61a2d6ca148833e0c"
] | [
"skfem/assembly/form/form.py"
] | [
"from typing import Callable\n\nimport numpy as np\nfrom numpy import ndarray\nfrom scipy.sparse import coo_matrix\n\nfrom ...element import DiscreteField\n\n\nclass FormDict(dict):\n \"\"\"Passed to forms as 'w'.\"\"\"\n\n def __getattr__(self, attr):\n return self[attr].value\n\n\nclass Form:\n\n ... | [
[
"scipy.sparse.coo_matrix",
"numpy.array"
]
] |
dwhan89/comsmimikyu | [
"927c56f76a9c9f7c517a86a52586b8958c308328"
] | [
"bin/sehgal_training_pixgan_wgp.py"
] | [
"import os\n\nimport mlflow\nimport numpy as np\nimport torch\nfrom orphics import maps\n\nfrom cosmikyu import gan, config, datasets, transforms\nfrom cosmikyu import nn as cnn\n\ndata_dir = config.default_data_dir\nsehgal_dir = os.path.join(data_dir, 'sehgal')\ncuda = True\ncompts = [\"kappa\", \"ksz\", \"tsz\", ... | [
[
"torch.cuda.empty_cache",
"torch.utils.data.DataLoader"
]
] |
bikash/pyhsmm | [
"94fab0ea66072a639b20163c40db04c18069496c"
] | [
"util/profiling.py"
] | [
"from __future__ import division\nimport numpy as np\nimport sys, StringIO, inspect, os, functools, time, collections\n\n### use @timed for really basic timing\n\n_timings = collections.defaultdict(list)\n\ndef timed(func):\n @functools.wraps(func)\n def wrapped(*args,**kwargs):\n tic = time.time()\n ... | [
[
"numpy.std",
"numpy.sum",
"numpy.mean"
]
] |
rupinderjdn/OpenCV | [
"76055d393a36ad747fdf840d3ae542d3a94c0e68"
] | [
"15 Gaussian Blurring.py"
] | [
"import cv2 as cv\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimg = cv.imread('dia mirza.jpg')\nblur = cv.GaussianBlur(img,(5,5),1)\nplt.subplot(121),plt.imshow(img),plt.title('Original')\nplt.xticks([]), plt.yticks([])\nplt.subplot(122),plt.imshow(blur),plt.title('Blurred')\nplt.xticks([]), plt.ytic... | [
[
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.imshow"
]
] |
fullcyxuc/HPCnet_examples | [
"999ef3f33ba73ba1d86f4d5df3f0160b46016be8"
] | [
"tools/HausdorffTest/getGtFeature.py"
] | [
"import torch\nfrom typing import Tuple\nfrom torch.autograd import Variable\nfrom torch.autograd import Function\nimport torch.nn as nn\nimport math\nfrom HausdorffTest.ReadShapes import read_keyfile\nfrom HausdorffTest.ReadShapes import LoadGivenShapes\nimport time\nimport os\nimport sys\nimport torch.multiproces... | [
[
"torch.cuda.FloatTensor"
]
] |
chudur-budur/visualization | [
"8013fbdef55fac770d439454207dc07be88fe7c3"
] | [
"viz/plotting/pcp.py"
] | [
"\"\"\"pcp.py -- A customized and more flexible Parallel-coordinate plotting module. \n\n This module provides a customized and more flexible function for Parallel-coordinate \n Plot (PCP) [1]_ visualization. This module also provides different relevant fucntions, \n parameters and tools.\n\n Copyright ... | [
[
"numpy.max",
"matplotlib.cm.ScalarMappable",
"numpy.array",
"numpy.column_stack",
"numpy.zeros",
"numpy.ones",
"numpy.min",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.colors.Normalize",
"numpy.argsort",
"matplotlib.colors.ListedColormap"
]
] |
MatthieuDartiailh/oculy | [
"0cdae49aa1b546f26b31d14e944c7d481d368361"
] | [
"oculy/plotting/backends/matplotlib/axes.py"
] | [
"# --------------------------------------------------------------------------------------\n# Copyright 2021 by Oculy Authors, see git history for more details.\n#\n# Distributed under the terms of the BSD license.\n#\n# The full license is in the file LICENCE, distributed with this software.\n# --------------------... | [
[
"matplotlib.colorbar.make_axes"
]
] |
greenstar1151/pytorch-benchmark | [
"8b7808d3be6b7ca1d57f1812e35fd2df5e470f8b"
] | [
"torchbenchmark/models/fastNLP_Bert/__init__.py"
] | [
"\"\"\"\nfastNLP model (TorchBenchmark Version)\nThis model resembles the \"BertEmedding Q&A\" task in [fastNLP Tutorial](https://fastnlp.readthedocs.io/zh/latest/tutorials/extend_1_bert_embedding.html).\n\nInput data simulates [CMRC2018 dataset](https://ymcui.com/cmrc2018/).\nThe program runs only for benchmark pu... | [
[
"torch.manual_seed",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.random.seed"
]
] |
peterukk/ecrad | [
"d2cd86b63b60cd2bc1e8d8e189a098e1ec287e07"
] | [
"practical/ecradplot/general.py"
] | [
"\"\"\"\nFilename: general.py\nAuthor: Shannon Mason, shannon.mason@ecmwf.int\nDescription: Common plotting functions.\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\n\n#For loading and handling netCDF data\nimport xarray as xr\n\ndef format_time(ax, format_string=\"%H:%M\", label='Time (UTC)'):\n ... | [
[
"matplotlib.dates.DateFormatter"
]
] |
bosques-urbanos/open_model_zoo | [
"c1deee7b0707621c248e6d74b43b1564e94cf001"
] | [
"demos/python_demos/speech_recognition_demo/ctcdecode-numpy/setup.py"
] | [
"#!/usr/bin/env python3\n#\n# Copyright (C) 2020 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n#\n# This file is based in part on setup.py and build.py from https://github.com/parlance/ctcdecode,\n# commit 431408f22d93ef5ebc4422995111bbb081b971a9 on Apr 4, 2020, 20:54:49 UTC+1.\n#\nimport glob\nimport n... | [
[
"numpy.get_include"
]
] |
seanmchu/algo-research | [
"199964b7ce376a88e248349946538cb2159c4797",
"199964b7ce376a88e248349946538cb2159c4797"
] | [
"matching/plot15.py",
"matching/plot20.py"
] | [
"import matplotlib.pyplot as plt\nimport matplotlib.markers\nhfont = {'fontname':'serif'}\n\ndef fix(a):\n print(a)\n a[0] = a[0]/89.5\n a[1] = a[1]/79.5\n a[2] = a[2]/69.5\n a[3] = a[3]/59.5\n print(a)\n\nx = [20,40,60,80]\naz = [72.93449999999999, 55.38224999999999, 39.46649999999999, 50.3047500... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
],
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.sho... |
denecity/n-Body | [
"9b58e4ab9bba0684d8457942dc68a68cc1598e8a"
] | [
"n-body problen.py"
] | [
"# N-Body Problem.py\r\n# Denis Titov 29.11.2018\r\n\r\nimport pygame\r\nfrom pygame import gfxdraw\r\nimport random\r\nfrom numba import jit\r\nimport numpy as np\r\n\r\n\r\nnumParticles = 2000\r\n\r\ndisplaySize = (1000, 1000)\r\n\r\nmassSpread = (2, 20)\r\n\r\nblack = (255, 255, 255)\r\nwhite = (0, 0, 0)\r\n\r\n... | [
[
"numpy.sum",
"numpy.zeros"
]
] |
jwcalder/MSTAR-Active-Learning | [
"6918543be495955cdcd6005dce645f029b964e51"
] | [
"Python/mstar_run_al_nga.py"
] | [
"'''\nPython script to run active learning test on MSTAR data, starting with 100 initially labeled points per class and label 100 more per class.\n * Run this script through command line (terminal).\n * View parameter descriptions with \"python mstar_run_al.py --help\"\n'''\n\nimport numpy as np\nimport graph... | [
[
"numpy.load",
"scipy.sparse.linalg.LinearOperator",
"numpy.where",
"numpy.unique",
"numpy.concatenate",
"pandas.DataFrame",
"numpy.save",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.array",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"skle... |
damien911224/maxl | [
"6ac4ee712f0b68bb1f8ea2e3602f75085c08fd25"
] | [
"model_vgg_maxl.py"
] | [
"from collections import OrderedDict\nfrom create_dataset import *\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torchvision.transforms as transforms\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.utils.data.sampler as sampler\n\nclass LabelGenerator(nn.Module):\n... | [
[
"torch.nn.Linear",
"torch.optim.lr_scheduler.StepLR",
"torch.nn.BatchNorm2d",
"torch.cuda.is_available",
"torch.exp",
"torch.sum",
"torch.nn.Softmax",
"torch.nn.init.constant_",
"torch.nn.MaxPool2d",
"torch.utils.data.DataLoader",
"torch.nn.functional.relu",
"torch.... |
Thomas2512/CS224n-NLP | [
"6c8ad402498600cf0ccc9f2dd75074c044f219c8"
] | [
"Assignments/Assignment 2/assignment2/q2_parser_model.py"
] | [
"import pickle\nimport os\nimport time\nimport tensorflow as tf\n\nfrom model import Model\nfrom q2_initialization import xavier_weight_init\nfrom utils.parser_utils import minibatches, load_and_preprocess_data\n\n\nclass Config(object):\n \"\"\"Holds model hyperparams and data information.\n\n The config cla... | [
[
"tensorflow.zeros",
"tensorflow.train.AdamOptimizer",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.Variable",
"tensorflow.train.Saver",
"tensorflow.reshape",
"tensorflow.linalg.matmul",
"tensorflow.placeholder",
"tensorflow.nn.relu_layer",
"tensorflow.nn.embedd... |
tbienhoff/carla-rl | [
"51960c8ce3b7e90cdd6c3ab5e18721d1969e1b50"
] | [
"client/carla/planner/map.py"
] | [
"# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de\n# Barcelona (UAB).\n#\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n\n\"\"\"Class used for operating the city map.\"\"\"\n\nimport math\nimport os\n\ntry:\n ... | [
[
"numpy.asarray",
"numpy.fliplr"
]
] |
KristineYW/DS-Unit-3-Sprint-2-SQL-and-Databases | [
"4a690cd8e651161296d7aec2af86a56c499d6801"
] | [
"module2-sql-for-analysis/insert_titanic.py"
] | [
"import os\nimport json\nfrom dotenv import load_dotenv\nimport psycopg2\nfrom psycopg2.extras import execute_values\nimport pandas as pd\n\n# Load contents of the .env file into the script's environment\nload_dotenv() \n\n# Add credentials for accessing the elephant \nDB_NAME = os.getenv(\"DB_NAME\")\nDB_USER = os... | [
[
"pandas.read_csv"
]
] |
carbon-drive/pyleecan | [
"e89d4fe97f23f6182c19127d2c6a2133614e169d"
] | [
"pyleecan/Methods/Machine/Winding/comp_connection_mat.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom numpy import zeros, swapaxes, sign\n\nfrom ....Methods.Machine.Winding import WindingError\n\n\nfrom swat_em import datamodel\n\n\ndef comp_connection_mat(self, Zs=None, p=None):\n \"\"\"Compute the Winding Matrix for\n\n Parameters\n ----------\n self : Winding\n ... | [
[
"numpy.sign",
"numpy.swapaxes",
"numpy.zeros"
]
] |
lukaselflein/sarah_folderstructure | [
"a725271db3d8b5b28b24918b3daf0942fa04dcd8"
] | [
".template_simulation/average_cost.py"
] | [
"\"\"\" Average Cost Functions for Horton to determine Charges for Molecular Dynamics.\nCopyright 2019 Simulation Lab\nUniversity of Freiburg\nAuthor: Lukas Elflein <elfleinl@cs.uni-freiburg.de>\n\"\"\"\n\nimport numpy as np\nimport h5py\nimport shutil\nimport warnings\nimport os\nfrom smamp.tools import cd\n\n\nde... | [
[
"numpy.allclose",
"numpy.array"
]
] |
nmail-sds/Framework | [
"20ce6767188adbccd9edc15000dbdfa25cfdab70"
] | [
"data/sampling.py"
] | [
"'''\n2019. 1. 21\nSMOTE data sampling\nYihan Kim\n\nusage : import sampling.smote as smote \n\n'''\n\nfrom ds import Pair, Data\nfrom sklearn.datasets import make_classification\nfrom imblearn.over_sampling import SMOTE\n\ndef smote_dataset(dataset: Data):\n # unpack \n X = dataset.train.data \n y = datas... | [
[
"sklearn.datasets.make_classification"
]
] |
sanixa/P3GM_custom | [
"fbd8fb61ca58cc681fae7e8272df1655acf4d804"
] | [
"dp_utils/dp_pca.py"
] | [
"\"\"\" DP Principal Component Analysis\n\"\"\"\n\n# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Olivier Grisel <olivier.grisel@ensta.org>\n# Mathieu Blondel <mathieu@mblondel.org>\n# Denis A. Engemann <denis-alexander.engemann@inria.fr>\n# Michael Eickenberg <michael... | [
[
"numpy.dot",
"numpy.linalg.norm",
"numpy.mean",
"numpy.eye",
"numpy.linalg.eig"
]
] |
chihhao428/pytorch-optimizer | [
"e049b0526ccb70317faf0c6f8dd97ec02d04a5b2"
] | [
"tests/test_basic.py"
] | [
"import pytest\nimport torch\n\nimport torch_optimizer as optim\n\n\ndef rosenbrock(tensor):\n x, y = tensor\n return (1 - x) ** 2 + 1 * (y - x ** 2) ** 2\n\n\ndef quadratic(tensor):\n x, y = tensor\n a = 1.0\n b = 1.0\n return (x ** 2) / a + (y ** 2) / b\n\n\ndef beale(tensor):\n x, y = tensor... | [
[
"torch.allclose",
"torch.Tensor"
]
] |
Vandervir/PyLight | [
"694ba1d39010d4474f9fc581011ea8bbc7219b1a"
] | [
"main.py"
] | [
"import pyaudio\nimport numpy as np\nfrom magichome import MagicHomeApi\nimport cv2\nimport time\nfrom screen import grab_screen\nimport colorsysą\n\nregions = [(130, 130, 260, 260), (130, 760, 260, 890), (900, 480, 1120, 600), (1660, 130, 1780, 260),\n (1660, 760, 1780, 890)]\n\n\nclass ColorControl:\n ... | [
[
"numpy.float32",
"numpy.fromstring",
"numpy.reshape"
]
] |
Kajune/stylegan2-pytorch | [
"8a15338843a814c6d3b7c0151c814c8a6c75c028"
] | [
"stylegan2_pytorch/stylegan2_pytorch.py"
] | [
"import os\nimport sys\nimport math\nimport fire\nimport json\nimport urllib.request\nimport urllib.parse\nimport io\n\nfrom tqdm import tqdm\nfrom math import floor, log2\nfrom random import random\nfrom shutil import rmtree\nfrom functools import partial\nimport multiprocessing\nfrom contextlib import contextmana... | [
[
"torch.cat",
"torch.isnan",
"numpy.mean",
"torch.ones",
"torch.cuda.is_available",
"torch.flip",
"torch.norm",
"torch.FloatTensor",
"torch.tensor",
"numpy.arange",
"torch.index_select",
"torch.nn.functional.relu",
"torch.nn.functional.conv2d",
"torch.Tensor"... |
koldunovn/pyfesom2 | [
"68a5473eb84301edb25bbb389093e3d3a9999ffc"
] | [
"pyfesom2/transport.py"
] | [
"\"\"\"\nModule for computing transports across sections from fesom2 output\nAuthor: Finn Heukamp (finn.heukamp@awi.de)\nInitial version: 23.11.2021\n\"\"\"\n\nimport warnings\nfrom os.path import isfile, isdir\nimport xarray as xr\nimport numpy as np\nimport shapely.geometry as sg\nimport pyproj\nimport pymap3d as... | [
[
"numpy.delete",
"numpy.ones_like",
"numpy.array",
"numpy.argmin",
"numpy.mean",
"numpy.diff",
"numpy.where",
"numpy.arange",
"numpy.transpose",
"numpy.linspace"
]
] |
ArvinSiChuan/keras-yolo3 | [
"4eebe12e59d73e550d894c0d33b3ca15b57c0e64"
] | [
"yolo.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nClass definition of YOLO_v3 style detection model on image and video\n\"\"\"\n\nimport colorsys\nimport os\nfrom timeit import default_timer as timer\n\nimport numpy as np\nfrom keras import backend as K\nfrom keras.models import load_model\nfrom keras.layers import Input\nfrom PIL... | [
[
"numpy.array",
"numpy.asarray",
"numpy.random.seed",
"numpy.random.shuffle",
"numpy.expand_dims",
"numpy.floor"
]
] |
cristobalfuenzalida/grafica | [
"cf7bb90c4c5c34ee56d328188111c917a0d10389"
] | [
"grafica/scene_graph.py"
] | [
"# coding=utf-8\n\"\"\"A simple scene graph class and functionality\"\"\"\n\nfrom OpenGL.GL import *\nimport OpenGL.GL.shaders\nimport numpy as np\nimport grafica.transformations as tr\nimport grafica.gpu_shape as gs\n\n__author__ = \"Daniel Calderon\"\n__license__ = \"MIT\"\n\n\nclass SceneGraphNode:\n \"\"\"\n... | [
[
"numpy.array",
"numpy.matmul"
]
] |
m1ka05/tensiga | [
"32a2e5310aff649d9f911d28d49d4ba65c2a4304"
] | [
"tensiga/utils/mat_dot_sp.py"
] | [
"import numpy as np\n\ndef mat_dot_sp(A, B, axis=-1):\n if len(A.shape) == 1:\n return A @ B\n\n A = np.moveaxis(A, axis, -1)\n Ashape = A.shape\n\n # this is equivalent to contracting A with B along the given axis\n A = A.reshape(np.prod(A.shape[:-1]), A.shape[-1])\n A = A @ B\n\n A = A... | [
[
"numpy.moveaxis",
"numpy.prod"
]
] |
Dragon-M-Ren/grad_code | [
"d814b81adaec709d5dffd737f0c350953cc361fd"
] | [
"code/utils.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom load_data import create_raw_input\nfrom scipy.sparse.linalg.eigen.arpack import eigsh\n\n\ndef create_load_sparse(sparse_mat):\n '''\n The sparse matrix is saved as a scipy sparse matrix\n It cannot be directly used by TF\n ... | [
[
"numpy.max",
"scipy.sparse.coo_matrix",
"numpy.isinf",
"scipy.sparse.diags",
"numpy.zeros",
"scipy.sparse.csr_matrix.todense",
"numpy.linalg.eigh",
"scipy.sparse.eye",
"numpy.power",
"scipy.sparse.linalg.eigen.arpack.eigsh",
"scipy.sparse.isspmatrix_coo",
"scipy.spa... |
vemonet/fuji | [
"92aabcb58d76a58981c677bcf0da8e57309c6096"
] | [
"fuji_server/controllers/fair_check.py"
] | [
"# -*- coding: utf-8 -*-\n\n# MIT License\n#\n# Copyright (c) 2020 PANGAEA (https://www.pangaea.de/)\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including... | [
[
"pandas.DataFrame"
]
] |
czarmanu/deeplab-lakeice-webcams | [
"fc5e4152f73755b6f2ed0fd1ef2dbd5e10186bf9"
] | [
"eval.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 requi... | [
[
"tensorflow.reshape",
"tensorflow.zeros_like",
"tensorflow.logging.info",
"tensorflow.contrib.training.SummaryAtEndHook",
"tensorflow.ConfigProto",
"tensorflow.gfile.MakeDirs",
"tensorflow.less_equal",
"tensorflow.app.run",
"tensorflow.metrics.mean_iou",
"tensorflow.logging... |
Jiggu07/Tic-tac-toe | [
"0e7ab80a59720cedc4c0c52390aab49bd4c216be"
] | [
"training_(AIvsAI)_ReinforcementLearning.py"
] | [
"import numpy as np\nfrom math import inf as infinity\nimport itertools\nimport random\nimport time\n\ngame_state = [[' ',' ',' '],\n [' ',' ',' '],\n [' ',' ',' ']]\nplayers = ['X','O']\n\ndef play_move(state, player, block_num):\n if state[int((block_num-1)/3)][(block_num-1)%3] is ' '... | [
[
"numpy.full",
"numpy.savetxt",
"numpy.loadtxt",
"numpy.argmax",
"numpy.random.uniform"
]
] |
hconanb/hep_ml | [
"5f13d27a737b4d83f4346c80d3623c93cc91e716"
] | [
"tests/test_reweight.py"
] | [
"from __future__ import division, print_function, absolute_import\n\nimport numpy\n\nfrom hep_ml.reweight import BinsReweighter, GBReweighter, FoldingReweighter\nfrom hep_ml.metrics_utils import ks_2samp_weighted\n\n__author__ = 'Alex Rogozhnikov'\n\n\ndef weighted_covariance(data, weights):\n if len(data.shape)... | [
[
"numpy.random.normal",
"numpy.random.mtrand.multivariate_normal",
"numpy.ones",
"numpy.mean",
"numpy.einsum",
"numpy.average",
"numpy.diag"
]
] |
agganu/motion_illusions | [
"a5343bada7678827a53551e637e21fcd1a189a0d"
] | [
"motion_illusions/utils/rate_limit.py"
] | [
"###############################################################################\n#\n# File: rate_limit.py\n#\n# Accurate rate limiter\n#\n# History:\n# 02-13-20 - Levi Burner - Created file\n#\n###############################################################################\n\nimport time\nimport numpy as np\n\ncla... | [
[
"numpy.average",
"numpy.var",
"numpy.zeros"
]
] |
chromy/PyOP2 | [
"8a1955c628b795019485c9771709c338a806e661"
] | [
"test/unit/test_linalg.py"
] | [
"# This file is part of PyOP2\n#\n# PyOP2 is Copyright (c) 2012, Imperial College London and\n# others. Please see the AUTHORS file in the main source directory for\n# a full list of copyright holders. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, ar... | [
[
"numpy.arange",
"numpy.zeros"
]
] |
dby-tmwctw/nlp-architect | [
"6a865201fdef15042d731cf53f54dcf981c32aea"
] | [
"examples/supervised_sentiment/customized_reviews.py"
] | [
"import json\n\nimport pandas as pd\n\nfrom nlp_architect.utils.generic import normalize, balance\n\nimport csv\n\ngood_columns = [\"overall\", \"reviewText\", \"summary\"]\n\n\ndef review_to_sentiment(review):\n # Review is coming in as overall (the rating, reviewText, and summary)\n # this then cleans the s... | [
[
"pandas.DataFrame",
"pandas.get_dummies"
]
] |
XingzhiZhou/mmselfsup | [
"fc69e380095a7eda7632beada5611db527b57672"
] | [
"tests/test_runtime/test_extract_process.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nfrom unittest.mock import MagicMock\n\nimport pytest\nimport torch\nimport torch.nn as nn\nfrom mmcv.parallel import MMDataParallel\nfrom torch.utils.data import DataLoader, Dataset\n\nfrom mmselfsup.models.utils import ExtractProcess\n\n\nclass ExampleDataset(Datas... | [
[
"torch.rand",
"torch.nn.Conv2d",
"torch.tensor",
"torch.utils.data.DataLoader"
]
] |
jacobson15p/CenterPoint | [
"aee99be4545641864026ebc1dd6e92684580560c"
] | [
"det3d/models/bbox_heads/center_head.py"
] | [
"# ------------------------------------------------------------------------------\n# Portions of this code are from\n# det3d (https://github.com/poodarchu/Det3D/tree/56402d4761a5b73acd23080f537599b0888cce07)\n# Copyright (c) 2019 朱本金\n# Licensed under the MIT License\n# ---------------------------------------------... | [
[
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.BatchNorm2d",
"torch.exp",
"torch.flip",
"numpy.max",
"torch.sigmoid",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.savefig",
"torch.tensor",
"numpy.expand_dims",
"numpy.array",
"numpy.zeros",
"torch.max",
... |
malininae/ESMValTool | [
"9a1bf70a153135ebe2698e2275f6d6b1251e4d30"
] | [
"esmvaltool/diag_scripts/seaice/ipcc_sea_ice_diag_tools.py"
] | [
"import iris\nfrom iris.experimental.equalise_cubes import equalise_attributes\nimport logging\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nfrom scipy import stats, special\nimport sys\n\n# import internal esmvaltool modules here\nfrom esmvaltool.diag_scripts.ocean import diagnostic_tools as dia... | [
[
"numpy.asarray",
"matplotlib.pyplot.savefig",
"numpy.ma.array",
"numpy.average",
"matplotlib.pyplot.show"
]
] |
alhadidi/PiccoloKitchen | [
"9b64e809a90937b24b34701e1899b8a6a4add94b"
] | [
"Sensors/Computer codes/udpESP8266_csv.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\n\r\n@author: Alejandro Garcia\r\n\"\"\"\r\n\r\nimport socket\r\nimport pandas as pd\r\n#import csv\r\nimport time\r\nfrom datetime import datetime\r\n\r\ndata_kit=pd.DataFrame(columns=['Time',\r\n 'Sound1','Sound 1 Level', 'Sound2','Sound 2 Level',... | [
[
"pandas.DataFrame"
]
] |
PuneethRegonda/realtime_surveillance_system | [
"bf0f7a80c8a0f8bbaaf3dcb6fd7ee419708a5f4f"
] | [
"facemap_flask_backend/facemap_notebook.py"
] | [
"\nimport sys\nimport requests\nimport socketio\nimport cv2\nimport os\nimport numpy as np\nfrom PIL import Image\nimport pickle\nimport random\n\nprint(cv2.__file__)\n\nTOKEN =\"\"\n\n\n\nclass Recognizer:\n\n def __init__(self,socket):\n self.socket =socket\n self.stop = False\n print(\"in... | [
[
"numpy.array"
]
] |
jdayton3/Confounded | [
"907ed5b751f2a7b8905772b0912884e1a746424d"
] | [
"confounded/network.py"
] | [
"\"\"\"Definitions for the neural networks in Confounded.\n\"\"\"\n\n# pylint: disable=E1129\n\nimport functools\nimport tensorflow as tf\nfrom tensorflow.contrib.layers import fully_connected, batch_norm # pylint: disable=E0611\nfrom math import ceil\n\ndef is_square(n):\n sqrt = n**0.5\n return int(sqrt) ==... | [
[
"tensorflow.exp",
"tensorflow.contrib.layers.batch_norm",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.reshape",
"tensorflow.losses.mean_squared_error",
"tensorflow.shape",
"tensorflow.sigmoid",
"tensorflow.variable_scope",
"tensorflow.nn.sigmoid",
"tensorflow.g... |
ianrh125/hilbert-drawing | [
"2d3fbaf80b454f66de5b505a74f2e9533f385a6b"
] | [
"hilbert drawing.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Sep 13 10:35:41 2019\r\n\r\n@author: ianrh\r\n\"\"\"\r\n\r\nfrom PIL import Image\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport math\r\n\r\nimageLayers = []\r\n\r\n\"\"\"\r\nScaleUp affects the scale of the hilbert curve itself, effectively r... | [
[
"numpy.array",
"matplotlib.pyplot.plot",
"numpy.zeros",
"matplotlib.pyplot.figure"
]
] |
colincqian/SPIN | [
"4e34f4fdaac65a44026f7d5d244850d35cae46b9",
"4e34f4fdaac65a44026f7d5d244850d35cae46b9"
] | [
"datasets/preprocess/mpi_inf_3dhp.py",
"datasets/mixed_dataset.py"
] | [
"import os\nimport sys\nimport cv2\nimport glob\nimport h5py\nimport json\nimport numpy as np\nimport scipy.io as sio\nimport scipy.misc\nfrom .read_openpose import read_openpose\n\ndef read_calibration(calib_file, vid_list):\n Ks, Rs, Ts = [], [], []\n file = open(calib_file, 'r')\n content = file.readlin... | [
[
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.sum",
"scipy.io.loadmat",
"numpy.ones",
"numpy.logical_and",
"numpy.savez"
],
[
"numpy.array",
"numpy.random.rand"
]
] |
clararehmann/epistasis | [
"431d30504d1ef3f5a5ae0c8ee56844de2d6ababb"
] | [
"epistasis/simulate/linear.py"
] | [
"__description__ = \\\n\"\"\"\nClass for simulating genotype phenotype map with linear epistasis model.\n\"\"\"\n__author__ = \"Zach Sailer\"\n\nfrom epistasis.simulate.base import BaseSimulation\n\nimport numpy as np\n\nclass LinearSimulation(BaseSimulation):\n \"\"\"\n Construct an genotype-phenotype from l... | [
[
"numpy.dot"
]
] |
psyeon990/osmnx | [
"aaa5c3edf4a563c3e8a2c4067d15e7292ce307cc"
] | [
"osmnx/speed.py"
] | [
"\"\"\"Calculate graph edge speeds and travel times.\"\"\"\n\nimport re\n\nimport networkx as nx\nimport numpy as np\nimport pandas as pd\n\nfrom . import utils_graph\n\n\ndef add_edge_speeds(G, hwy_speeds=None, fallback=None, precision=1):\n \"\"\"\n Add edge speeds (km per hour) to graph as new `speed_kph` ... | [
[
"pandas.isnull",
"pandas.Series"
]
] |
fpwg/pyFAI | [
"cebf935b79333c9289a78b74ee99d550ebcdc549"
] | [
"pyFAI/units.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Project: Azimuthal integration\n# https://github.com/silx-kit/pyFAI\n#\n# Copyright (C) 2012-2018 European Synchrotron Radiation Facility, Grenoble, France\n#\n# Principal author: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>\n#\n# P... | [
[
"numpy.sqrt"
]
] |
kasper93/Halide | [
"35a78df088eddeffa56a62cf552c00c3d01f2db4"
] | [
"python_bindings/apps/interpolate.py"
] | [
"\"\"\"\nFast image interpolation using a pyramid.\n\"\"\"\n\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport time, sys\nimport halide as hl\n\nfrom datetime import datetime\nfrom imageio import imread, imsave\nimport numpy as np\nimport os.path\n\nint_t = hl.Int(32)\nfloat_t = hl.F... | [
[
"numpy.array",
"numpy.copy"
]
] |
jrclimer/Projects | [
"a9d4395a98a79fb0a700a99168cd358ab7494fdf"
] | [
"Basic_ML/Exploratory_Data_Analysis/exploratory_data_analysis.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nForbes2000 = pd.read_csv(\"Forbes2000.csv\", sep=',', usecols=range(0,9))\nForbes2000 = Forbes2000[1:]\n\n#companies by market value and profits\nfig, axes = plt.subplots(nrows=1, ncols=2, figsize=(15, 8))\nmarketv = axes[0].hist(np.array(... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"ma... |
SebastianoF/bruker2nif | [
"4fbac970e9125f3e53dd5e31d63b971ad739a6d2"
] | [
"bruker2nifti/_utils.py"
] | [
"import numpy as np\nimport os\nimport nibabel as nib\nimport re\nimport warnings\nfrom os.path import join as jph\n\n\n# --- text-files utils ---\n\n\ndef unique_words_in_string(in_string):\n ulist = []\n [ulist.append(s) for s in in_string.split() if s not in ulist]\n return ulist[0]\n\n\ndef indians_fil... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.linalg.norm",
"numpy.nan_to_num",
"numpy.copy",
"numpy.linalg.det",
"numpy.eye",
"numpy.prod",
"numpy.einsum",
"numpy.diag",
"numpy.linalg.inv"
]
] |
JinhuaSu/xview2_1st_place_solution | [
"6c653f2779d1780d70c2bb94fa41a3430e20ac3b"
] | [
"train_src/train_teacher_building.py"
] | [
"import os\nos.environ[\"MKL_NUM_THREADS\"] = \"1\" \nos.environ[\"NUMEXPR_NUM_THREADS\"] = \"1\" \nos.environ[\"OMP_NUM_THREADS\"] = \"1\" \n\nfrom os import path, makedirs, listdir\nimport sys\nimport numpy as np\nnp.random.seed(1)\nimport random\nrandom.seed(1)\n\nimport torch\nfrom torch import nn\nfrom torch.b... | [
[
"numpy.rot90",
"torch.sigmoid",
"numpy.random.seed",
"torch.no_grad",
"numpy.mean",
"torch.optim.lr_scheduler.MultiStepLR",
"torch.cuda.empty_cache",
"torch.utils.data.DataLoader"
]
] |
YXZhai97/Area-Coverage-Path-Planning | [
"3be475d703841432744c522b65f6d4d3dde647a3"
] | [
"tests/test.py"
] | [
"# import sample\n#\n#\n# agent1 = sample.AlphaAgent()\n# print(agent1.id)\n# print(sample.AlphaAgent.number_of_agent)\n# print(agent1.number_of_agent)\n#\n# agent2 = sample.AlphaAgent()\n# print(agent2.id)\n# print(sample.AlphaAgent.number_of_agent)\n# print(agent2.number_of_agent)\n#\n# # test floodFill\n# image ... | [
[
"numpy.logical_or",
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.argmin",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"numpy.sum",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.flipud",
"numpy.random.un... |
justinfocus12/SHORT | [
"75ade25953373bcd04f63e688393fee2df0e021a"
] | [
"oscillating_doublewell_model.py"
] | [
"# This is where the oscillating double well potential is specified\nimport numpy as np\nfrom os import mkdir\nfrom scipy.interpolate import interp1d\nfrom os.path import join,exists\nfrom numpy import save,load\nfrom model_obj import Model\nimport helper\n\nclass OscillatingDoubleWellModel(Model):\n def __init_... | [
[
"numpy.max",
"numpy.array",
"scipy.interpolate.interp1d",
"numpy.sin",
"numpy.zeros",
"numpy.random.randn",
"numpy.min",
"numpy.where",
"numpy.abs",
"numpy.cos",
"numpy.linspace",
"numpy.maximum"
]
] |
sages-pl/2022-01-pythonsqlalchemy-aptiv | [
"1d6d856608e9dbe25b139e8968c48b7f46753b84"
] | [
"_assignments/numpy/operations/numpy_broadcasting_a.py"
] | [
"\"\"\"\n* Assignment: Numpy Broadcasting Arithmetic\n* Complexity: easy\n* Lines of code: 4 lines\n* Time: 3 min\n\nEnglish:\n 1. Define `a: np.ndarray` with square root of each element in `A`\n 2. Define `b: np.ndarray` with square root of each element in `B`\n 3. Define `c: np.ndarray` with second power... | [
[
"numpy.array"
]
] |
Jallet/Deconvnet | [
"79f5eb67678547bcedcda2855361c23754f962c7"
] | [
"Deconvnet-keras.py"
] | [
"#!/usr/bin/env python\n#coding=utf-8\n###############################################\n# File Name: DeconvNet2D.py\n# Author: Liang Jiang\n# mail: jiangliang0811@gmail.com\n# Created Time: Sun 30 Oct 2016 09:52:15 PM CST\n# Description: Code for Deconvnet based on keras\n###########################################... | [
[
"numpy.array",
"numpy.zeros_like",
"numpy.reshape",
"numpy.zeros",
"numpy.ones",
"numpy.prod",
"numpy.transpose",
"numpy.kron"
]
] |
ZeroCool2u/transformers | [
"0be5f4a00c0fda64110e18eaadcd9d321bfebd9d"
] | [
"examples/seq2seq/utils.py"
] | [
"import itertools\nimport json\nimport linecache\nimport math\nimport os\nimport pickle\nimport socket\nfrom logging import getLogger\nfrom pathlib import Path\nfrom typing import Callable, Dict, Iterable, List, Union\n\nimport git\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nfrom rouge_scor... | [
[
"numpy.concatenate",
"torch.distributed.get_world_size",
"numpy.array",
"torch.distributed.is_available",
"torch.stack",
"numpy.random.permutation",
"torch.Generator",
"numpy.argmax",
"torch.tensor",
"torch.distributed.get_rank"
]
] |
chunchentu/EvadeML-Zoo | [
"61a8015c096f1e6448caec4e702aef2d646c76e7"
] | [
"attacks/cleverhans_wrapper.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport click\n\nimport pdb\nimport sys, os\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nfrom utils import load_externals\nfrom cleverhans.utils_tf import model_loss, batch_eval\n\nimport warnings\n\ndef override_params(default, update... | [
[
"numpy.vstack"
]
] |
franneck94/TensorCross | [
"d1a69ee8637d4c9e7ad800023c0141a9499bcbac"
] | [
"tests/test_utils.py"
] | [
"\"\"\"Test code for the random search.\n\"\"\"\nimport unittest\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom tensorcross.utils import dataset_split\n\n\nnp.random.seed(0)\ntf.random.set_seed(0)\n\n\nclass UtilsTests(unittest.TestCase):\n def setUp(self) -> None:\n self.dataset = tf.data.Dataset... | [
[
"numpy.random.seed",
"tensorflow.random.set_seed",
"tensorflow.data.Dataset.from_tensor_slices"
]
] |
procommerz/keras-yolo3 | [
"3559c524bfae2c7be9f56bea193a2b23ace3f72b"
] | [
"test.py"
] | [
"from __future__ import print_function\nimport threading\nimport os\nimport time\nimport sys\nimport RPi.GPIO as GPIO\nimport numpy\nimport json\nimport pdb\n\nfrom flask import Flask\nfrom flask import render_template\nfrom flask import request\n\nOUT_PIN = 23\nIN_PIN = 25\nTRIG_PIN = 23\n\nIN2_PIN = 20\n\nGPIO.se... | [
[
"numpy.arange"
]
] |
reinforcementdriving/TransTrack | [
"43a6316f12a6cf2e2bdc5aed089b086017302ad8"
] | [
"track_main/main_tracktrainhalf.py"
] | [
"# Modified by Peize Sun, Rufeng Zhang\r\n# ------------------------------------------------------------------------\r\n# Deformable DETR\r\n# Copyright (c) 2020 SenseTime. All Rights Reserved.\r\n# Licensed under the Apache License, Version 2.0 [see LICENSE for details]\r\n# ---------------------------------------... | [
[
"torch.device",
"torch.optim.AdamW",
"torch.optim.lr_scheduler.StepLR",
"torch.utils.data.RandomSampler",
"numpy.random.seed",
"torch.save",
"torch.utils.data.SequentialSampler",
"torch.optim.SGD",
"torch.nn.parallel.DistributedDataParallel",
"torch.manual_seed",
"torch... |
rainleander/100daysofcode | [
"0391170af80b251e7fb3a78a60b55c3145e4551a",
"0391170af80b251e7fb3a78a60b55c3145e4551a"
] | [
"day026/main.py",
"day030/NATO-error-handling/main.py"
] | [
"# List Comprehension Notes\n# Create a new list from a previous list\n# new_list = [new_item for item in list]\nnumbers = [1, 2, 3]\nnew_numbers = [n + 1 for n in numbers]\nprint(new_numbers)\n# output: [2, 3, 4]\n\n# challenge: what will happen when list comprehension is applied to a string?\nname = \"Rain\"\nnam... | [
[
"pandas.DataFrame"
],
[
"pandas.read_csv"
]
] |
BioTuring-Notebooks/CellphoneDB | [
"9ab48d8888f11259bb3030c8d149d7bc7cdaf6e1",
"9ab48d8888f11259bb3030c8d149d7bc7cdaf6e1"
] | [
"cellphonedb/src/core/tests/models/test_helper_complex.py",
"cellphonedb/src/tests/test_validators/test_validator_database_random_entries.py"
] | [
"from unittest import TestCase\n\nimport pandas as pd\n\nfrom cellphonedb.src.core.Cellphonedb import data_test_dir\nfrom cellphonedb.src.core.models.complex import complex_helper\nfrom cellphonedb.utils import dataframe_functions\n\n\nclass TestHelperComplex(TestCase):\n FIXTURES_SUBPATH = '{}/helper_complex'.f... | [
[
"pandas.DataFrame"
],
[
"pandas.isnull"
]
] |
janssenhenning/aiida-core | [
"bb92dd56cc1bba142df2c48f1a73ca6b809568dc"
] | [
"tests/backends/aiida_sqlalchemy/test_migrations.py"
] | [
"# -*- coding: utf-8 -*-\n###########################################################################\n# Copyright (c), The AiiDA team. All rights reserved. #\n# This file is part of the AiiDA code. #\n# ... | [
[
"numpy.array"
]
] |
soupstandstop/test | [
"ad3f185b8041d3fa611f387291ee8106439353b6"
] | [
"seq2seq/decoders/attention.py"
] | [
"# Copyright 2017 Google Inc.\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... | [
[
"tensorflow.shape",
"tensorflow.expand_dims",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.python.framework.function.Defun",
"tensorflow.get_variable",
"tensorflow.reduce_sum",
"tensorflow.nn.softmax",
"tensorflow.to_int32"
]
] |
bermanmaxim/AOWS | [
"2b9efefd426eebfcefb4b0c09f2683d3a0700951"
] | [
"latency.py"
] | [
"import argparse\nimport json\nimport logging\nimport os\nimport os.path as osp\nimport random\nimport sys\nimport time\nfrom collections import Counter\nfrom collections import defaultdict\nfrom collections import namedtuple\n\nimport cvxpy as cp\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\n... | [
[
"torch.device",
"numpy.array",
"torch.cuda.current_stream",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"torch.ones",
"matplotlib.pyplot.ylabel"
]
] |
collector-m/UniTrack | [
"e8e56e164f2dd40ba590a19ed7a4a75d8da7e2eb"
] | [
"core/association/matching.py"
] | [
"import pdb\r\nimport cv2\r\nimport torch\r\nimport torch.nn.functional as F\r\nimport numpy as np\r\nimport scipy\r\nfrom scipy.spatial.distance import cdist\r\nimport lap\r\n\r\nfrom cython_bbox import bbox_overlaps as bbox_ious\r\nfrom core.motion import kalman_filter\r\nimport time\r\n\r\ndef merge_matches(m1, ... | [
[
"numpy.max",
"torch.nn.functional.normalize",
"numpy.array",
"torch.stack",
"numpy.asarray",
"numpy.empty",
"numpy.ascontiguousarray",
"torch.mm",
"torch.abs",
"numpy.where",
"numpy.abs",
"torch.nn.functional.softmax",
"scipy.spatial.distance.cdist"
]
] |
codorkh/AcousticPE | [
"a787496a7800d56743fc606a43acbe9e32de35e0"
] | [
"topo_input_files/alps/alp_profile.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Dec 8 14:36:32 2016\n\n@author: dgreen\n\"\"\"\n\n# alp_profile.py\n\n# PLotting the alpine profile, chosen to give a relatively 'up and over' profile\n# from the coordinates 44.27N 10.60E\n\n# Load in the data\n\nimport pandas as pd\nimport matplotlib.pyplot as plt... | [
[
"matplotlib.pyplot.rcParams.update",
"pandas.io.parsers.read_csv",
"matplotlib.pyplot.figure"
]
] |
muupan/chainer | [
"038c0d1195c9479335d4223f42dec8bc5830327a"
] | [
"chainer/links/loss/negative_sampling.py"
] | [
"import numpy\n\nfrom chainer import cuda\nfrom chainer.functions.loss import negative_sampling\nfrom chainer import link\nfrom chainer.utils import walker_alias\n\n\nclass NegativeSampling(link.Link):\n\n \"\"\"Negative sampling loss layer.\n\n This link wraps the :func:`~chainer.functions.negative_sampling`... | [
[
"numpy.array",
"numpy.float32",
"numpy.power"
]
] |
DanielBerns/furry-journey | [
"778546ad072cc23520325f042de77cacfd37ecf3"
] | [
"06/bravo.py"
] | [
"import tensorflow as tf\n\nfrom tensorflow.keras.layers import Dense, Flatten, Conv2D\nfrom tensorflow.keras import Model\n\nmnist = tf.keras.datasets.mnist\n\n(x_train, y_train), (x_test, y_test) = mnist.load_data()\nx_train, x_test = x_train / 255.0, x_test / 255.0\n\n# Add a channels dimension\nx_train = x_trai... | [
[
"tensorflow.keras.metrics.Mean",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.GradientTape",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras... |
JakobGM/robotarm-optimization | [
"aa64b5472e78f3d9ac7f42048ebbb905d366d9bc"
] | [
"problem.py"
] | [
"\"\"\"\nFunctions which will be used in optimization methods.\nThe 'thetas' argument will always be an n times s 2-d numpy array.\nIf you need this ta be a vector instead, take in the matrix and\nperform thetas.reshape(n*s, 1) instead.\n\"\"\"\nimport numpy as np\n\nfrom constraints import (\n generate_constrai... | [
[
"numpy.sum"
]
] |
yyht/Funnel_Transformer | [
"4b35a794d5e122a8054471863a52d4eac1c39dcd"
] | [
"tensorflow/squad_utils_v2.py"
] | [
"\"\"\"Official evaluation script for SQuAD version 2.0.\n\nIn addition to basic functionality, we also compute additional statistics and\nplot precision-recall curves if an additional na_prob.json file is provided.\nThis file is expected to map question ID's to the model's predicted probability\nthat a question is... | [
[
"matplotlib.use",
"numpy.ones_like",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.step",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.fill_between",
"matplotlib... |
renshj/High-Cadence-Processing | [
"5d5a2df741858f6e1466d7c4b008e9245d4b780a"
] | [
"Photometry.py"
] | [
"#This file was created by Julian Harrison\r\nimport numpy as np\r\nimport SlicePlot\r\n#from MockDataObject import DataObject #Testing\r\n#from MockSlice import Slice #Testing \r\nimport DataObject\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.figure import Figure\r\nimport Slice\r\nfrom Photometry_GUI imp... | [
[
"matplotlib.pyplot.imshow",
"numpy.mean",
"matplotlib.pyplot.figure"
]
] |
factualaudio/factualaudio | [
"8b9b824e98710470d9d09931688277f667b85a6e"
] | [
"python/factualaudio/plots/clipped_sine_spectrum.py"
] | [
"from factualaudio.plots.clipped_sine_wave import clipped_sine_wave\nfrom factualaudio.plot_format import format_spectrum, add_ellipse_annotation\nfrom factualaudio.plot import rms_amplitude_spectrum\nimport numpy as np\n\ndef populate_figure(figure):\n wave, sample_rate = clipped_sine_wave(num_periods=3)\n\n ... | [
[
"numpy.array"
]
] |
willdunklin/Danesfield | [
"691e48c9491aed9ebd1ca1fb85c4bbf896cad077"
] | [
"tools/kwsemantic_segment.py"
] | [
"#!/usr/bin/env python\n\n###############################################################################\n# Copyright Kitware Inc. and Contributors\n# Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0)\n# See accompanying Copyright.txt and LICENSE files for details\n#######################... | [
[
"numpy.dstack"
]
] |
slachapelle/anon_disentanglement_via_mechanism_sparsity | [
"677f7e160f3532e1357a3c7f35f9f8f8529b389a"
] | [
"model/gumbel_masks.py"
] | [
"import math\nimport torch\n\n\nclass GumbelSigmoid(torch.nn.Module):\n def __init__(self, shape, freeze=False, drawhard=True, tau=1):\n super(GumbelSigmoid, self).__init__()\n self.shape = shape\n self.freeze=freeze\n self.drawhard = drawhard\n self.log_alpha = torch.nn.Parame... | [
[
"torch.zeros",
"torch.sigmoid",
"torch.nn.init.constant_",
"torch.ones",
"torch.log",
"torch.distributions.uniform.Uniform"
]
] |
Magnusnolsoe/xlnet-proteins | [
"2f3fad3139d58e0c0d9a9438ab08e79cd9bcea91"
] | [
"tpu_worker.py"
] | [
"import os\nimport json\nimport tensorflow as tf\n\nfrom sigopt import Connection\nfrom absl import flags, app\nfrom os_utils import get_logdir\nfrom data_utils import VOCAB_SIZE\n\n# SigOpt parameters\nflags.DEFINE_string(\"api_token\", default=\"\",\n help=\"SigOpt api token\")\nflags.DEFINE_string(\"exper... | [
[
"tensorflow.gfile.MakeDirs",
"tensorflow.gfile.Exists",
"tensorflow.gfile.DeleteRecursively",
"tensorflow.gfile.Open"
]
] |
fffunction/jam-image-filter | [
"89ae6e83ebe8351da12c7c085435172c53232483"
] | [
"jam_image_filter/util.py"
] | [
"import math\nimport colorsys\nimport scipy\nimport scipy.cluster\nimport scipy.misc\nimport operator\nimport math\nfrom PIL import Image\nimport numpy as np\nimport random\n\nWIDTH = 1700\nHEIGHT = 540\n\ndef rgb_to_gray(r, g, b, a = None):\n return 0.299 * r + 0.587 * g + 0.114 * b\n\ndef get_avg_gray(pix, x, ... | [
[
"scipy.misc.fromimage",
"numpy.array"
]
] |
aouedions11/SSFL-Benchmarking-Semi-supervised-Federated-Learning | [
"78aec81919bf95ed4677d0e0a4ebbbe3be455742"
] | [
"dataset/randaugment.py"
] | [
"import logging\nimport random\n\nimport numpy as np\nimport PIL\nimport PIL.ImageOps\nimport PIL.ImageEnhance\nimport PIL.ImageDraw\nfrom PIL import Image\n\nlogger = logging.getLogger(__name__)\n\nPARAMETER_MAX = 10\n\n\ndef AutoContrast(img, **kwarg):\n return PIL.ImageOps.autocontrast(img)\n\n\ndef Brightnes... | [
[
"numpy.max",
"numpy.array",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.clip"
]
] |
w121211/agents | [
"2b23bd25ea9dccd759e754962621bad63b57a351"
] | [
"tf_agents/bandits/policies/policy_utilities_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"tensorflow.constant",
"tensorflow.range",
"tensorflow.test.main"
]
] |
mdanilevicz/maize_early_yield_prediction | [
"e1090e6555a544a13bec19c974d628efccbcbeca"
] | [
"multimodal_model.py"
] | [
"# +\n# Import the libraries\nfrom fastai.vision.all import *\nimport fastai\nfrom fastai.tabular.all import *\nfrom fastai.data.load import _FakeLoader, _loaders\nfrom glob import glob\nimport torch\nimport pandas as pd\nimport numpy as np\nimport os\n\n# Custom functions\nfrom msi_utils import *\nfrom fold_utils ... | [
[
"torch.cat"
]
] |
pltrdy/encoder-agnostic-adaptation | [
"e45d157f84804696e109e5952957570fd781e9b7"
] | [
"onmt/modules/embeddings.py"
] | [
"\"\"\" Embeddings module \"\"\"\nimport math\nimport warnings\n\nimport torch\nimport torch.nn as nn\n\nfrom onmt.modules.util_class import Elementwise\n#from onmt.encoders.transformer import TransformerEncoder\nimport onmt.encoders\n#from onmt.decoders.transformer import TransformerDecoder\n\n\nclass PositionalEn... | [
[
"torch.zeros",
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.arange",
"torch.nn.Sequential",
"torch.ones",
"torch.nn.ReLU",
"torch.full",
"torch.load",
"torch.nn.functional.softmax",
"torch.nn.Embedding"
]
] |
rlvc/tensorpack | [
"5573087f5f2b38a6cb430d1de8763705f3ff73f8"
] | [
"examples/FasterRCNN/config.py"
] | [
"# -*- coding: utf-8 -*-\n# File: config.py\n\nimport numpy as np\nimport os\nimport pprint\nimport six\n\nfrom tensorpack.utils import logger\nfrom tensorpack.utils.gpu import get_num_gpu\n\n__all__ = ['config', 'finalize_configs']\n\n\nclass AttrDict():\n\n _freezed = False\n \"\"\" Avoid accidental creatio... | [
[
"numpy.ceil"
]
] |
junkunyuan/CSAC | [
"70d918ed2fe65a0a503b56d66136032031cd67e4"
] | [
"mains/exam_align.py"
] | [
"import sys\nsys.path.append('.')\nfrom models.script.kernels import GaussianKernel\nfrom models.script.multikernel import MultipleKernelMaximumMeanDiscrepancy\nimport copy\nimport torch\nimport os\nimport os.path as osp\nfrom torch import optim\nfrom torch.utils.data import DataLoader\nimport torch.nn as nn\nimpor... | [
[
"torch.no_grad",
"torch.abs",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss",
"torch.sum"
]
] |
dahouda2pro/deep-learned-embedding | [
"a4428cf99eae86691286ec18a0656e632fbc4600"
] | [
"MLP_model.py"
] | [
"\"\"\"\r\nRegression is a statistical process for estimating the relationship among variables,\r\noften to make predictions about some outcome\r\n\"\"\"\r\nimport time\r\nimport seaborn as sns\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn import metrics\r\nfrom sklearn.metrics import mean_squared_error\r\nfro... | [
[
"sklearn.metrics.mean_squared_error",
"sklearn.neural_network.MLPClassifier",
"sklearn.model_selection.GridSearchCV",
"sklearn.metrics.roc_auc_score",
"numpy.unique"
]
] |
onecalfman/opencast-downloader | [
"ebf3ae55ef70fc4c95de02d0288f8a1069d51631"
] | [
"opencast-dl.py"
] | [
"#!/usr/bin/python3\n\nimport datetime\nimport json\nimport requests\nimport urllib\nimport os\nimport pandas\nfrom sys import exit\nfrom tqdm import tqdm\n\nlink='' # link to episodes.json filename of your OpenCast website. Probably something like\n # https://opencast-present.<your universit... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
jhunkeler/pyregion | [
"7ee5fb3f4949445c484bac4d579d0d49d6fdc5e0"
] | [
"tests/test_region.py"
] | [
"import pyregion\nfrom os.path import join\n\ntry:\n from astropy.io import fits as pyfits\nexcept ImportError:\n from astropy.io import fits as pyfits\n\nimport numpy as np\n\nfrom pyregion.wcs_helper import fix_lon\n\n# At some point, pyfits.Card.fromstring has changed from unbound\n# method to bounded meth... | [
[
"numpy.allclose"
]
] |
VectorInstitute/NeuralKernelBandits | [
"6ddbfa3a410b50b84d9fb72c75803347da61b4cb"
] | [
"neural_kernel_experiment.py"
] | [
"\"\"\"Copyright 2021 Michal Lisicki\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in ... | [
[
"numpy.random.seed",
"numpy.sum",
"tensorflow.random.set_seed",
"numpy.mean",
"numpy.std",
"numpy.random.randint",
"numpy.hstack"
]
] |
higumachan/chainer | [
"c9209a1099c9a2a5ecab2b28e1b008b19effa724"
] | [
"chainer/functions/array/select_item.py"
] | [
"import numpy\nimport six\n\nimport chainer\nfrom chainer import backend\nfrom chainer.backends import cuda\nfrom chainer import function_node\nfrom chainer.utils import type_check\n\n\nclass SelectItem(function_node.FunctionNode):\n\n \"\"\"Select elements stored in given indices.\"\"\"\n\n def check_type_fo... | [
[
"numpy.zeros"
]
] |
dpatel257/Smart-City-Sample | [
"933c9220c37fbe4b67ec749a8e0315c803fcec66"
] | [
"analytics/entrance/custom_transforms/people_counting.py"
] | [
"import gstgva # pylint: disable=import-error\nimport numpy as np\nimport math\nimport copy\nimport json\nfrom munkres import Munkres\nimport os\n\nclass PeopleCounting:\n\n def __init__(self):\n # Array of Gallery Objects - {embeddings(numpy array), timestamp}\n self.identities = []\n self... | [
[
"numpy.float32",
"numpy.dot"
]
] |
Amanda-Barbara/PaddleSeg | [
"a7de36a5fae96011f5b188987670274101b8ede1"
] | [
"contrib/PP-HumanSeg/deploy/infer.py"
] | [
"# Copyright (c) 2021 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 req... | [
[
"numpy.array",
"numpy.zeros",
"numpy.transpose",
"numpy.argmax",
"numpy.repeat"
]
] |
jonashaag/kartothek | [
"906d6831f3d9d246c3231850831c632b51f12b05"
] | [
"tests/io/dask/dataframe/test_update.py"
] | [
"# -*- coding: utf-8 -*-\n# pylint: disable=E1101\n\nimport pickle\n\nimport dask\nimport dask.dataframe as dd\nimport numpy as np\nimport pandas as pd\nimport pandas.util.testing as pdt\nimport pytest\n\nfrom kartothek.core.factory import DatasetFactory\nfrom kartothek.io.dask._update import _KTK_HASH_BUCKET, _has... | [
[
"numpy.uint8",
"numpy.ceil",
"pandas.util.testing.assert_frame_equal",
"pandas.DataFrame",
"numpy.random.shuffle",
"numpy.random.randint",
"numpy.arange"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.