repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
LukasK13/ESBO-ETC | [
"d1db999f1670f2777c5227d79629d421f03e5393"
] | [
"tests/sensor/test_PixelMask.py"
] | [
"from unittest import TestCase\nfrom esbo_etc.classes.sensor.PixelMask import PixelMask\nimport numpy as np\nimport astropy.units as u\n\n\nclass TestPixelMask(TestCase):\n def setUp(self):\n self.mask = PixelMask(np.array([10, 8]) << u.pix, 6.5 * u.um, center_offset=np.array([0.2, 0.5]) << u.pix)\n\n ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
lori94/DSCI_522_Group_404 | [
"e8177bd7fa388dcada94bcb9c2f6e69dc0227591"
] | [
"src/model.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n'''This script finds the best parameters for SVC and LGR models and fits the data to these two models and outputs the classification images and the classification reports as the csv documents.\n\nUsage: src/model.py --data_input=<data_input> --result_output=<result_output> \... | [
[
"sklearn.model_selection.RandomizedSearchCV",
"sklearn.svm.SVC",
"sklearn.metrics.classification_report",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"sklearn.linear_model.LogisticRegression",
"numpy.logspace"
]
] |
naegawa/Aup2wav_dataset | [
"bc22ce50704497f2d496da13b00cebae0083bbef"
] | [
"audacity.py"
] | [
"#!/usr/bin/env python\n# 2017 kojima changed https://github.com/davidavdav/audacity.py (c) 2016 David A. van Leeuwen\n# \n#\n# \nimport xml.etree.ElementTree as ET\nimport wave, os, numpy, struct\n\nclass Aup:\n\tdef __init__(self, aupfile):\n\t\tfqpath = os.path.join(os.path.curdir, aupfile)\n\t\tdir = os.path.di... | [
[
"numpy.frombuffer"
]
] |
ClaireDelplancke/SIRF-Contribs | [
"130223d9bc11991eadcd11f9b715aea34c4842fd"
] | [
"src/Python/sirf/contrib/kcl/user_dePierroMap_real_data.py"
] | [
"'''User implemented De Pierro MAPEM reconstruction\nReal data implementation of De Pierro MAPEM, using a Bowsher weighted quadratic\npenalty. The guidance image (here a T1-weighted MR image) must be pre-aligned \nto the PET image and sampled on the same image grid.\nImplemented by Sam Ellis (13th Feb 2019)\n\nUsag... | [
[
"numpy.sum",
"numpy.zeros",
"numpy.floor",
"numpy.float32",
"numpy.mod",
"numpy.arange"
]
] |
hojeong3709/RL | [
"a1c6eab8c3e7f2487e527fe68658d13eea5334af"
] | [
"lecture/1. policy-iteration/environment.py"
] | [
"import tkinter as tk\nfrom tkinter import Button\nimport time\nimport numpy as np\nfrom PIL import ImageTk, Image\n\nPhotoImage = ImageTk.PhotoImage\nUNIT = 100 # 픽셀 수\nHEIGHT = 5 # 그리드월드 세로\nWIDTH = 5 # 그리드월드 가로\nTRANSITION_PROB = 1 #상태 변환 확률 값\nPOSSIBLE_ACTIONS = [0, 1, 2, 3] # 상, 하, 좌, 우\nACTIONS = [(-1, 0)... | [
[
"numpy.array"
]
] |
ZhuokunYao/smoke | [
"d524fbe43b1aba6078c25d9aca7924b71a635e1d"
] | [
"smoke/layers/utils.py"
] | [
"import torch\nfrom torch.nn import functional as F\n\n\ndef sigmoid_hm(hm_features, training=False):\n x = hm_features.sigmoid_()\n if training:\n x = x.clamp(min=1e-4, max=1 - 1e-4)\n return x\n\n\ndef nms_hm(heat_map, kernel=3):\n pad = (kernel - 1) // 2\n hmax = F.max_pool2d(heat_map,\n ... | [
[
"torch.topk",
"torch.floor",
"torch.nn.functional.max_pool2d"
]
] |
aviolinist/EEE | [
"032e2029815229875048cc92dd7da24ff3f71e93"
] | [
"codes/lib/position.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import division, absolute_import, print_function\nimport numpy as np\n\n__all__ = ['position']\n\ndef position(row=1, col=1, num=1,\n left=0.125, right=0.9, bottom=0.1, top=0.9,\n hspace=0.1, vspace=None, wspace=None,\n width=None, height=N... | [
[
"numpy.sqrt",
"numpy.empty"
]
] |
ConeyLiu/oap-raydp | [
"3fe728f01dbb6494d94c4abd65bc9aacff771080"
] | [
"python/raydp/spark/torch/dataset.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"numpy.random.shuffle",
"torch.as_tensor",
"numpy.random.seed",
"numpy.copy",
"numpy.stack"
]
] |
2anchao/NTS_NET | [
"3b0a58616cb4b44699a11541eac2777556169812"
] | [
"core/model.py"
] | [
"from torch import nn\r\nimport torch\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r\nfrom core import resnet\r\nimport numpy as np\r\nfrom core.anchors import generate_default_anchor_maps, hard_nms\r\nfrom config import Config as cfg\r\n\r\n\r\nclass ProposalNet(nn.Module):\r\n \"\"... | [
[
"torch.nn.functional.log_softmax",
"torch.stack",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.pad",
"torch.zeros",
"torch.gather",
"torch.nn.functional.relu",
"torch.from_numpy",
"torch.nn.Conv2d",
"numpy.array",
"torch.nn.ReLU",
"torch... |
ProskuraPD/catboost | [
"d4593d4fbc8b8da66ff2d8b838578eba819d9d0d"
] | [
"catboost/python-package/catboost/core.py"
] | [
"import sys\nfrom copy import deepcopy\nfrom six import iteritems, string_types, integer_types\nimport os\nimport imp\nfrom collections import Iterable, Sequence, Mapping, MutableMapping\nimport warnings\nimport numpy as np\nimport ctypes\nimport platform\nimport tempfile\nfrom enum import Enum\nfrom operator impor... | [
[
"numpy.transpose",
"numpy.dtype",
"numpy.reshape",
"numpy.int32",
"numpy.expand_dims",
"numpy.shape",
"numpy.array",
"numpy.mean"
]
] |
ygarrot/plantcv | [
"0e11c7f63d96a52487e01e3b67744aa8697eedb2"
] | [
"plantcv/plantcv/spectral_index/spectral_index.py"
] | [
"# Extract one of the predefined indices from a hyperspectral datacube\n\nimport os\nimport numpy as np\nimport cv2\nfrom plantcv.plantcv import params\nfrom plantcv.plantcv._debug import _debug\nfrom plantcv.plantcv import fatal_error\nfrom plantcv.plantcv import Spectral_data\nfrom plantcv.plantcv.transform impor... | [
[
"numpy.shape",
"numpy.nanmax",
"numpy.nanmin"
]
] |
jmagine/rf-selection | [
"ba9dcb5ca550916873ce68baa71da983f2dd4be5"
] | [
"sim/pid.py"
] | [
"'''*-----------------------------------------------------------------------*---\n Author: Jason Ma\n Date : Oct 18 2018\n TODO\n\n File Name : pid.py\n Descriptio... | [
[
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.zeros"
]
] |
sfillwo/stog | [
"b965c47c17472eea11ab63aab9aa738af7875f06"
] | [
"stog/modules/initializers.py"
] | [
"\"\"\"\nAdopted from AllenNLP:\n https://github.com/allenai/allennlp/blob/v0.6.1/allennlp/nn/initializers.py\n\nAn initializer is just a PyTorch function.\nHere we implement a proxy class that allows us\nto register them and supply any additional function arguments\n(for example, the ``mean`` and ``std`` of a n... | [
[
"torch.nn.init.calculate_gain"
]
] |
mesnardo/petibm-decoupledibpm | [
"675615a882cc8418b15a34e1100ccfb421f1d9d1"
] | [
"runs/cylinder2dRe40/scripts/plot_pressure_coefficients.py"
] | [
"\"\"\"Plot the surface pressure coefficient at final time step.\"\"\"\n\nfrom matplotlib import pyplot\nimport numpy\nimport pathlib\n\nimport petibmpy\n\nimport rodney\n\n\ndef get_pressure(simudir, timestep):\n name = 'p' # name of the field variable to load\n datadir = simudir / 'output'\n # Load the ... | [
[
"numpy.degrees",
"matplotlib.pyplot.rc",
"numpy.cos",
"matplotlib.pyplot.subplots",
"numpy.empty_like",
"matplotlib.pyplot.show",
"numpy.flip",
"numpy.sin",
"numpy.where",
"numpy.linspace"
]
] |
kristianeschenburg/parcellearning | [
"93811f7d11c1c5583d8f541c7629dbbaa1785304"
] | [
"parcellearning/fn/ops.py"
] | [
"import torch\nimport dgl\n\n\ndef cosine(nodes):\n \"\"\"\n Compute the cosine distance between all pairs of nodes adjacent on a source node.\n \"\"\"\n\n # ```m``` is a matrix of N nodes x E edges x F features\n # representing the messages incident on source nodes with E edges\n m = nodes.mailbo... | [
[
"torch.triu"
]
] |
jin530/pytorch-widedeep | [
"4ff1008ba6c62e64383267c924cfd3cf3cbc609c"
] | [
"tests/test_data_utils/test_du_deep_image.py"
] | [
"import numpy as np\nimport pandas as pd\nimport os\n\nfrom pytorch_widedeep.preprocessing import ImagePreprocessor\n\n\nfull_path = os.path.realpath(__file__)\npath = os.path.split(full_path)[0]\ndf = pd.DataFrame({\"galaxies\": [\"galaxy1.png\", \"galaxy2.png\"]})\nimg_col = \"galaxies\"\nimd_dir = os.path.join(p... | [
[
"pandas.DataFrame",
"numpy.all"
]
] |
ethansimpson285/StarlingPy | [
"0afba0444b695c431227f4e28d6d3edde5b56af7"
] | [
"src/starlingpy/StarlingClass.py"
] | [
"from requests import get\nimport datetime\n\nimport pandas as pd \n\nfrom starlingpy.StarlingAPIs import Account_APIs\n\nBASE_PATH = \"https://api.starlingbank.com/api/v2/\"\n\n\nclass TransactionHistory:\n\n \"\"\"\n A history of transactions associated with the Starling account, between stipulated datetime... | [
[
"pandas.date_range",
"pandas.to_numeric",
"pandas.DataFrame",
"pandas.to_datetime",
"pandas.Grouper",
"pandas.concat"
]
] |
RichardOkubo/DS-Scripts | [
"adf3845802b52e8901d381ffff60f9c1276dabe1"
] | [
"machine-learning-algorithms/reducao-rbm.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn import datasets, metrics\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.neural_network import BernoulliRBM\nfrom sklearn.naive_bayes import GaussianNB\nfrom sklearn.pipeline import... | [
[
"matplotlib.pyplot.xticks",
"sklearn.preprocessing.MinMaxScaler",
"matplotlib.pyplot.figure",
"numpy.asarray",
"sklearn.neural_network.BernoulliRBM",
"sklearn.metrics.accuracy_score",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"sklearn.datasets.load_digits",
"sk... |
mmezic/netket | [
"629e885212d981d7748d155310abca4a1f9d5481"
] | [
"test/jax/test_vjp_batched.py"
] | [
"import pytest\n\nimport jax\nimport netket as nk\nimport numpy as np\nfrom functools import partial\n\n\n@pytest.mark.parametrize(\"jit\", [False, True])\n@pytest.mark.parametrize(\"batch_size\", [None, 16, 10000, 1000000])\n@pytest.mark.parametrize(\"return_forward\", [False, True])\n@pytest.mark.parametrize(\"ba... | [
[
"numpy.testing.assert_allclose"
]
] |
FSEC-Photovoltaics/pvrpm-lcoe | [
"dbe0bb30ffa1041ec004f84c57aac44f47bdf6d2"
] | [
"pvrpm/core/simulation.py"
] | [
"import os\nimport time\nimport warnings\nimport multiprocessing as mp\nfrom typing import List\n\nimport pandas as pd\nimport numpy as np\nimport scipy\nimport scipy.stats as stats\nimport matplotlib.pyplot as plt\nfrom dateutil.relativedelta import relativedelta\nfrom datetime import datetime\nfrom tqdm import tq... | [
[
"numpy.sum",
"pandas.Series",
"scipy.stats.norm.ppf",
"matplotlib.pyplot.tight_layout",
"numpy.random.seed",
"matplotlib.pyplot.ylabel",
"numpy.amax",
"matplotlib.pyplot.boxplot",
"numpy.reshape",
"matplotlib.pyplot.title",
"numpy.zeros",
"scipy.stats.t.ppf",
"p... |
tempcyc/networkx | [
"cae83ba501c242567cb2454f97f851898276f06e"
] | [
"networkx/linalg/laplacianmatrix.py"
] | [
"\"\"\"Laplacian matrix of graphs.\n\"\"\"\n# Copyright (C) 2004-2013 by\n# Aric Hagberg <hagberg@lanl.gov>\n# Dan Schult <dschult@colgate.edu>\n# Pieter Swart <swart@lanl.gov>\n# All rights reserved.\n# BSD license.\nimport networkx as nx\nfrom networkx.utils import not_implemented_for\n__author_... | [
[
"scipy.sqrt",
"scipy.errstate",
"scipy.sparse.spdiags",
"scipy.isinf",
"scipy.sparse.linalg.eigs",
"scipy.sparse.identity"
]
] |
simo-tuomisto/portfolio | [
"7f70bdfe027fcab75970e5f8a81036ca905c893b"
] | [
"Computational Nanoscience 2013 - Final project/Code/plot_data.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as mpl\nfrom matplotlib.ticker import NullFormatter\nimport sys\nfrom glob import glob\nimport re\nimport os\n\nif __name__==\"__main__\":\n\n\t# Plot these ranges\n\tplotranges = {\n\t5.0\t:\t[0.009\t,\t0.011],\n\t10.0:\t[0.007\t,\t0.011],\n\t15.0:\t[0.005\t,\t0.010],\... | [
[
"numpy.zeros_like",
"numpy.load",
"numpy.unique",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gca",
"matplotlib.ticker.NullFormatter",
"numpy.log",
"matplotlib.pyplot.ylabel",
"numpy.power",
"numpy.amax",
... |
Guangxuan-Xiao/deepsnap | [
"b0b222c8093b6273c648c51585c9ebbb2f4112fa"
] | [
"deepsnap/batch.py"
] | [
"import torch\nfrom deepsnap.graph import Graph\nfrom deepsnap.hetero_graph import HeteroGraph\nfrom typing import (\n Callable,\n Dict,\n List\n)\n\n\nclass Batch(Graph):\n r\"\"\"\n A plain old python object modeling a batch of\n :class:`deepsnap.graph.Graph` objects as one big (disconnected) gr... | [
[
"torch.tensor",
"torch.stack",
"torch.is_tensor",
"torch.full"
]
] |
furkanc/Yolov3-Face-Recognition | [
"d3074490a6a7bf83925319ed521b557919d0af7e"
] | [
"face_module/mtcnn_pytorch/src/get_nets.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom collections import OrderedDict\nimport numpy as np\n\n\nclass Flatten(nn.Module):\n\n def __init__(self):\n super(Flatten, self).__init__()\n\n def forward(self, x):\n \"\"\"\n Arguments:\n x: a float t... | [
[
"numpy.load",
"torch.FloatTensor",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.PReLU",
"torch.nn.functional.softmax",
"torch.nn.Conv2d",
"torch.nn.Dropout"
]
] |
Xarthisius/yt | [
"aad3cfa3b4ebab7838352ab467275a27c26ff363"
] | [
"yt/frontends/halo_catalog/io.py"
] | [
"from collections import defaultdict\n\nimport numpy as np\n\nfrom yt.frontends.gadget_fof.io import IOHandlerGadgetFOFHaloHDF5\nfrom yt.funcs import parse_h5_attr\nfrom yt.units.yt_array import uvstack\nfrom yt.utilities.io_handler import BaseIOHandler\nfrom yt.utilities.on_demand_imports import _h5py as h5py\n\n\... | [
[
"numpy.array",
"numpy.clip",
"numpy.empty"
]
] |
d813s909q/tensortflow | [
"ae244e6dabeb6b879c5adb9ca4c2a85cb4722dc5"
] | [
"tensorflow/python/ops/while_v2.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.framework.tensor_spec.TensorSpec",
"tensorflow.python.ops.control_flow_util.IsInXLAContext",
"tensorflow.python.ops.control_flow_ops._ShapeLessThanOrEqual",
"tensorflow.python.util.nest.flatten",
"tensorflow.python.util.nest.is_sequence",
"tensorflow.python.framework.ten... |
larksq/Lane-Lines-Detection-and-Localization | [
"f07d7feaca7c5e1132bf22c27745328968441ff0"
] | [
"Scripts/lines.py"
] | [
"import numpy as np\n\nclass lines:\n\n maxNum = 50\n threshold = 1\n insist = True\n\n def __init__(self):\n # was the line detected in the last iteration?\n self.detected = False\n # x values of the last n fits of the line\n self.recent_xfitted = []\n #average x valu... | [
[
"numpy.array"
]
] |
LancerWang001/v8 | [
"a0f0ebd7a876e8cb2210115adbfcffe900e99540"
] | [
"tools/callstats.py"
] | [
"#!/usr/bin/env python\n# Copyright 2016 the V8 project authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file.\n'''\nUsage: callstats.py [-h] <command> ...\n\nOptional arguments:\n -h, --help show this help message and exit\n\nCommands... | [
[
"scipy.stats.t.interval",
"numpy.median",
"numpy.max",
"numpy.min",
"numpy.std",
"numpy.average"
]
] |
jboilard1994/disentanglement_lib | [
"a64b8b9994a28fafd47ccd866b0318fa30a3c76c"
] | [
"disentanglement_lib/evaluation/metrics/beta_vae_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The DisentanglementLib 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/LICE... | [
[
"numpy.random.RandomState"
]
] |
HuiminHe/BugBot | [
"ac121a37ac0b4858e5ed3849062c9bfaa47cb0fa"
] | [
"test_box.py"
] | [
"from simulator import Simulator, Map, Agent\nfrom devices import Device\nimport numpy as np\nimport simulator_config\n\nenv = Simulator(simulator_config)\nmap = Map()\nmap.get_map_from_geom2d(env, kp=np.array([[-100, 100], [-100, -100], [100, -100], [100, 100]]))\n\nrobot = Agent(env, kp=np.array([[-2, 0], [2, 0]]... | [
[
"numpy.array"
]
] |
OnsenTamagoYoshi/DeepLearningFromScratch | [
"006f80b63130829b142c04a88632287bcf5a61b0"
] | [
"ch04/gradient_2d.py"
] | [
"# -*- coding: utf-8 -*-\n# cf.http://d.hatena.ne.jp/white_wheels/20100327/p3\nimport numpy as np\nimport matplotlib.pylab as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\ndef _numerical_gradient_no_batch(f, x):\n h = 1e-4 #0.0001\n grad = np.zeros_like(x) #xと同じ形状の配列を作成\n \n for idx in range(x.size):\... | [
[
"matplotlib.pylab.xlim",
"numpy.zeros_like",
"matplotlib.pylab.grid",
"numpy.sum",
"matplotlib.pylab.quiver",
"matplotlib.pylab.legend",
"matplotlib.pylab.draw",
"matplotlib.pylab.figure",
"matplotlib.pylab.show",
"numpy.arange",
"matplotlib.pylab.xlabel",
"matplotl... |
JianhengHou/Medical-Sieve | [
"cafb69054ef98cf2f42229ff73c93b6796f9fa91"
] | [
"Medical_Sieve_Pipeline/Medical_Sieve_Model_Pipeline/estimator.py"
] | [
"from sklearn.preprocessing import MultiLabelBinarizer\nfrom sklearn.metrics import hamming_loss\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.metrics import multilabel_confusion_matrix\nfrom sklearn.metrics import roc_auc_score\nimport numpy as np\nimport copy\n\ndef combinations(nums):\n ans = [[]]... | [
[
"numpy.zeros",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.accuracy_score",
"sklearn.preprocessing.MultiLabelBinarizer",
"sklearn.metrics.multilabel_confusion_matrix",
"sklearn.metrics.hamming_loss",
"numpy.mean"
]
] |
mike0sv/catalyst | [
"54597a3b3d78e5b6c3084dfc3c28185600c79c90"
] | [
"catalyst/rl/scripts/run_samplers.py"
] | [
"#!/usr/bin/env python\n# isort:skip_file\n\nimport os\nos.environ[\"OMP_NUM_THREADS\"] = \"1\"\nos.environ[\"MKL_NUM_THREADS\"] = \"1\"\n\nimport argparse # noqa E402\nimport atexit # noqa E402\nimport copy # noqa E402\nimport multiprocessing as mp # noqa E402\nimport time # noqa E402\n\nimport torch # noqa ... | [
[
"torch.set_num_threads"
]
] |
todd-deshane/aihwkit | [
"07269e29731f9a6482d25326400437f6bef2fc94"
] | [
"src/aihwkit/nn/modules/linear_mapped.py"
] | [
"# -*- coding: utf-8 -*-\n\n# (C) Copyright 2020, 2021 IBM. All Rights Reserved.\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# An... | [
[
"torch.nn.Linear.__init__",
"torch.no_grad",
"torch.cat",
"torch.split"
]
] |
DanielJMaher/compliance-checker | [
"944220a4a7bd0e945d7b4e468ffb524af5eca5b2"
] | [
"compliance_checker/tests/test_suite.py"
] | [
"from pkg_resources import resource_filename\nfrom compliance_checker.suite import CheckSuite\nfrom compliance_checker.base import Result, BaseCheck\nimport numpy as np\nimport unittest\nimport os\n\nstatic_files = {\n '2dim' : resource_filename('compliance_checker', 'tests/data/2dim-grid.n... | [
[
"numpy.isnan"
]
] |
gyungchan2110/ImageUtils | [
"618d032122d6eadeec4afc9fc6c6906fa71f0ff6"
] | [
"LungBoundaryCrop.py"
] | [
"# In[]\nimport cv2 \nimport numpy as np \nimport os \nfrom operator import eq\nimport random\nimport matplotlib.pyplot as plt \nfrom skimage import io\nimport shutil\n\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0\"\n\nimgBase = \"D:/[Data]/[Cardiomegaly]/1_ChestPA_Labeled_Baeksongyi/[PNG]_2_Generated_Data(2k)/Gener... | [
[
"numpy.stack",
"numpy.asarray",
"numpy.zeros"
]
] |
jerbaroo/bridge-sim | [
"c4ec1c18a07a78462ccf3b970a99a1bd7efcc2af"
] | [
"bridge_sim/internal/plot/geometry/node.py"
] | [
"from typing import List\n\nimport numpy as np\n\nfrom bridge_sim.internal.plot import plt\nfrom bridge_sim.internal.plot.geometry.angles import ax_3d\nfrom bridge_sim.sim.model import Node\n\n\ndef node_scatter_3d(nodes: List[Node], new_fig: bool = True):\n # Split into separate arrays of x, y and z position, a... | [
[
"numpy.array"
]
] |
dravog7/nboost | [
"e0c086db2eaa8601c20244c81d8f5483b7491902"
] | [
"tests/unit/test_onnx_bert_rerank.py"
] | [
"from nboost.plugins.models import resolve_model\nfrom nboost import defaults\nimport unittest\nimport numpy as np\n\n\nclass TestPtBertRerankModelPlugin(unittest.TestCase):\n def setUp(self):\n self.model = resolve_model(\n model_dir='onnx-bert-base-msmarco',\n data_dir=defaults.dat... | [
[
"numpy.allclose"
]
] |
mpewsey/civpy | [
"bbf74b1c04ca9f7604831f5280cc80d796240e67"
] | [
"civpy/survey/alignment.py"
] | [
"\"\"\"\nCopyright (c) 2019, Matt Pewsey\n\"\"\"\n\nimport attr\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom .spatial_hash import SpatialHash\n\n__all__ = ['Alignment']\n\n\n@attr.s(hash=False)\nclass Alignment(object):\n \"\"\"\n A class representing a survey alignment.\n\n Parameters\n -... | [
[
"numpy.asarray",
"numpy.insert",
"numpy.append",
"matplotlib.pyplot.figure",
"numpy.abs",
"numpy.cos",
"numpy.expand_dims",
"numpy.linspace",
"numpy.ceil",
"numpy.zeros",
"numpy.column_stack",
"numpy.tan",
"numpy.max",
"numpy.einsum",
"numpy.linalg.norm"... |
lfchener/dgl | [
"77f4287a4118db64c46f4f413a426e1419a09d53"
] | [
"examples/pytorch/rgcn-hetero-ogbn-mag/model.py"
] | [
"from typing import Callable, Dict, List, Union\n\nimport dgl\nimport dgl.nn.pytorch as dglnn\nimport torch\nimport torch.nn as nn\n\n\nclass RelGraphEmbedding(nn.Module):\n def __init__(\n self,\n hg: dgl.DGLHeteroGraph,\n embedding_size: int,\n num_nodes: Dict[str, int],\n no... | [
[
"torch.nn.init.calculate_gain",
"torch.nn.init.xavier_uniform_",
"torch.Tensor",
"torch.split",
"torch.nn.ParameterDict",
"torch.nn.init.uniform_",
"torch.nn.Embedding",
"torch.nn.LayerNorm",
"torch.nn.ModuleList",
"torch.nn.init.zeros_",
"torch.nn.ModuleDict",
"tor... |
vishalbelsare/GNN_tf_2.x | [
"4b6429ed58f2c0922257600a9287d5cc5a10395b"
] | [
"graph_class.py"
] | [
"# coding=utf-8\n\nimport os\nimport shutil\n\nimport numpy as np\nimport tensorflow as tf\nfrom scipy.sparse import coo_matrix\n\n\n#######################################################################################################################\n## GRAPH OBJECT CLASS ########################################... | [
[
"numpy.save",
"numpy.ones",
"numpy.load",
"numpy.savetxt",
"numpy.any",
"scipy.sparse.coo_matrix",
"tensorflow.sparse.SparseTensor.from_value",
"tensorflow.keras.backend.floatx",
"tensorflow.SparseTensor",
"tensorflow.sparse.reorder",
"scipy.linalg.block_diag",
"ten... |
sarkarpr/azure-python-labs | [
"10ad5d69175cec7fc8ff465368e9867440d034f3"
] | [
"2019/6-azureml-movie-recommendation/reco_utils/dataset/spark_splitters.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport numpy as np\n\nfrom pyspark.sql import Window\nfrom pyspark.sql.functions import col, row_number, broadcast, rand\n\nfrom reco_utils.common.constants import (\n DEFAULT_ITEM_COL,\n DEFAULT_USER_COL,\n ... | [
[
"numpy.cumsum"
]
] |
tkuri/noise2noise | [
"a293f4952d3d1c997f4eb298a20fd5fac50a2dd3"
] | [
"test_model.py"
] | [
"import argparse\nimport numpy as np\nfrom pathlib import Path\nimport cv2\nfrom model import get_model\n# from noise_model import get_noise_model\n\nMAX_8BIT = 255.\nMAX_16BIT = 65535.\n\ndef get_args():\n parser = argparse.ArgumentParser(description=\"Test trained model\",\n ... | [
[
"numpy.clip",
"numpy.expand_dims"
]
] |
quickgrid/paper-implementations | [
"90de1e93cc664e8f5e1e49c57c030f3d9d14fdf9"
] | [
"pytorch/gaugan/gaugan.py"
] | [
"\"\"\"Pytorch GauGAN implementation.\n\nEither segmentation one hot mask or rgb mask can be passed to discriminator with little modification.\n\nTodo\n - Modify to try to generate and match mask also as loss.\n - Try discriminator with either segmentation image or label.\n - Use multiscale feature from di... | [
[
"torch.nn.utils.spectral_norm.spectral_norm",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.nn.Upsample",
"torch.cuda.is_available",
"torch.nn.Conv2d",
"torch.nn.InstanceNorm2d",
"torch.utils.tensorboard.SummaryWriter",
"torch.autograd.profiler.profile",
"torch.cat... |
vimalromeo/pandas | [
"9444dce96954c546333d5aecc92a06c3bfd19aa5"
] | [
"pandas/tests/io/parser/dialect.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nTests that dialects are properly handled during parsing\nfor all of the parsers defined in parsers.py\n\"\"\"\n\nimport csv\n\nfrom pandas import DataFrame\nfrom pandas.compat import StringIO\nfrom pandas.errors import ParserWarning\n\nimport pandas.util.testing as tm\n\n\nclass ... | [
[
"pandas.util.testing.assert_raises_regex",
"pandas.DataFrame",
"pandas.compat.StringIO",
"pandas.util.testing.assert_produces_warning",
"pandas.util.testing.assert_frame_equal"
]
] |
luijkr/pandas | [
"bc29dfb5bf4c82f8d616857c2316fc8f17d8f2a5"
] | [
"pandas/tests/window/test_rolling.py"
] | [
"from datetime import datetime, timedelta\n\nimport numpy as np\nimport pytest\n\nfrom pandas.errors import UnsupportedFunctionCall\n\nfrom pandas import (\n DataFrame,\n DatetimeIndex,\n MultiIndex,\n Series,\n Timedelta,\n Timestamp,\n date_range,\n period_range,\n to_datetime,\n to_... | [
[
"pandas.MultiIndex",
"numpy.ones",
"pandas.Series",
"pandas._testing.assert_frame_equal",
"numpy.random.RandomState",
"pandas._testing.assert_series_equal",
"pandas.period_range",
"pandas._testing.assert_produces_warning",
"numpy.abs",
"pandas._testing.assert_equal",
"p... |
tyler-e-marshall/prymetime | [
"c1daa783c8091adbc5900a51d98522b1269d0107"
] | [
"PRYMETIME/nucmer4.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nTitle: Sending Contigs to Nucmer\nCreated on Tue Aug 13 2019\n\n@author: Eric\n@email: ericyoung7@gmail.com\n\"\"\"\nimport glob, os\nimport pandas as pd\nfrom Bio import SeqIO\nfrom pymummer import nucmer\nfrom pathlib import Path\n\npath_to_file = \"pilon.fasta\"\npath = Path(pat... | [
[
"pandas.read_csv"
]
] |
pfistfl/openml-defaults | [
"0678167f807512bd0c957f82a83ff8181461090c"
] | [
"examples/legacy/evaluate_defaults_live.py"
] | [
"import argparse\nimport copy\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport openmldefaults\nimport os\nimport pandas as pd\n\n\n# sshfs jv2657@habanero.rcs.columbia.edu:/rigel/home/jv2657/experiments ~/habanero_experiments\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser.add_... | [
[
"pandas.read_csv",
"matplotlib.pyplot.clf"
]
] |
TileDB-Inc/TileDB-CLI | [
"e18e148fe5c6044b87d28595f5370eecac0b3c8f"
] | [
"tiledb_cli/tests/test_convert_from.py"
] | [
"import tiledb\nfrom tiledb_cli.root import root\nfrom tiledb_cli.convert_from import parse_kwargs\n\nfrom click.testing import CliRunner\nimport os\nimport numpy as np\nimport pandas as pd\nimport pytest\n\n\n@pytest.fixture(autouse=True, scope=\"session\")\ndef create_test_simple_csv(temp_rootdir):\n \"\"\"\n ... | [
[
"pandas.to_datetime",
"pandas.DataFrame.equals",
"pandas.DataFrame",
"numpy.iinfo"
]
] |
hankyul2/EfficientNetV2-pytorch | [
"bce59dae3ce69e3e7e8aa99e4f32214b015dd1f8"
] | [
"efficientnetv2/efficientnet_v2.py"
] | [
"import copy\nfrom functools import partial\nfrom collections import OrderedDict\n\nimport torch\nfrom torch import nn\n\nfrom efficientnetv2 import get_efficientnet_v2_structure\nfrom efficientnetv2 import load_from_zoo\n\n\nclass ConvBNAct(nn.Sequential):\n \"\"\"Convolution-Normalization-Activation Module\"\"... | [
[
"torch.empty",
"torch.nn.init.kaiming_normal_",
"torch.nn.Linear",
"torch.nn.Flatten",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.init.normal_",
"torch.nn.init.ones_",
"torch.nn.Conv2d",
"torch.nn.init.zeros_",
"torch.nn.Identity",
"torch.nn.Dropout"
]
] |
nlp-tlp/quickgraph | [
"34d888b055a78939095005f9cef363c0430664be"
] | [
"server_cluster/app.py"
] | [
"'''\n API for rank order clustering documents.\n'''\n\nimport itertools\nimport pathlib\nfrom collections import Counter, defaultdict\nfrom enum import Enum\nfrom typing import List, Optional\n\nimport numpy as np\nimport uvicorn\nfrom fastapi import Body, FastAPI, HTTPException\nfrom loguru import logger\nfrom... | [
[
"numpy.linalg.norm",
"sklearn.cluster.AgglomerativeClustering"
]
] |
ritchie46/flopy | [
"8e7284dcb3aaf5c12293d442248c2c2d9959f835"
] | [
"flopy/modflow/mfdrn.py"
] | [
"\"\"\"\r\nmfdrn module. Contains the ModflowDrn class. Note that the user can access\r\nthe ModflowDrn class as `flopy.modflow.ModflowDrn`.\r\n\r\nAdditional information for this MODFLOW package can be found at the `Online\r\nMODFLOW Guide\r\n<http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?drn.ht... | [
[
"numpy.dtype"
]
] |
molkjar/bachelor | [
"a0591691b820c6c8a45d16f8d55f3a7e80ea384b"
] | [
"NYS-covasim/second_wave_scenarios.py"
] | [
"import covasim as cv\nimport covasim.utils as cvu\nimport optuna as op\nimport sciris as sc\nimport pandas as pd\nimport numpy as np\nimport os\nfrom collections import defaultdict\nimport population\n\n## Interesting part starts around line 200\n## First part is setup, optimization workers and alike - Important t... | [
[
"pandas.read_csv",
"numpy.quantile"
]
] |
Arielce/dio | [
"eb8035664f605783f86b41d34006aeb9ef861f13"
] | [
"tutorials/bios-boot-tutorial/bios-boot-tutorial.py"
] | [
"#!/usr/bin/env python3\n\nimport argparse\nimport json\nimport numpy\nimport os\nimport random\nimport re\nimport subprocess\nimport sys\nimport time\n\nargs = None\nlogFile = None\n\nunlockTimeout = 999999999\nfastUnstakeSystem = './fast.refund/dccio.system/dccio.system.wasm'\n\nsystemAccounts = [\n 'dccio.bpa... | [
[
"numpy.random.pareto"
]
] |
11BP11/inverse_problems_GAN | [
"1d8ece55f7de1610b5481d39945b083a4ed3fcc0"
] | [
"problems/center_inpainting.py"
] | [
"\r\nimport tensorflow as tf\r\nimport numpy as np\r\n\r\nfrom problems.problem import *\r\n\r\nname = \"center inpainting\"\r\n \r\ng_tf_info_placeholder = tf.placeholder(tf.float32, [None], name='g_transform_info')\r\n \r\ndef problem_loss(x_tformed, g_tformed):\r\n return tf.reduce_mean(tf.abs(x_tformed... | [
[
"tensorflow.placeholder",
"tensorflow.ones_like",
"numpy.ones_like",
"numpy.copy",
"tensorflow.abs",
"numpy.clip"
]
] |
nicoguertler/leibnizgym | [
"2c1cb14fbfece09644445d58fe7ac28c41611e5f"
] | [
"leibnizgym/envs/trifinger/sample.py"
] | [
"\"\"\"\n@author Mayank Mittal\n@email mittalma@ethz.ch\n@brief Defines sampling stratergies.\n\n# TODO: These functions are generic. Can put in leibnizgym.utils.torch_utils module.\n\"\"\"\n\n# leibnizgym\nfrom leibnizgym.utils.torch_utils import quaternion_from_euler_xyz\n# python\nfrom typing impor... | [
[
"torch.cos",
"torch.randn",
"torch.nn.functional.normalize",
"torch.rand",
"torch.norm",
"torch.sin",
"torch.zeros"
]
] |
magne-max/zipline | [
"41172cd3a320806c4116bcfafa6a607fa300acde"
] | [
"zipline/pipeline/loaders/events.py"
] | [
"import numpy as np\nimport pandas as pd\n\nfrom six import viewvalues\nfrom toolz import groupby, merge\n\nfrom .base import PipelineLoader\nfrom .frame import DataFrameLoader\nfrom zipline.pipeline.common import (\n EVENT_DATE_FIELD_NAME,\n SID_FIELD_NAME,\n TS_FIELD_NAME,\n)\nfrom zipline.pipeline.loade... | [
[
"pandas.DataFrame",
"numpy.asarray"
]
] |
gmtpritam/stolgo | [
"8ced9b4c3ea2b0a89c929c2d2765ebc8593d00b2"
] | [
"lib/stolgo/nasdaq.py"
] | [
"import requests\nimport io\n\nfrom datetime import timedelta\nimport pandas as pd\n\nfrom stolgo.helper import get_date_range,get_formated_dateframe\nfrom stolgo.request import RequestUrl,Curl\n\n#default params for url connection\nDEFAULT_TIMEOUT = 5 # seconds\nMAX_RETRIES = 2\n#default periods\nDEFAULT_DAYS = 25... | [
[
"pandas.to_datetime"
]
] |
guoyang328/pytorch-dann | [
"1971cf1a7b9ecadc17932a8ecb3f0c34609751a3"
] | [
"datasets/mnist.py"
] | [
"\"\"\"Dataset setting and data loader for MNIST.\"\"\"\n\n\nimport torch\nfrom torchvision import datasets, transforms\nimport os\n\ndef get_mnist(dataset_root, batch_size, train):\n \"\"\"Get MNIST datasets loader.\"\"\"\n # image pre-processing\n pre_process = transforms.Compose([transforms.Resize(28), ... | [
[
"torch.utils.data.DataLoader"
]
] |
heiseApple/learn2learn | [
"df3c3291b4681440a80a69a7815090a4bd3cd661"
] | [
"examples/text/news_topic_classification.py"
] | [
"#!/usr/bin/env python3\n\nimport argparse\nimport random\n\nimport torch\nfrom torch import nn, optim\nfrom torch.nn import functional as F\nfrom tqdm import tqdm\n\nimport learn2learn as l2l\n\n\nclass Net(nn.Module):\n \"\"\"Head for sentence-level classification tasks.\"\"\"\n\n def __init__(self, num_cla... | [
[
"torch.nn.NLLLoss",
"torch.nn.Linear",
"torch.manual_seed",
"torch.no_grad",
"torch.nn.ReLU",
"torch.cuda.is_available",
"torch.hub.load",
"torch.hub.set_dir",
"torch.device",
"torch.nn.Dropout"
]
] |
taqtiqa-mark/pymarket | [
"2f8db92010d5f9407a72941788500351e92cbe81"
] | [
"pymarket/bids/demand_curves.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom typing import Tuple, Union\nfrom pymarket.bids import BidManager\n\n\ndef demand_curve_from_bids(\n bids: pd.DataFrame) -> Tuple[np.ndarray, np.ndarray]:\n \"\"\"\n Creates a demand curve from a set of buying bids.\n It is the inverse cumulative distrib... | [
[
"numpy.vstack",
"numpy.argmax"
]
] |
ethanjli/liquid-handling-robotics | [
"999ab03c225b4c5382ab9fcac6a4988d0c232c67"
] | [
"lhrhost/robot/axes.py"
] | [
"\"\"\"Abstractions for the axes of a liquid-handling robot.\"\"\"\n\n# Standard imports\nimport logging\nfrom abc import abstractmethod\n\n# Local package imiports\nfrom lhrhost.protocol.linear_actuator import Receiver as LinearActuatorReceiver\nfrom lhrhost.util.containers import add_to_tree, get_from_tree\nfrom ... | [
[
"scipy.stats.linregress"
]
] |
vvmar/machine-learning-engineering-for-production-public | [
"0350e2e79eebc1dc2edb9e7b5e6f582b40fa74be"
] | [
"course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py"
] | [
"import pickle\nimport numpy as np\nfrom typing import List\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel, conlist\n\n\n# rev 1\napp = FastAPI(title=\"Predicting Wine Class with batching\")\n\n# Open classifier in global scope\nwith open(\"models/wine-95-fixed.pkl\", \"rb\") as file:\n clf = pickl... | [
[
"numpy.array"
]
] |
jiansowa/Paddle | [
"0ecf441af14d554c85f69a206e3e3a9bdd86fb13",
"0ecf441af14d554c85f69a206e3e3a9bdd86fb13"
] | [
"python/paddle/fluid/trainer_factory.py",
"python/paddle/dataset/uci_housing.py"
] | [
"# Copyright (c) 2019 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 ... | [
[
"numpy.array"
],
[
"numpy.fromfile",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.close",
"matplotlib.use"
]
] |
rishikksh20/TalkNet2-pytorch | [
"baa6bf90c054634185932ed4b17a6ce8866feaba"
] | [
"model.py"
] | [
"\nimport torch.nn as nn\nfrom torch.nn import functional as F\nfrom utils import get_mask_from_lengths\nfrom embedding import GaussianEmbedding\nfrom quartznet import QuartzNet5x5, QuartzNet9x5\nfrom module import MaskedInstanceNorm1d, StyleResidual, Postnet\n\n\n\nclass GraphemeDuration(nn.Module):\n\n def __i... | [
[
"torch.nn.Conv1d",
"torch.nn.functional.mse_loss",
"torch.nn.Embedding"
]
] |
kmaasrud/vmc-fys4411 | [
"e96e2f6b1403118ee48ad5b5ff38582310ba4d2a"
] | [
"vmc/python/SGD_alphas.py"
] | [
"import pandas as pd\nimport os\nimport matplotlib.pyplot as plt\n\n\nimport numpy as np\n\n\n#location for files and plots\n\nPLOT_DIR = \"../plots/\"\nDATA_DIR = \"../data\"\nFILENAME_PLOT = 'SGD_alphas'\nPLOT_DIR = \"./\"\n\n\n#figure size and resolution\nfig = plt.figure()\nplt.style.use(\"seaborn\")\n#colour, ... | [
[
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.rc",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.ylim",
"matplo... |
idies/RMHDConverter | [
"24ff6e5ae2767b3aac4d24e9d6f1a116ef002eba"
] | [
"py/plot_slices.py"
] | [
"########################################################################\n#\n# Copyright 2015 Johns Hopkins University\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# ht... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gcf"
]
] |
jessica-dl/2XB3-ML-Training | [
"aa82d64c7b8b35eb79060a7bd7d22d09323b1c06"
] | [
"trainer/dataset.py"
] | [
"from tensorflow.python.lib.io import file_io\nimport h5py\nimport numpy as np\n\n\nclass Dataset:\n\n def __init__(self, path, local):\n \"\"\"\n Initialize the dataset\n :param path: Path to the hdf5 dataset file\n :param local: True if the path is to a local file, False otherwise\n... | [
[
"numpy.concatenate",
"numpy.argmax",
"tensorflow.python.lib.io.file_io.FileIO"
]
] |
SigfriedHache/euler-project | [
"7c38deee65a793a441830a6d0916da61e86b8cf7"
] | [
"Solutions/Q0005_Smallest_Evenly_Divisible_Number.py"
] | [
"\"\"\"\nhttps://projecteuler.net/problem=5\n2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.\n\nWhat is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?\n\"\"\"\nfrom numpy import prod\n\nfrom Common.Logger import ge... | [
[
"numpy.prod"
]
] |
garrettmflynn/sortingview | [
"0bb3df40d5d031ec651c4821f928787bbee71fbb"
] | [
"sortingview/helpers/prepare_snippets_h5_old.py"
] | [
"from typing import Dict, Union\n\nimport os\nimport hither2 as hi\nimport kachery_client as kc\nimport numpy as np\nimport spikeextractors as se\nfrom sortingview.extractors import LabboxEphysSortingExtractor, LabboxEphysRecordingExtractor\nfrom .SubsampledSortingExtractor import SubsampledSortingExtractor\nfrom .... | [
[
"numpy.array"
]
] |
YimiaoSun/network-slimming | [
"8ab3e6932fc3febd893faf83e23bee1aeb28be13"
] | [
"models/preresnet.py"
] | [
"# 本resnet结构选自:https://arxiv.org/pdf/1603.05027.pdf\n# 是原作者在resnet上的更新版本(实际用的没有原始版本广,认可度有质疑)\n\nfrom __future__ import absolute_import\nimport math\nimport torch.nn as nn\nfrom .channel_selection import channel_selection\n\n\n__all__ = ['resnet']\n\n\"\"\"\npreactivation resnet with bottleneck design.\n\"\"\"\n\ncl... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.ReLU"
]
] |
amroid/ibis | [
"9df27958f305a901728b540200bd8fa2820d4625"
] | [
"ibis/expr/tests/test_value_exprs.py"
] | [
"import functools\nimport operator\nimport os\nfrom collections import OrderedDict\nfrom datetime import date, datetime, time\nfrom operator import methodcaller\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nimport toolz\n\nimport ibis\nimport ibis.common.exceptions as com\nimport ibis.expr.analysis as ... | [
[
"pandas.Timestamp",
"numpy.float128"
]
] |
NamiKaze7/FinQA | [
"cf61ae2611ae205b62574e2b4264cb0318dd7202"
] | [
"code/generator/Model_new.py"
] | [
"import torch\nfrom torch import nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport math\nimport numpy as np\nfrom config import parameters as conf\n\nif conf.pretrained_model == \"bert\":\n from transformers import BertModel\nelif conf.pretrained_model == \"roberta\":\n from transformer... | [
[
"torch.stack",
"torch.nn.functional.softmax",
"torch.cat",
"torch.nn.Dropout",
"torch.repeat_interleave",
"torch.gather",
"torch.nn.LayerNorm",
"torch.arange",
"torch.unsqueeze",
"torch.ones",
"torch.nn.LSTM",
"torch.argmax",
"torch.transpose",
"torch.nn.Lin... |
anishvaidya/MIT-Indoor-Scene-Recognition | [
"04b2c35b25996d420c6fe90c480b86635f3baffd"
] | [
"model_inception_v2_67class.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport pandas as pd\nimport imageio\nimport skimage\nimport skimage.io\nimport skimage.transform\nfrom keras.models import Sequential\nfrom keras.layers import Conv2D\nfrom keras.layers import MaxPooling2D\nfrom keras.layers import Flatten\nfrom keras.layers import Dens... | [
[
"matplotlib.pylab.title",
"matplotlib.pylab.legend",
"matplotlib.pylab.figure",
"matplotlib.pylab.show",
"numpy.expand_dims",
"matplotlib.pylab.plot"
]
] |
veritaass/pig_mmdet | [
"6bb348a002695e83b2f16b84173ce0aebbb20e60"
] | [
"topdown_coco_tiny_dataset.py"
] | [
"import json\nimport os\nimport os.path as osp\n#from collections import OrderedDict\nimport tempfile\n\nimport numpy as np\n\nfrom mmpose.core.evaluation.top_down_eval import (keypoint_nme,\n keypoint_pck_accuracy)\nfrom mmpose.datasets.builder import DATASETS\nfrom... | [
[
"numpy.tile",
"numpy.zeros",
"numpy.array",
"numpy.linalg.norm",
"numpy.minimum"
]
] |
guilhermealvess/emotions | [
"a65df8f44a9ff4c25421e4b5bf8dc5d918dbd38c"
] | [
"core/gabor.py"
] | [
"\n\nimport numpy as np\nfrom skimage.filters import gabor_kernel\nimport cv2\n\n\nclass KernelParams:\n def __init__(self, wavelength, orientation):\n self.wavelength = wavelength\n self.orientation = orientation\n\n def __hash__(self):\n return hash((self.wavelength, self.orientation))\... | [
[
"numpy.array",
"numpy.arange"
]
] |
mihir135/deep_learning_nanodegree | [
"018bf9228d72a8c0580eb82070223cf5225ffd4a"
] | [
"3. Generate TV scripts/helper.py"
] | [
"import os\nimport pickle\nimport torch\n\n\nSPECIAL_WORDS = {'PADDING': '<PAD>'}\n\n\ndef load_data(path):\n \"\"\"\n Load Dataset from File\n \"\"\"\n input_file = os.path.join(path)\n with open(input_file, \"r\") as f:\n data = f.read()\n\n return data\n\n\ndef preprocess_and_save_data(d... | [
[
"torch.save",
"torch.load"
]
] |
HumanCompatibleAI/malmo | [
"147dad058c00574e57205833159decc91c8adfd1"
] | [
"MalmoEnv/malmoenv/core.py"
] | [
"# ------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 Microsoft Corporation\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and\n# associated documentation files (the \"Software\"), to deal in th... | [
[
"numpy.zeros",
"numpy.iinfo",
"numpy.frombuffer"
]
] |
ThompsonJ314/openmc | [
"173c85c2cbb1784e49edf51d2d379a0f981de4e3"
] | [
"openmc/filter.py"
] | [
"from abc import ABCMeta\nfrom collections import OrderedDict\nfrom collections.abc import Iterable\nimport hashlib\nfrom itertools import product\nfrom numbers import Real, Integral\nfrom xml.etree import ElementTree as ET\n\nimport numpy as np\nimport pandas as pd\n\nimport openmc\nimport openmc.checkvalue as cv\... | [
[
"numpy.isclose",
"numpy.asarray",
"numpy.vstack",
"numpy.allclose",
"numpy.abs",
"numpy.where",
"numpy.linspace",
"numpy.unique",
"numpy.tile",
"numpy.repeat",
"numpy.arange",
"numpy.all",
"numpy.min",
"pandas.concat",
"numpy.empty",
"pandas.DataFram... |
xiaxin2000/OpenCDA-Documents | [
"1ad4b368d4287dae8b282bac1665816a496d57c6"
] | [
"opencda/core/plan/spline.py"
] | [
"\"\"\"\nCubic spline planner\n\nAuthor: Atsushi Sakai(@Atsushi_twi)\n\n\"\"\"\nimport math\nimport numpy as np\nimport bisect\n\n\nclass Spline:\n \"\"\"\n Cubic Spline class for calculte curvature (Author: Atsushi Sakai(@Atsushi_twi)).\n\n Parameters\n -x : float\n The x coordinate.\n -y : f... | [
[
"matplotlib.pyplot.legend",
"numpy.linalg.solve",
"numpy.cumsum",
"numpy.zeros",
"numpy.diff",
"numpy.hypot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"numpy.rad2deg",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib... |
Taylor-Liu/rrt-algorithms | [
"54be136b71d63f8e3ff37afadf267da49080100b"
] | [
"examples/rrt_star/rrt_star_3d.py"
] | [
"# This file is subject to the terms and conditions defined in\n# file 'LICENSE', which is part of this source code package.\nimport os\nimport sys\nsys.path.append(os.path.dirname(os.path.abspath(__file__)) +\n \"/../../\")\n\nimport numpy as np\n\nfrom src.rrt.rrt_star import RRTStar\nfrom src.sear... | [
[
"numpy.array"
]
] |
vorticityxyz/Gaia-api | [
"04e2a9ee2448830df72156aecf432eda0c6eb504"
] | [
"gaia.py"
] | [
"# Description:\n#\n# WARNING!!! This file is a critical component of Vorticity Gaia API for seismic imaging\n# PLEASE DO NOT MODIFY\n#\n# (C) Vorticity Inc. Mountain View, CA 2021\n# Licence: MIT\n\nimport numpy as np\nimport grpc\nimport time\nimport os\nimport sys\nimport gaia_pb2\nimport gaia_pb2_grpc\nimport d... | [
[
"numpy.save",
"numpy.load",
"numpy.empty",
"numpy.lib.format.read_array_header_2_0",
"numpy.lib.format.read_array_header_1_0",
"numpy.savez",
"numpy.lib.format.read_magic",
"numpy.array",
"numpy.square"
]
] |
klDen/flink | [
"a2c737891afde0c63c1a453b1ee164b80b6a702c",
"a2c737891afde0c63c1a453b1ee164b80b6a702c"
] | [
"flink-python/pyflink/fn_execution/operations.py",
"flink-python/pyflink/table/tests/test_pandas_conversion.py"
] | [
"################################################################################\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF lice... | [
[
"pandas.Series"
],
[
"numpy.int8",
"pandas.DataFrame",
"numpy.float32",
"numpy.int64",
"numpy.int32",
"pandas.util.testing.assert_frame_equal",
"numpy.int16",
"numpy.float64"
]
] |
ggoh29/Simplicial-neural-network-benchmark | [
"9a12bcd054251790d85e3971f5473dcffaa5664b"
] | [
"planetoid_dgi_benchmark.py"
] | [
"from Planetoid.PlanetoidDataset import PlanetoidSCDataset\nfrom models import planetoid_GCN, planetoid_GAT, planetoid_SCN, planetoid_SCConv, planetoid_SAN, planetoid_SAT\nimport torch.nn as nn\nimport torch\nfrom Planetoid.DGI import DGI\nfrom Planetoid.logreg import LogReg\nfrom constants import DEVICE\n\n2708, 7... | [
[
"torch.sum",
"torch.ones",
"torch.stack",
"torch.load",
"torch.argmax",
"torch.nn.CrossEntropyLoss",
"torch.nn.BCEWithLogitsLoss",
"torch.zeros",
"torch.cat"
]
] |
JohnLauFoo/clc_packages_Yu | [
"259f01d9b5c02154ce258734d519ae8995cd0991",
"259f01d9b5c02154ce258734d519ae8995cd0991"
] | [
"matplotlib-3.4.3/matplotlib-3.4.3/examples/mplot3d/lines3d.py",
"matplotlib-3.4.3/matplotlib-3.4.3/examples/lines_bars_and_markers/hat_graph.py"
] | [
"\"\"\"\n================\nParametric Curve\n================\n\nThis example demonstrates plotting a parametric curve in 3D.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nax = plt.figure().add_subplot(projection='3d')\n\n# Prepare arrays x, y, z\ntheta = np.linspace(-4 * np.pi, 4 * np.pi, 100... | [
[
"matplotlib.pyplot.figure",
"numpy.cos",
"matplotlib.pyplot.show",
"numpy.sin",
"numpy.linspace"
],
[
"numpy.asarray",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.array"
]
] |
AhmetCanSolak/aydin | [
"e8bc81ee88c96e0f34986df30a63c96468a45f70"
] | [
"aydin/it/demo/n2s/nn/2D_generic.py"
] | [
"# flake8: noqa\nimport os\nimport time\n\nimport numpy\nimport numpy as np\nfrom skimage.data import camera\nfrom skimage.metrics import peak_signal_noise_ratio as psnr\nfrom skimage.metrics import structural_similarity as ssim\n\nfrom aydin.features.standard_features import StandardFeatureGenerator\nfrom aydin.io... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"numpy.clip",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show",
"... |
xhuohai/kendryte-model-compiler | [
"b6ef72b5db83a3b421046150ff3e77843c2be5bb"
] | [
"layer_list_to_darknet.py"
] | [
"'''\n * Copyright 2018 Canaan 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 ... | [
[
"numpy.array",
"numpy.transpose"
]
] |
837477/COMTRIS_AI | [
"2cb49a9a9c5de785d6b1a864abf8d5eeb6db3302"
] | [
"src/comtris.py"
] | [
"import os\nimport torch\nimport torch.nn as nn\nimport numpy as np\nfrom pymongo import MongoClient\n\n\nclass Net(nn.Module):\n def __init__(self, D_in, D_out):\n super(Net,self).__init__()\n self.layer_1 = nn.Linear(D_in, D_out*2)\n self.layer_out = nn.Linear(D_out*2, D_out)\n self... | [
[
"torch.nn.ReLU",
"torch.FloatTensor",
"torch.nn.Linear",
"torch.load"
]
] |
tum-db/partitioned-filters | [
"56c20102715a442cbec9ecb732d41de15b31c828"
] | [
"python/benchmark_plotter/latexify.py"
] | [
"import matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.ticker import AutoMinorLocator, FuncFormatter\nimport numpy as np\n\n\ndef latexify(fig_width=None, fig_height=None, columns=1):\n \"\"\"Set up matplotlib's RC params for LaTeX plotting.\n Call this before plotting a figure.\n\n Parameter... | [
[
"numpy.sqrt",
"matplotlib.pyplot.gca",
"matplotlib.ticker.AutoMinorLocator",
"matplotlib.rcParams.update"
]
] |
parneetk/PyTorch-Style-Transfer | [
"f38ec4b1cd57cee4304787b054a6e6c9ce3b00ff"
] | [
"experiments/net/mynn.py"
] | [
"##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n## Created by: Hang Zhang\n## ECE Department, Rutgers University\n## Email: zhang.hang@rutgers.edu\n## Copyright (c) 2017\n##\n## This source code is licensed under the MIT-style license found in the\n## LICENSE file in the root directory... | [
[
"torch.FloatTensor",
"torch.var",
"torch.sqrt",
"numpy.floor",
"torch.nn.UpsamplingNearest2d",
"torch.nn.Conv2d",
"torch.nn.ReflectionPad2d",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.mean"
]
] |
dennisbappert/sod-using-vit | [
"24ed0692d8eb09adf2f74e69a132f267a4137b68"
] | [
"train.py"
] | [
"import datetime\nimport os\nimport random\nimport time\nimport warnings\n\nimport hydra\nimport torch\nfrom hydra.utils import instantiate\nfrom omegaconf import DictConfig, OmegaConf\nfrom torch.cuda.amp import autocast, GradScaler\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader, We... | [
[
"torch.ones",
"torch.nn.functional.mse_loss",
"torch.cuda.amp.GradScaler",
"torch.load",
"torch.nn.functional.l1_loss",
"torch.manual_seed",
"torch.zeros",
"torch.autograd.set_detect_anomaly",
"torch.cuda.is_available",
"torch.utils.data.random_split",
"torch.cuda.amp.a... |
npabon/ProDy | [
"390322d9b7688809f91656bc1cadfdb66cd0a9b3"
] | [
"lib/prody/atomic/atom.py"
] | [
"# -*- coding: utf-8 -*-\n# ProDy: A Python Package for Protein Dynamics Analysis\n# \n# Copyright (C) 2010-2012 Ahmet Bakan\n# \n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either ver... | [
[
"numpy.array"
]
] |
em3ndez/gretel-synthetics | [
"7d9f433a741469860c6ec3aadf76da02036671c4"
] | [
"src/gretel_synthetics/batch.py"
] | [
"\"\"\"\nThis module allows automatic splitting of a DataFrame\ninto smaller DataFrames (by clusters of columns) and doing\nmodel training and text generation on each sub-DF independently.\n\nThen we can concat each sub-DF back into one final synthetic dataset.\n\nFor example usage, please see our Jupyter Notebook.... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"pandas.concat"
]
] |
weiwei1115/models | [
"14c3209118b2cadcce9a8f66b760c9cddb3a02ad"
] | [
"PaddleNLP/examples/text_generation/vae-seq2seq/model.py"
] | [
"# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.\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.sum",
"numpy.exp"
]
] |
Kathryn-Downey/DeepMergeDomainAdaptation | [
"334331ce8871cda80590cd9ec671941a82fa859c"
] | [
"galaxy_merge_edits/grad_cam.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n#\n# Author: Kazuto Nakashima\n# URL: http://kazuto1011.github.io\n# Created: 2017-05-26\n\nfrom collections import Sequence\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\nfrom tqdm import tqdm\n\n\nclass _BaseWrappe... | [
[
"torch.split",
"torch.set_grad_enabled",
"torch.nn.functional.softmax",
"torch.nn.functional.pad",
"torch.zeros_like",
"torch.nn.functional.relu",
"torch.mul",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.cat",
"torch.nn.functional.interpolate"
]
] |
enthought/numpy-refactor | [
"209866bc55eee56e92692307c4437af024bae87d"
] | [
"numpy/fft/tests/test_helper.py"
] | [
"#!/usr/bin/env python\n# Copied from fftpack.helper by Pearu Peterson, October 2005\n\"\"\" Test functions for fftpack.helper module\n\"\"\"\n\nfrom numpy.testing import *\nfrom numpy.fft import fftshift,ifftshift,fftfreq\n\nfrom numpy import pi\n\ndef random(size):\n return rand(*size)\n\nclass TestFFTShift(Te... | [
[
"numpy.fft.fftshift",
"numpy.fft.fftfreq",
"numpy.fft.ifftshift"
]
] |
chienerh/EPN_PointCloud | [
"d1488cf1ff82a5bc7ac89c28df30fa2f3f2e0e30"
] | [
"SPConvNets/models/pointnet_epn_netvlad.py"
] | [
"\"\"\"\nCode taken from https://github.com/cattaneod/PointNetVlad-Pytorch/blob/master/models/PointNetVlad.py\n\"\"\"\n\nfrom __future__ import print_function\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.utils.data\nfrom torch.autograd import Variable\nimport numpy as np\nimport torc... | [
[
"torch.unsqueeze",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"numpy.eye",
"torch.nn.Linear",
"torch.nn.BatchNorm1d",
"torch.nn.Conv2d",
"torch.nn.ReLU",
"torch.cat",
"torch.squeeze"
]
] |
XLPRUtils/pyUtils | [
"3a62c14b0658ad3c24d83f953ee0d88530b02b23"
] | [
"pyxlpr/ppocr/postprocess/pse_postprocess/pse_postprocess.py"
] | [
"# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.\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... | [
[
"numpy.zeros",
"numpy.squeeze",
"numpy.max",
"numpy.round",
"numpy.where",
"numpy.mean"
]
] |
code-review-doctor/keras | [
"96130040540e1405ffe746ddf2b2cceb9b8b8f65"
] | [
"keras/api/tests/api_compatibility_test.py"
] | [
"# Copyright 2021 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.compat.v1.resource_loader.get_data_files_path",
"tensorflow.tools.api.lib.python_object_to_proto_visitor.PythonObjectToProtoVisitor",
"tensorflow.tools.common.traverse.traverse",
"tensorflow.python.platform.tf_logging.error",
"tensorflow.python.platform.tf_logging.info",
"tenso... |
belldandyxtq/chainer | [
"abffa9a7def07c2e6bcd79d8ddcebeed1e762161"
] | [
"examples/vae/train_vae.py"
] | [
"#!/usr/bin/env python\n\"\"\"Chainer example: train a VAE on MNIST\n\"\"\"\nimport argparse\nimport os\nimport warnings\n\nimport numpy as np\n\nimport chainer\nfrom chainer import training\nfrom chainer.training import extensions\nimport chainerx\n\nimport net\n\nimport matplotlib\nmatplotlib.use('Agg')\n\n\ndef ... | [
[
"matplotlib.use",
"numpy.asarray",
"matplotlib.pyplot.subplots"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.