repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
MosesDastmard/ADM2019_HW04 | [
"5deba2d26b41f8b9a1433c81a1f1aa5bcef949e1"
] | [
"theoretical_lib.py"
] | [
"### The MILP problems can be solved using pulp packages that powered by B&B algorithm\r\n### provides the ability to get the global optimum for not only LP but also MILP\r\nimport pandas as pd\r\nfrom numpy.linalg import norm\r\nimport numpy as np\r\nimport pulp as plp\r\n#%%\r\ndef dist(df):\r\n dist_mat = np.... | [
[
"matplotlib.pyplot.scatter",
"numpy.arange",
"matplotlib.pyplot.ylim",
"numpy.linalg.norm",
"matplotlib.pyplot.plot",
"pandas.pivot_table",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.grid",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.text",
"numpy.zeros",
"... |
sarrrrry/M2Det | [
"ab3b87f207953b2c128ef74b1f787525426b9105"
] | [
"logger.py"
] | [
"# Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514\nimport tensorflow as tf\nimport numpy as np\nimport scipy.misc \ntry:\n from StringIO import StringIO # Python 2.7\nexcept ImportError:\n from io import BytesIO # Python 3.x\n\n\nclass Logger(object):\n \n ... | [
[
"tensorflow.summary.FileWriter",
"numpy.min",
"numpy.max",
"tensorflow.Summary.Value",
"numpy.prod",
"tensorflow.HistogramProto",
"tensorflow.Summary",
"numpy.histogram",
"numpy.sum"
]
] |
zwy19/easydl | [
"0da972f25db53b63e5ab7109ad7baf79a8bdb12c"
] | [
"easydl/common/scheduler.py"
] | [
"import numpy as np\n\ndef inverseDecaySheduler(step, initial_lr, gamma=10, power=0.75, max_iter=1000):\n '''\n change as initial_lr * (1 + gamma * min(1.0, iter / max_iter) ) ** (- power)\n as known as inv learning rate sheduler in caffe,\n see https://github.com/BVLC/caffe/blob/master/src/caffe/proto/... | [
[
"numpy.exp"
]
] |
liang-tool/pytext | [
"5ee6ac4c1b935849ec5d775fb7aa29917fb43096"
] | [
"pytext/trainers/trainer.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport itertools\nimport time\nfrom contextlib import ExitStack as contextlib_ExitStack\nfrom typing import Any, Iterable, List, Optional, Tuple\n\nimport torch\nfrom pytext.common.constants import BatchContext, Stage... | [
[
"torch.no_grad",
"torch.cuda.current_device"
]
] |
yakouyang/Multilevel_Wavelet_Decomposition_Network_Pytorch | [
"62b28433abeea2e773991197341a2d907ea478f1"
] | [
"model.py"
] | [
"import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.init as init\nfrom torch.nn.parameter import Parameter\nimport torch.nn.functional as F \nfrom torch.autograd import Variable\nimport torch.optim as optim\nimport numpy as np \nimport h5py\nfrom utils import ToVariable\n\nclass Wavelet_LSTM(nn.Modul... | [
[
"numpy.abs",
"torch.nn.LSTM",
"torch.cat",
"torch.zeros",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"numpy.random.randn",
"numpy.zeros",
"torch.nn.AvgPool1d"
]
] |
continental/hybrid_learning | [
"37b9fc83d7b14902dfe92e0c45071c150bcf3779"
] | [
"test/test_datasets/test_dataset_base.py"
] | [
"\"\"\"Tests for the basic dataset manipulation methods.\"\"\"\n# Copyright (c) 2020 Continental Automotive GmbH\n\n# Pylint seems to think the code libraries are external:\n# pylint: disable=wrong-import-order\n\nimport pytest\nimport torch\nfrom PIL import Image\n\nfrom hybrid_learning.datasets import cross_vali... | [
[
"torch.ones"
]
] |
RobRomijnders/bayes_nn | [
"f0052fd6610fb9bb00344b52745ca47bcc0cd453"
] | [
"bayes_nn/training_lang.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom bayes_nn.data_loader import Dataloader\nfrom torch.autograd import Variable\nfrom bayes_nn.util.util import to_tensor\nfrom torch.optim.lr_scheduler import LambdaLR\nfrom os.path import join\nimport os\n\nfrom bayes_nn.model.model_def... | [
[
"torch.optim.lr_scheduler.LambdaLR",
"torch.nn.functional.nll_loss",
"torch.autograd.Variable"
]
] |
papkov/pytorch-toolbelt | [
"71d03d907f93fa73fbfba5eb89d26ad801e47e03"
] | [
"tests/test_tta.py"
] | [
"from collections import defaultdict\n\nimport cv2\nimport numpy as np\nimport pytest\nimport torch\nfrom torch import nn\n\nfrom pytorch_toolbelt.inference import tta\nfrom pytorch_toolbelt.utils.torch_utils import to_numpy\nfrom pytorch_toolbelt.zoo import resnet34_unet32\n\nskip_if_no_cuda = pytest.mark.skipif(n... | [
[
"torch.cuda.empty_cache",
"torch.tensor",
"torch.no_grad",
"torch.rand",
"torch.cuda.is_available",
"pandas.DataFrame.from_dict",
"pandas.set_option",
"numpy.testing.assert_allclose"
]
] |
facebookresearch/OTTER | [
"605d317f989c057c7141e727baf430663fe9e44f"
] | [
"loss/kl_div_loss.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# \n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\nimport torch.nn as nn\n\n\nclass KLDivLoss(nn.Module):\n \"\"\"\n Wrapped KLDivergence Loss with a learnable te... | [
[
"torch.exp",
"torch.tensor",
"torch.nn.LogSoftmax",
"torch.nn.KLDivLoss"
]
] |
K-now978/pytorch-3dunet | [
"db9bddd1e924fa87faa7a04c4f9716a083c4c350"
] | [
"pytorch3dunet/datasets/dicom.py"
] | [
"import glob\nimport os\nfrom itertools import chain\nfrom multiprocessing import Lock\n\nimport dicom2nifti\nimport nibabel as nib\nimport numpy as np\n\nimport pytorch3dunet.augment.transforms as transforms\nfrom pytorch3dunet.datasets.utils import get_slice_builder, ConfigDataset, calculate_stats, sample_instanc... | [
[
"numpy.fliplr",
"numpy.random.RandomState",
"numpy.pad",
"numpy.stack"
]
] |
d-v-b/fish | [
"1fc9ea6c37e308ba02bd3307443365941a60196a"
] | [
"fish/ephys/ephys.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#\n# Process electrophysiological recordings of fish behavior and trial structure\n#\n# Davis Bennett\n# davis.v.bennett@gmail.com\n#\n# License: MIT\n#\n\n\ndef match_cam_time(events, frame_times):\n \"\"\"\n Helper function for mapping ephys events to came... | [
[
"numpy.fromfile",
"scipy.signal.fftconvolve",
"numpy.unique",
"numpy.arange",
"numpy.memmap",
"numpy.median",
"numpy.percentile",
"numpy.concatenate",
"numpy.diff",
"numpy.array",
"numpy.zeros",
"numpy.where",
"scipy.signal.gaussian"
]
] |
fnardmann/pointnet2 | [
"787d39d8d1099298fb3970d0e845515ebd0939bf"
] | [
"scannet/testload.py"
] | [
"import numpy as np\r\nimport laspy\r\nimport os\r\nfrom scipy.spatial import KDTree\r\nfrom sklearn.preprocessing import normalize\r\nimport logging\r\nfrom pathlib import Path\r\n\r\n\r\nclass Dataset():\r\n ATTR_EXLUSION_LIST = ['X', 'Y', 'Z', 'raw_classification', 'Classification',\r\n ... | [
[
"numpy.hstack",
"numpy.unique",
"numpy.min",
"numpy.random.shuffle",
"numpy.max",
"sklearn.preprocessing.normalize",
"numpy.equal",
"numpy.count_nonzero",
"numpy.vstack"
]
] |
vishalbelsare/regreg | [
"d1b62cc43cdd83331f2b0817b0ae099d5ef97966"
] | [
"regreg/smooth/__init__.py"
] | [
"import numpy as np\nfrom scipy import sparse\nimport warnings\nimport inspect\n\nfrom ..problems.composite import smooth as smooth_composite\nfrom ..affine import affine_transform, linear_transform, astransform\nfrom ..identity_quadratic import identity_quadratic\n\n#TODO: create proximal methods for known smooth ... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.any"
]
] |
DirkyJerky/Uni | [
"73ec1a84cdd59af9fc82a7bbb8af931305ec2ad3"
] | [
"514/hwk1/p2.py"
] | [
"import numpy as np\nfrom matplotlib import pyplot as plt\n\nf = lambda x: 1/2 * (x**2 + 0.3)\n\nplt.figure()\n\nfor x0 in [0, 1.83, -1]:\n idx = np.arange(21)\n iters = np.empty(21);\n\n iters[0] = x0\n for k in idx[1:]:\n iters[k] = f(iters[k-1])\n \n plt.plot(idx, iters, label = f'From {... | [
[
"matplotlib.pyplot.legend",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.empty",
"matplotlib.pyplot.figure"
]
] |
abhilash1910/sonnet | [
"0e25f47fac469c0c2180abba0b985aca46f529ce"
] | [
"sonnet/src/utils.py"
] | [
"# Copyright 2019 The Sonnet 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 required ... | [
[
"tensorflow.device",
"tensorflow.executing_eagerly",
"tensorflow.Variable",
"tensorflow.DeviceSpec.from_string",
"tensorflow.autograph.to_graph"
]
] |
MaxRobinson/DistributedQMemory | [
"9714f46c367423d22da22958ea37f1b6c6d6a1a2"
] | [
"DistQL/results/resultsScript.py"
] | [
"import numpy as np\n\nimport matplotlib.pyplot as plt\n\n\n# one of 4 agents\n# y = [-308, -875, -236, -371, -596, -722, -245, -371, -812, -866, -371, -551, -569, -236, -992, -254, -245, -506, -299, -542, -308, -281, -641, -344, -218, -317, -794, -488, -245, -236, -227, -290, -236, -450, -254, -641, -389, -1010, -... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.close"
]
] |
gony0/buffalo | [
"f93dc4f95a526ec711cd605cc39c6ff347d976ed"
] | [
"tests/parallel/test_algo.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nos.environ['OMP_NUM_THREADS'] = '1'\nimport time\nimport unittest\nfrom itertools import combinations\n\nimport numpy as np\n\nfrom buffalo.algo.als import ALS\nfrom buffalo.algo.w2v import W2V\nfrom buffalo.algo.bpr import BPRMF\nfrom buffalo.misc.log import set_log_level\nfrom... | [
[
"numpy.array",
"numpy.allclose"
]
] |
villawang/Continual_Learning_CV | [
"6715fa9c741df920e56aede11cbb85a4be41871e"
] | [
"applications/Gesture/action_recognition/R3D/dataset/spatial_transforms.py"
] | [
"import collections\nimport numbers\nimport random\n\nimport numpy as np\nimport scipy\nimport torch\nfrom PIL import Image\n\ntry:\n import accimage\nexcept ImportError:\n accimage = None\n\n\nclass Compose(object):\n \"\"\"Composes several transforms together.\n Args:\n transforms (list of ``Tr... | [
[
"numpy.reshape",
"numpy.arange",
"numpy.squeeze",
"numpy.asarray",
"torch.from_numpy",
"scipy.ndimage.interpolation.map_coordinates",
"numpy.copy",
"numpy.random.rand",
"numpy.array",
"numpy.zeros"
]
] |
PaulKGrimes/bolo-calc | [
"c2882d9b180dffe406db29253beb8307476b8c64"
] | [
"python/bolo/sky.py"
] | [
"\"\"\" Sky model \"\"\"\n\nfrom collections import OrderedDict as odict\n\nimport numpy as np\n\nimport h5py as hp\n\nfrom cfgmdl import Model, Property, cached\n\nfrom .utils import is_not_none, cfg_path\nfrom . import physics\n#from .unit import Unit\nfrom .cfg import Variable\n\nGHz_to_Hz = 1.e+09\nm_to_mm = 1.... | [
[
"numpy.expand_dims",
"numpy.isfinite",
"numpy.broadcast",
"numpy.interp",
"numpy.loadtxt"
]
] |
FrankFlitton/autoyeai.com | [
"8fbc0b7b4db97ac1930af32f15e06cf844aeab0f"
] | [
"train-python/__main__.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras.layers.experimental import preprocessing\n\nimport numpy as np\nimport os\nimport time\n\npath_to_file = r\"../data/cleanData/masterSpaces.txt\"\n\ntext = open(path_to_file, 'rb').read().decode(encoding='utf-8')\n\nprint('Length of text: {} characters'.format(len(text... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.sparse.to_dense",
"tensorflow.strings.unicode_split",
"tensorflow.constant",
"tensorflow.saved_model.load",
"tensorflow.keras.layers.Embedding",
"tensorflow.random.categorical",
"tensorflow.losses.SparseCategoricalCrossentro... |
YONGHAN-KIM/shap | [
"4c76cdb0a5ba2e5769a1d35c22eef117dd65e924"
] | [
"shap/plots/force_matplotlib.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import lines\nfrom matplotlib.font_manager import FontProperties\nfrom matplotlib.path import Path\nfrom matplotlib.patches import PathPatch\nimport matplotlib\n\n\ndef draw_bars(out_value, features, feature_type, width_separators, width_bar):\n ... | [
[
"matplotlib.pyplot.imshow",
"numpy.linspace",
"numpy.exp",
"matplotlib.patches.PathPatch",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.text",
"matplotlib.pyplot.Polygon",
"matplotlib.pyplot.locator_params",
"matplotlib.path.Path",
"matplotlib.fo... |
bxtkezhan/BAR4Py | [
"d8f26e155693db1c9268c4b1244aec50054a294b"
] | [
"bar4py/debugtools.py"
] | [
"import cv2\nimport numpy as np\n\n# Preview Functions\n\ndef drawCorners(points, frame):\n cv2.circle(frame, tuple(points[0]), 5, (0,0,255), 2)\n cv2.circle(frame, tuple(points[1]), 5, (0,255,0), 2)\n cv2.circle(frame, tuple(points[2]), 5, (0,255,255), 2)\n cv2.circle(frame, tuple(points[3]), 5, (255,0... | [
[
"numpy.float32"
]
] |
timvink/whatlies | [
"4a17bc2d4e014069e7ff3626f2fccbd66431054f"
] | [
"tests/test_embeddingset.py"
] | [
"from operator import add, rshift, sub, or_\n\nimport pytest\nimport numpy as np\nfrom spacy.vocab import Vocab\nfrom spacy.language import Language\n\nfrom whatlies import Embedding, EmbeddingSet\nfrom whatlies.language import SpacyLanguage\n\n\n@pytest.fixture()\ndef lang():\n vector_data = {\n k: np.ra... | [
[
"numpy.dot",
"numpy.array_equal",
"numpy.random.normal",
"numpy.array",
"numpy.isclose"
]
] |
jixiaojie/CarND-Behavioral-Cloning-P3 | [
"b245c73a2c68be2a9fa0a5daefb55eaafb14bd6e"
] | [
"model.py"
] | [
"import csv\n\nimport cv2\nimport numpy as np\nimport sklearn\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.utils import shuffle\nfrom keras.models import Sequential\nfrom keras.layers import *\nfrom keras.initializers import *\n\nfrom keras import backend as K\nK.clear_session()\n\n\nsample... | [
[
"sklearn.utils.shuffle",
"numpy.array",
"sklearn.model_selection.train_test_split"
]
] |
TBC-TJU/brainda | [
"b46a33bcf3cb3625d09571fdeac8c8bc0480db69"
] | [
"demos/FBMsCCA.py"
] | [
"import sys\nimport numpy as np\nfrom brainda.datasets import Wang2016\nfrom brainda.paradigms import SSVEP\nfrom brainda.algorithms.utils.model_selection import (\n set_random_seeds,\n generate_kfold_indices, match_kfold_indices)\nfrom brainda.algorithms.decomposition import FBMsCCA\nfrom brainda.algorithms.... | [
[
"numpy.cos",
"numpy.sin",
"numpy.concatenate",
"numpy.mean",
"numpy.array"
]
] |
yqhu/torchrec | [
"3dc5db08eb8a3962ebc16f844ede628a128456f3"
] | [
"torchrec/sparse/jagged_tensor.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport abc\nfrom typing import Optional, List, Dict, Tuple\n\nimport torch\n... | [
[
"torch.ops.load_library",
"torch.cat",
"torch.fx.wrap",
"torch.tensor",
"torch.split",
"torch.ops.fbgemm.asynchronous_complete_cumsum"
]
] |
mattboggess/eda-tools | [
"8bfc54a9072a4d789ee36d73f23e04adb2c3080e"
] | [
"examples/plot_univariate_datetime_summary.py"
] | [
"\"\"\"\nUnivariate Datetime Summary\n=======\n\nExample of univariate eda summary for a datetime variable. Here we look at posting times for TidyTuesday tweets.\n\nThe datetime summary computes the following:\n\n- A time seriesplot aggregated according to the `ts_freq` parameter\n- A boxplot and histogram of the t... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
egonw/bioregistry | [
"5070e0310a4e9f695d9089b302e0a2421c155d02"
] | [
"src/bioregistry/curation/make_description_curation_sheet.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Make a curation sheet for the bioregistry.\"\"\"\n\nimport pandas as pd\n\nimport bioregistry\nfrom bioregistry.constants import BIOREGISTRY_MODULE\n\n\ndef descriptions():\n \"\"\"Make a curation sheet for descriptions.\"\"\"\n columns = [\n \"prefix\",\n \"nam... | [
[
"pandas.DataFrame"
]
] |
sudharsana-kjl/esmlab | [
"17d9788eb7b8c6a0f7cfd4e547b4057b3d25f3c9"
] | [
"esmlab/statistics.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import absolute_import, division, print_function\n\nfrom warnings import warn\n\nimport numpy as np\nimport xarray as xr\n\nfrom .utils.common import esmlab_xr_set_options\nfrom .utils.variables import (\n get_original_attrs,\n get_static_variables,\n get_variables,\... | [
[
"numpy.sqrt",
"numpy.ones"
]
] |
daletovar/csparse | [
"93cacae13bf8fe1c65c6658779939f585d14dc8f"
] | [
"GCRS2/csr_indexing.py"
] | [
"import numpy as np \r\nimport numba\r\n\r\n\r\n\r\n@numba.jit(nopython=True,nogil=True)\r\ndef csr_row_array_col_array(arr_data,arr_indices,arr_indptr,indptr,row,col):\r\n \"\"\"\r\n This is a very general algorithm to be used when more optimized methods don't apply. \r\n It performs a binary search for e... | [
[
"numpy.array",
"numpy.searchsorted"
]
] |
zviri/pdftotree | [
"3daca0feb17fc3a0136a4098e5f9a8e72794d527"
] | [
"pdftotree/utils/display_utils.py"
] | [
"import numpy as np\nfrom wand.color import Color\nfrom wand.display import display\nfrom wand.drawing import Drawing\nfrom wand.image import Image\n\n\ndef display_bounding_boxes(img, blocks, alternatecolors=False, color=Color(\"blue\")):\n \"\"\"\n Displays each of the bounding boxes passed in 'boxes' on an... | [
[
"numpy.random.randint"
]
] |
XuyangBai/mmdetection3d | [
"53370467c1b88f163cbe7b7300a1f588a6761e35"
] | [
"mmdet3d/core/visualizer/show_result.py"
] | [
"import mmcv\nimport numpy as np\nimport trimesh\nfrom os import path as osp\n\n\ndef _write_ply(points, out_filename):\n \"\"\"Write points into ``ply`` format for meshlab visualization.\n\n Args:\n points (np.ndarray): Points in shape (N, dim).\n out_filename (str): Filename to be saved.\n ... | [
[
"numpy.eye",
"numpy.cos",
"numpy.sin",
"numpy.array",
"numpy.zeros"
]
] |
agesb/TransQuest | [
"84fb49b2e8d3dfae6caacc378e9764e610452aad"
] | [
"transquest/algo/sentence_level/multitransquest/utils.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"torch.nn.Sequential",
"torch.zeros",
"torch.nn.AdaptiveAvgPool2d",
"torch.flatten",
"torch.stack"
]
] |
Maddonix/data_store | [
"0e48e9b25ce8bf0628af714af7888fa47c82f303"
] | [
"src/utils/audio_utils.py"
] | [
"import torch\nimport torchaudio\n\ndef resample(aud, newsr):\n \"\"\"Resamples the audiofile to given samplerate\n\n Args:\n aud (tuple): tuple containing (audiodata_array, samplerate)\n newsr (int): new samplerate\n\n Returns:\n tuple: (audiodata_array, samplerate)\n \"\"\"\n s... | [
[
"torch.cat"
]
] |
YeLyuUT/FastVOD | [
"707dcf0d88a901d2db0b7cf24096801fbdd8735c"
] | [
"lib/model/siamese_net/template_target_proposal_layer.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport numpy as np\r\nfrom model.utils.config import cfg\r\nfrom model.siamese_net.template_proposal_layer import _TemplateProposalLayer\r\nfrom model.siamese_net.weight_cropping_layer import weight_crop_layer\r\n\r\nclass _TemplateTargetProposalLayer(nn.Module):\r\n '''... | [
[
"torch.stack",
"torch.nonzero"
]
] |
dani-garcia/multiview_gpu | [
"b592b6bdf5d9bbd4ab08f4e5bf48c0435b1c8d7f",
"b592b6bdf5d9bbd4ab08f4e5bf48c0435b1c8d7f"
] | [
"multiview_gpu/tests/test_util.py",
"multiview_gpu/tests/conftest.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom numpy.testing import assert_array_almost_equal\nfrom sklearn.utils.testing import assert_raises\nimport multiview_gpu.util as util\n\n\ndef test_hbeta(sess):\n data = np.arange(25, dtype=float).reshape((5, 5))\n data = tf.convert_to_tensor(data, dtype=tf.floa... | [
[
"tensorflow.convert_to_tensor",
"numpy.arange",
"numpy.array",
"numpy.testing.assert_array_almost_equal"
],
[
"tensorflow.Session"
]
] |
artemyk/dit | [
"72e3aa1b128c2ccacfe14f6f73043ef772b81788"
] | [
"setup.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nInstallation script for dit.\n\"\"\"\n\nimport ast\nimport re\nimport sys\nimport warnings\n\nfrom setuptools import Extension, find_packages, setup\n\nfrom distutils.command import install_data\n\n_version_re = re.compile(r'__version__\\s+=\\s+(.*)')\n\nNAME = \"dit\"\nAUTHOR = \"Hu... | [
[
"numpy.get_include"
]
] |
VulRepairTeam/VulRepair | [
"9cf2abd7ca27d84445ddfc7ab323745a5b676cce"
] | [
"M9_CodeBERT_word_level/codebert_wordlevel_main.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"pandas.read_csv",
"numpy.random.seed",
"torch.nn.TransformerDecoderLayer",
"torch.load",
"torch.manual_seed",
"torch.utils.data.SequentialSampler",
"torch.utils.data.DataLoader",
"torch.utils.data.RandomSampler",
"torch.nn.TransformerDecoder",
"torch.tensor",
"torch.nn... |
Chenglin-Yang/PatchAttack | [
"56941df37c6840aca1c98d091e75968ffece42af"
] | [
"PatchAttack/TextureDict_extractor.py"
] | [
"import os\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\n# torch\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.models as Models\nimport torch.optim as optim\n\nimport PatchAttack.utils as utils\n\n# global variables\ntorch_cuda = 0\n\n\nclass GradCam... | [
[
"matplotlib.pyplot.imshow",
"sklearn.cluster.KMeans",
"torch.cat",
"torch.load",
"torch.sum",
"numpy.max",
"numpy.mean",
"torch.no_grad",
"torch.save",
"numpy.uint8",
"torch.from_numpy",
"matplotlib.pyplot.subplots_adjust",
"numpy.zeros",
"matplotlib.pyplot.... |
greglan/python_scripts | [
"f2e98ed3fd975d79b0a6b569b65c850a7f4f3ab3"
] | [
"maths/euler_totient_function.py"
] | [
"# -*- coding: utf-8 -*-\n# !/usr/bin/env python\n\n\"\"\"\n Plot Euler's totient function\n\"\"\"\n\n\nimport matplotlib.pyplot as plt\n\n\ndef primes(a, b):\n r = b % a\n while r != 0:\n b = a\n a = r\n r = b % a\n return a == 1\n\n\ndef phi(n):\n i = 1\n for k in range(2, n... | [
[
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
KatharinaBuelow/cmip5_cmip6_euro-cordex-plotting-routines | [
"b265f9c77ed5b9fb01a76e6549b5c621d14e96b5"
] | [
"py_plotting_cmip_cordex/cmip5_cmip6_cordex_scatter_plot.py"
] | [
"#! /usr/bin/python\n# coding: utf-8\nimport numpy as np\nimport glob\nimport matplotlib.pyplot as plt\nimport subprocess\nimport os\nfrom matplotlib import markers\nfrom scattertable import scattertable\nimport pandas as pd\nimport seaborn as sns\nfrom dp_cmip_plotting_tools import scatter_plot , scatter_plot_cord... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
ahiihu/frustum-pointnets | [
"f638473c950ed7693f5522e61f9eea7d0ca191a7"
] | [
"prepare_data.py"
] | [
"''' Prepare KITTI data for 3D object detection.\n\nAuthor: Charles R. Qi\nDate: September 2017\n\n'''\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport numpy as np\nimport cv2\nfrom PIL import Image\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = os.path.dirname(BASE_DIR)\n... | [
[
"numpy.random.random",
"scipy.spatial.Delaunay",
"numpy.arctan2",
"numpy.zeros_like",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
hareeshreddi/Computer-Networks-Lab-Assignments | [
"c86665a4fb673fd53b636f552e02e6d06c94ba22"
] | [
"Networks Lab-04/Scripts-Data-Graphs/CodesToGenerateGraphs/tcp_ack_sta1.py"
] | [
"import matplotlib.pyplot as plt\nfrom pylab import MaxNLocator\n# x axis values\nx = [0,256,512,1000]\n# corresponding y axis values\ny = [18.2365701294,18.398790741,18.4004942322,18.398790741]\n\n# plotting the points\nplt.plot(x, y, color='green',linewidth = 3,\n marker='o', markerfacecolor='blue', marke... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
VMReyes/isthisdaniel | [
"9bb1bd24652c5afd585d1437dcd1ef5c532f10de"
] | [
"src/sample/cv/im_capture.py"
] | [
"import cv2\nimport numpy as np\nfrom PIL import ImageGrab\n\n# set some global variables\nis_clicked = False\ncoors = list()\nloop = True\nfilename = 'tmp'\n\ndef run(filepath='tmp'):\n global img, loop, filename\n\n # set the file path if it was passed\n filename = filepath\n\n try:\n # create ... | [
[
"numpy.array"
]
] |
ioyy900205/MSDNet-PyTorch | [
"1df47bb193f9392a54fec42d2591a337ca997619"
] | [
"adaptive_inference.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport torch\nimport torch.nn as nn\nimport os\nimport math\n\ndef dynamic_evaluate(model, test_loader, val_loader, args):\n tester = Tester(model, args)\n\n... | [
[
"torch.nn.Softmax",
"torch.range",
"torch.Tensor",
"torch.zeros",
"torch.cat",
"torch.no_grad",
"torch.FloatTensor",
"torch.log",
"torch.autograd.Variable"
]
] |
wc253/HaltingNetwork | [
"b4890f53fa87de8163a541e693a3161dcb4cad41"
] | [
"original_unfolding_networks/tools/problems.py"
] | [
"#!/usr/bin/python\nfrom __future__ import division\nfrom __future__ import print_function\nimport numpy as np\nimport numpy.linalg as la\nimport math\nimport tensorflow as tf\nimport os\nfrom collections import OrderedDict\nclass Generator(object):\n def __init__(self,A,L,**kwargs):\n self.A = A\n ... | [
[
"tensorflow.FixedLenFeature",
"numpy.concatenate",
"numpy.random.randint",
"numpy.square",
"tensorflow.data.TFRecordDataset",
"tensorflow.decode_raw",
"numpy.matmul",
"numpy.save",
"tensorflow.parse_single_example",
"numpy.zeros",
"tensorflow.placeholder",
"tensorfl... |
baoy-nlp/CNAT | [
"804dfbf230568262b62a006c3b0167cd6fa7cd43"
] | [
"latent_nat/vnat.py"
] | [
"import copy\n\nimport torch\nimport torch.nn as nn\nfrom fairseq.models import register_model, register_model_architecture\n\nfrom .glat import GlancingTransformer, GlancingTransformerDecoder, init_bert_params\nfrom .utils import GateNet, SelfATTEncoder, GaussianVariable, GlobalNames\n\n# to support different vers... | [
[
"torch.cat"
]
] |
dearwind153/pytorch-minst | [
"47e9dcc22f611f045027fda782fb55e2e4229500"
] | [
"pytorch_gpu_speed_test.py"
] | [
"import torch\nimport time\n\nprint(torch.__version__) # 返回pytorch的版本\nprint(torch.cuda.is_available()) # 当CUDA可用时返回True\n\na = torch.randn(10000, 1000) # 返回10000行1000列的张量矩阵\nb = torch.randn(1000, 2000) # 返回1000行2000列的张量矩阵\n\nt0 = time.time() # 记录时间\nc = torch.matmul(a, b) # 矩阵乘法运算\... | [
[
"torch.device",
"torch.randn",
"torch.matmul",
"torch.cuda.is_available"
]
] |
lelange/cu-ssp | [
"9f1a7abf79a2fb6ef2ae0f37de79469c2dc3488f"
] | [
"model_3/gpu.py"
] | [
"import tensorflow as tf \n# Creates a graph.\nwith tf.device('/gpu:0'):\n a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')\n b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')\nc = tf.matmul(a, b)\n# Creates a session with log_device_placement set to True.\nsess = tf.S... | [
[
"tensorflow.ConfigProto",
"tensorflow.matmul",
"tensorflow.constant",
"tensorflow.device"
]
] |
dwraft/gameRL | [
"518b2a2d193220f7334584ccde5cf2ab318d718a"
] | [
"gameRL/game_simulators/blackjack_count.py"
] | [
"# Created by Patrick Kao\nimport math\nfrom typing import Tuple\n\nimport numpy as np\nfrom gym import spaces\n\nfrom gameRL.game_simulators.blackjack import (\n BlackjackDeck,\n CARD_VALUES,\n SUITS,\n BlackjackHand,\n DEALER_MAX,\n BlackjackCustomEnv,\n)\n\n\nclass BlackjackDeckwithCount(Blackj... | [
[
"numpy.array"
]
] |
Bhaskers-Blu-Org2/belugasounds | [
"1e8ab23e2f035376fdabb17854d1654738964f9d"
] | [
"step6_full_analysis_scoring_for_new_dataset.py"
] | [
"#\n# full_analysis_scoring_for_new_dataset.py\n#\n# Run trained models on a new data set for which spectrograms have already\n# been generated.\n#\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n#\n\n#%% Imports\n\nimport pandas as pd\nimport numpy as np\nimport glo... | [
[
"numpy.asarray",
"pandas.read_excel",
"pandas.DataFrame"
]
] |
LoicGrobol/decofre | [
"68e12c8da4a6c032bb5ea3edff9e8484344e94e2"
] | [
"decofre/score.py"
] | [
"#! /usr/bin/env python3\nr\"\"\"Coreference antecedent scoring\n\nUsage:\n score [options] <model> <dataset> [<output>]\n\nOptions:\n --pretty Output pretty JSON\n --device <d> The device to use for computations (defaults to `cuda:0` or `cpu`)\n -h, --help Show this screen.\n\"\"\"\nimport contextlib\... | [
[
"torch.device",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
Paulschneider007/CortexThicknessAnalysis | [
"b5d0b2391d5db6061ac692001d91506dc456e12f"
] | [
"extract_cortex_thickness_v5.py"
] | [
"#!/opt/local/bin/python\n\n__author__ = \"Andrew G. Clark\"\n__date__ = \"7 May 2014\"\n__maintainer__ = \"Andrew G. Clark\"\n__email__ = \"andrew.clark@curie.fr\"\n\n\"\"\" This script analyzes linescans and extracts cortex thickness and density from actin/membrane linescan pairs.\n\nThe script can be run in a 'p... | [
[
"numpy.log",
"numpy.sum",
"scipy.stats.norm.cdf",
"numpy.linspace",
"scipy.exp",
"numpy.abs",
"numpy.arange",
"scipy.optimize.leastsq",
"numpy.mean",
"numpy.array",
"numpy.trapz"
]
] |
fcr3/lcnn | [
"aed9edc4ccae9579858484a60dc52754f184c285"
] | [
"lcnn/models/line_vectorizer_ov.py"
] | [
"import itertools\nimport random\nfrom collections import defaultdict\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom lcnn.config import M\n\nFEATURE_DIM = 8\n\n\nclass LineVectorizer(nn.Module):\n def __init__(self, fc1, fc2):\n super().__init__()\n ... | [
[
"torch.cat",
"torch.zeros",
"torch.sum",
"torch.nn.BCEWithLogitsLoss",
"torch.no_grad",
"torch.topk",
"numpy.clip",
"torch.nn.MaxPool1d",
"torch.arange",
"torch.argsort",
"torch.nn.functional.max_pool2d",
"torch.nn.BatchNorm1d",
"torch.linspace",
"torch.sigm... |
zsync/gomoku-alphazero | [
"82262554e35562533de2f296e4553f4f1f455477"
] | [
"convert.py"
] | [
"import argparse\n\nimport h5py\nimport numpy as np\n\nfrom config import CHANNELS\nfrom policy import PolicyValueModelResNet as PolicyValueModel\n\n\ndef convert_pretrained_weights(\n src_weights_file,\n dst_weights_file,\n src_width=8,\n dst_width=15,\n src_height=8,\n dst_height=15,\n):\n mo... | [
[
"numpy.zeros"
]
] |
JBGreisman/careless | [
"8f6c0859973757d11b26b65d9dc51d443030aa70"
] | [
"careless/io/manager.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport reciprocalspaceship as rs\nfrom .asu import ReciprocalASU,ReciprocalASUCollection\nfrom careless.models.base import BaseModel\nfrom careless.models.priors.wilson import WilsonPrior\n\nclass DataManager():\n \"\"\"\n This class comprises various data manipul... | [
[
"tensorflow.convert_to_tensor",
"numpy.unique",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.optimizers.Adam",
"numpy.exp"
]
] |
COVID-19-Causal-Reasoning/BEL2SCM | [
"8bc92c6016fdd0cbccd6c3c96ae3c9106b01446f"
] | [
"tests/test_plots_bel2scm.py"
] | [
"\"\"\"\n------------------CODE DESCRIPTION----------------------------------\n This is the test file which stores experiments to generate data\n for plots in the paper that were generated using bel2scm algorithm.\n\n Check test_bel2scm.py to see unit tests for usability/debugging.\n\n Check test_plots_... | [
[
"pandas.read_csv",
"torch.manual_seed",
"torch.is_tensor",
"pandas.DataFrame",
"torch.tensor"
]
] |
ADozois/pfe_movidius | [
"62f29ae6b124ea594bc252e2b1a5441e3ac165f7"
] | [
"test.py"
] | [
"import numpy\nimport cv2\nimport sys\nsys.path.insert(0, \"../../ncapi2_shim\")\nimport mvnc_simple_api as mvnc\nfrom NCS import NCS\n\ndim=(300,300)\nEXAMPLES_BASE_DIR='../../'\nIMAGES_DIR = EXAMPLES_BASE_DIR + 'data/images/'\nIMAGE_FULL_PATH = \"/home/walle/Movidius/ncappzoo/data/images/nps_chair.png\"\n\n# ****... | [
[
"numpy.isfinite"
]
] |
marblejenka/sawatabi | [
"8940bafed202e03b9f9fce4df2229960018871c8"
] | [
"tests/model/test_logical_model.py"
] | [
"# Copyright 2021 Kotaro Terada\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 agree... | [
[
"numpy.isnan",
"numpy.count_nonzero"
]
] |
conda-forge-linter/pyimagej-feedstock | [
"8034cc2340f29c7e1408d1ab67a8e76266074512"
] | [
"recipe/run_test.py"
] | [
"import imagej\nimport numpy as np\n\nij = imagej.init(headless=True)\nprint(ij.getVersion())\n\nimg_shape = (512, 512)\n\nimg = np.random.random(img_shape)\noutput = np.zeros(img.shape, dtype=img.dtype)\nrai = ij.op().filter().frangiVesselness(ij.py.to_java(output), ij.py.to_java(img), [1, 1], 20)\n\nassert output... | [
[
"numpy.random.random",
"numpy.zeros"
]
] |
fvcalderan/interpolation | [
"1084c66cfb26244f42dec7fdeadf18ae5cdd3a2f"
] | [
"interpolation.py"
] | [
"from sympy import *\nimport sys\nimport matplotlib.pyplot as plt\nimport numpy as np\n__author__ = 'Felipe V. Calderan'\n__copyright__ = 'Copyright (C) 2020 Felipe V. Calderan'\n__license__ = 'BSD 3-Clause \"New\" or \"Revised\" License'\n__version__ = '1.0'\n\n\ndef check_args():\n \"\"\"check correctnes of th... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.savefig",
"numpy.genfromtxt"
]
] |
Satyam-Bhalla/Machine-Learning-Practice | [
"0ae4b8ae9501fb0a22b236dbc508fe6b32e21f42"
] | [
"Day 8 - Logistic Regression/logistic_regression.py"
] | [
"# Logistic Regression\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('Social_Network_Ads.csv')\nX = dataset.iloc[:, [2, 3]].values\ny = dataset.iloc[:, 4].values\n\n# Splitting the dataset into the Training se... | [
[
"matplotlib.pyplot.legend",
"sklearn.cross_validation.train_test_split",
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"matplotlib.pyplot.title",
"numpy.unique",
"sklearn.metrics.confusion_matrix",
"matplotlib.colors.ListedColormap",
"matplotlib.pyplot.xlabel",
... |
aikonens/GoodVibes | [
"d9b7920bd27ceb39f203a3522c2570ffc0c58686"
] | [
"goodvibes/io.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import print_function, absolute_import\n\nimport os.path, sys\nimport numpy as np\n\n# PHYSICAL CONSTANTS UNITS\nKCAL_TO_AU = 627.509541 # UNIT CONVERSION\n\n# Radii used to determine connectivity in symmetry corrections\n# Covalent rad... | [
[
"numpy.array"
]
] |
discohead/jesse | [
"5f025cc72adb33132b75a516f74f96b52ca12af3"
] | [
"jesse/indicators/mom.py"
] | [
"from typing import Union\n\nimport numpy as np\nimport talib\n\nfrom jesse.helpers import get_candle_source\nfrom jesse.helpers import get_config\n\n\ndef mom(candles: np.ndarray, period: int = 10, source_type: str = \"close\", sequential: bool = False) -> Union[\n float, np.ndarray]:\n \"\"\"\n MOM - Mom... | [
[
"numpy.isnan"
]
] |
ZhouHUB/pyIID | [
"6114fb5ae4388061c7aae9f5b0b2e41aa4ca4341"
] | [
"pyiid/experiments/elasticscatter/kernels/__init__.py"
] | [
"import math\nfrom numba import *\nfrom numba import cuda, f4, i4, int32\nimport numpy as np\nfrom builtins import range\n\n__author__ = 'christopher'\n\n\n@jit(target='cpu', nopython=True)\ndef ij_to_k(i, j):\n return int(j + i * (i - 1) / 2)\n\n\n@jit(target='cpu', nopython=True)\ndef k_to_ij(k):\n i = math... | [
[
"numpy.zeros"
]
] |
Y-oHr-N/pretools | [
"5efc6f0ae3f131446ad1e5c4b635d9ddfaff1677"
] | [
"pretools/sklearn/splitters.py"
] | [
"\"\"\"Splitters.\"\"\"\n\nfrom typing import Iterator, Optional, Tuple\n\nimport numpy as np\nfrom sklearn.model_selection._split import _BaseKFold\nfrom sklearn.utils.validation import _num_samples\n\nfrom ..types import OneDimArrayLikeType, TwoDimArrayLikeType\n\n\ndef _unique_without_sort(array: OneDimArrayLike... | [
[
"numpy.arange",
"sklearn.utils.validation._num_samples",
"numpy.isin",
"numpy.unique"
]
] |
phaustin/jb_test | [
"e25e3dcad07b860ddd3cc151295bdacad54ead8e"
] | [
"quantecon_flat/mini_book/docs/_static/lecture_specific/pandas/wb_download.py"
] | [
"import matplotlib.pyplot as plt\nimport requests\nimport pandas as pd\n\n# == Get data and read into file gd.xls == #\nwb_data_query = (\n \"http://api.worldbank.org/v2/en/indicator/gc.dod.totl.gd.zs?downloadformat=excel\"\n)\nr = requests.get(wb_data_query)\nwith open(\"gd.xls\", \"wb\") as output:\n output... | [
[
"pandas.read_excel",
"matplotlib.pyplot.show"
]
] |
AhmedSamySaad/MAC | [
"be045066d6416d7a9d7ca7f23923448e0edca433"
] | [
"src/model_test.py"
] | [
"\nimport os\nimport time\nimport datetime\nimport random\nimport json\nimport argparse\nimport numpy as np\nimport keras.backend as K\n# from sklearn.metrics import confusion_matrix\nimport tensorflow as tf\nfrom sklearn.metrics import f1_score\n# from keras.optimizers import Adam\nfrom tensorflow.keras.optimizers... | [
[
"sklearn.metrics.f1_score",
"numpy.array",
"tensorflow.math.confusion_matrix"
]
] |
wbo4958/cudf | [
"b12f24d25815145a573a9d70f8c6140a8ab9d2cb"
] | [
"python/cudf/cudf/core/index.py"
] | [
"# Copyright (c) 2018, NVIDIA CORPORATION.\n\nfrom __future__ import division, print_function\n\nimport functools\nimport pickle\n\nimport cupy\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\n\nimport cudf\nfrom cudf._lib.nvtx import annotate\nfrom cudf.core.column import (\n CategoricalColumn,\n... | [
[
"pandas.api.types.is_integer",
"pandas.RangeIndex",
"numpy.asarray",
"pandas.Categorical",
"numpy.dtype",
"pandas._config.get_option",
"pandas.api.types.is_list_like",
"pandas.api.types.is_dtype_equal",
"pandas.api.types.is_string_dtype",
"numpy.array"
]
] |
CHIMAWAN001/scikit-multiflow | [
"d538bc50d128442eceda6a21bd6557a3923cf1d8"
] | [
"src/skmultiflow/ADCN/ADCN_process/ADCNbasic.py"
] | [
"import numpy as np\nfrom scipy.special import softmax\nimport time \nimport copy\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom numpy import linalg as LA\nimport pdb\nfrom collections import deque\nimport random\nimport warnings\nfrom skmultiflow.ADCN.ADCN_process.utilsADCN import clus... | [
[
"torch.mean",
"numpy.log",
"torch.abs",
"torch.max",
"torch.Tensor",
"torch.cat",
"torch.randperm",
"numpy.abs",
"torch.min",
"torch.nn.BCELoss",
"torch.tensor",
"numpy.argmax",
"torch.no_grad",
"torch.device",
"numpy.exp",
"numpy.zeros",
"torch.... |
mitjanikolaus/CPC_audio | [
"4f6fc0b828a89766695ba1e5da4d6fbd0cac9131"
] | [
"cpc/dataset.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\nimport os\nimport random\nimport time\nimport tqdm\nimport torch\nimport soundfile as sf\nfrom pathlib import Path\nfrom copy import d... | [
[
"torch.cat",
"torch.zeros",
"torch.load",
"torch.randperm",
"torch.utils.data.DataLoader",
"torch.multiprocessing.Pool",
"torch.utils.data.sampler.BatchSampler",
"torch.multiprocessing.set_sharing_strategy",
"torch.save"
]
] |
king4arabs/mindspore | [
"bc38590e5300588aa551355836043af0ea092a72"
] | [
"tests/st/ops/cpu/test_bias_add.py"
] | [
"# Copyright 2019 Huawei Technologies Co., Ltd\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 l... | [
[
"numpy.array",
"numpy.ones"
]
] |
paulseghers/dtu_mlops_exercises | [
"d9ecc253e6ae5a0fefe9a59d6698d4e895941af0"
] | [
"src/model.py"
] | [
"from torch import nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n# taken from https://nextjournal.com/gkoehler/pytorch-mnist\n\nclass MyAwesomeModel(nn.Module):\n def __init__(self, height=28, width=28, channels=1, classes=10, dropout=0.25):\n self.width, self.height, self.channels, se... | [
[
"torch.nn.Dropout",
"torch.nn.Dropout2d",
"torch.nn.functional.log_softmax",
"torch.nn.functional.dropout",
"torch.nn.Conv2d",
"torch.nn.Linear"
]
] |
peq10/cancer_vsd | [
"a8ad7cf6ceb20327e41c833d5e9a7ff63b49f9bd"
] | [
"vsd_cancer/make_paper_data/make_paper_figures/mda_231_figure.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jul 29 18:33:36 2021\n\n@author: peter\n\"\"\"\nfrom pathlib import Path\n\nfrom vsd_cancer.functions import cancer_functions as canf\n\nimport numpy as np\nimport pandas as pd\nimport scipy.ndimage as ndimage\nimport matplotlib.pyplot as plt\... | [
[
"scipy.ndimage.measurements.center_of_mass",
"numpy.mean",
"numpy.any",
"numpy.histogram",
"pandas.read_csv",
"numpy.arange",
"numpy.std",
"matplotlib.pyplot.subplot",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.axis",
"numpy.zeros",
"matplotlib.pyplot.figure... |
mk1123/multiagent-particle-envs | [
"17f2073c791837d7248980149167e79783772d55"
] | [
"multiagent/utils.py"
] | [
"import csv\nimport numpy as np\nimport pandas as pd\nfrom scipy.optimize import minimize\nimport os\nimport matplotlib.pyplot as plt\nfrom sklearn.preprocessing import MinMaxScaler\nimport os\n\n# data_path = os.path.join(os.getcwd(), \"baselines\", \"behavioral_sim\", \"building_data.csv\")\n# csv_path = os.path.... | [
[
"pandas.read_csv",
"numpy.maximum",
"numpy.linspace",
"numpy.clip",
"numpy.multiply",
"numpy.cos",
"numpy.ones",
"numpy.sin",
"scipy.optimize.minimize",
"numpy.mean",
"numpy.zeros"
]
] |
boost-entropy-python/0xDeCA10B | [
"fe67c97283a19b83bb5c5616705ed6ff570cdd8f"
] | [
"simulation/decai/simulation/data/simple_data_loader.py"
] | [
"from dataclasses import dataclass\nfrom logging import Logger\nfrom typing import List\n\nimport numpy as np\nfrom injector import Binder, inject, Module\n\nfrom decai.simulation.data.data_loader import DataLoader\n\n\n@inject\n@dataclass\nclass SimpleDataLoader(DataLoader):\n \"\"\"\n Load simple data for t... | [
[
"numpy.array"
]
] |
keio-smilab22/HLSM-MAT | [
"6f34a5ec9226b28c01ae47ef16fe28662ab32935"
] | [
"lgp/models/alfred/hlsm/hlsm_navigation_model.py"
] | [
"from typing import Dict\n\nimport numpy as np\nimport math\n\nimport torch\nimport torch.nn as nn\n\nfrom lgp.abcd.model import LearnableModel\nfrom lgp.ops.spatial_distr import multidim_logsoftmax\n\nfrom lgp.utils.viz import show_image\n\nfrom lgp.env.alfred.alfred_subgoal import AlfredSubgoal\n\nfrom lgp.models... | [
[
"torch.nn.NLLLoss",
"torch.max",
"torch.zeros",
"torch.cat",
"numpy.tile",
"torch.tensor",
"torch.tanh",
"torch.nn.Linear",
"torch.exp",
"torch.nn.LeakyReLU"
]
] |
sintech/python_wizard | [
"397cac3abc2b74bc20a0ca202e3df0d990730dd4"
] | [
"pywizard/HammingWindow.py"
] | [
"import logging\nimport scipy as sp\n\nclass HammingWindow(object):\n _windows = {}\n\n @classmethod\n def processBuffer(cls, buf):\n l = len(buf)\n if l not in cls._windows:\n logging.debug(\"HammingWindow: Generate window for len {}\".format(l))\n cls._windows[l] = [ ... | [
[
"scipy.cos"
]
] |
AssistiveRoboticsUNH/hierarchical_learner | [
"6375f69c7fc6f3f7dc78be9cb4d3c172436966f0"
] | [
"feature_ranking/run_classification.py"
] | [
"import torch\nimport os\nimport numpy as np\nimport pandas as pd\n\nfrom datasets.utils import create_dataloader\n\n\ndef train(lfd_params, model, verbose=False, input_dtype=\"video\"):\n\n # Create DataLoaders\n assert input_dtype in [\"video\", \"iad\", \"gcn\"], \"ERROR: run_videos.py: input_dtype must be... | [
[
"torch.optim.Adam",
"torch.nn.CrossEntropyLoss",
"matplotlib.pyplot.tight_layout",
"numpy.savez",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"torch.nn.DataParallel",
"torch.autograd.dete... |
GabrielMissael/solution | [
"aff33732d04efedb60c1ebc70fd5108ae5cc558e"
] | [
"solution/ml/sentiment.py"
] | [
"import pandas as pd\nimport re\nimport emoji\nfrom googletrans import Translator, constants\nfrom vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\n\ndef deEmojify(text):\n return emoji.get_emoji_regexp().sub(r'', text)\n\ndef AddSentimentAnalysis(tweet_df_route:str):\n df = pd.read_pickle(twe... | [
[
"pandas.read_pickle"
]
] |
selinabitting/compas_view2 | [
"cac8abaf8fbde13ceabe35324be92779ea2e535f"
] | [
"src/compas_view2/objects/object.py"
] | [
"import abc\nfrom compas.geometry import Transformation\nfrom compas.geometry import Translation\nfrom compas.geometry import Rotation\nfrom compas.geometry import Scale\nfrom compas.geometry import decompose_matrix\nfrom compas.geometry import identity_matrix\n\nimport numpy as np\n\n\nABC = abc.ABCMeta('ABC', (ob... | [
[
"numpy.array"
]
] |
AurimasGr/com_exoselfie | [
"8bf2336c2578aa658c933df49a85a7f2b3f1e567"
] | [
"app/utils/hack_index.py"
] | [
"import pandas as pd\n\nimport numpy as np\nimport openpyxl\nimport pandas as pd\nfrom scipy.optimize import curve_fit\nimport cv2\nimport codecs\nimport os, shutil\n\n\n# from transforms import RGBTransform\n\ndef exp(dT, a, b, c):\n return a * np.exp(-b * dT) + c\n\n\n## Calculate physical parameters\n\ndef ge... | [
[
"numpy.log",
"pandas.read_excel",
"numpy.sqrt",
"numpy.einsum",
"numpy.asarray",
"pandas.DataFrame",
"numpy.max",
"numpy.exp"
]
] |
sholderbach/pandasbikeshed | [
"56780195718a18b808231a9eb5f1d4a95f7a2c0a"
] | [
"pandasbikeshed/cli_tools/clip2tex.py"
] | [
"import pandas as pd\nimport argparse\n\ndef run(filename=None, escape=False, print_it=True):\n try:\n df = pd.read_clipboard(sep='\\t')\n except:\n print('Could not read from clipboard. Make sure your clipboard contains tab separated data!')\n return 1\n df = df.replace(pd.np.nan, '')... | [
[
"pandas.read_clipboard"
]
] |
papaemmelab/cnvkit | [
"c3695209f2c39c07174839e7767757cce9dfd0e7"
] | [
"cnvlib/scatter.py"
] | [
"\"\"\"The 'scatter' command for rendering copy number as scatter plots.\"\"\"\nimport collections\nimport logging\n\nimport numpy as np\nfrom matplotlib import pyplot\nimport matplotlib.patches as mpatches\nfrom skgenome.rangelabel import unpack_range\n\nfrom . import core, params, plots\nfrom .plots import MB\nfr... | [
[
"matplotlib.patches.Patch",
"numpy.median",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.GridSpec"
]
] |
Treadco/cannon_bowel | [
"8750bde0dc3c65b4a3e95fc8071f06dd496eade3"
] | [
"fuzzy.py"
] | [
"#!/usr/bin/python\n# this defaults to python 2 on my machine\n# (c) 2017 Treadco software.\n#\n# python version of the fuzzy rbm\n# supports the non-fuzzy version.\n#\n# \nlicense =''' \nCopyright (c) 2017 Treadco LLC, Amelia Treader, Robert W Harrison\n\nPermission is hereby granted, free of charge, to any perso... | [
[
"numpy.dot",
"numpy.argmax",
"numpy.zeros"
]
] |
AhmedFakhry47/You-Only-Look-Faster--Object-Detection-Deep-Learning-Model- | [
"f6435aec492f82f2cea11ca569326ce715efef38"
] | [
"Yolf.py"
] | [
"from __future__ import division\nimport yolfnets as nets\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\nfrom IPython.display import clear_output\nimport random\nimport cv2\nfrom copy import copy, deepcopy\nfrom pathlib import Path\nimport os\nimport time \nfrom datetime... | [
[
"tensorflow.Variable",
"tensorflow.cast",
"tensorflow.placeholder",
"tensorflow.trainable_variables",
"tensorflow.global_variables_initializer",
"tensorflow.math.divide",
"tensorflow.Session",
"tensorflow.train.AdamOptimizer",
"tensorflow.train.Saver"
]
] |
Waztom/fragalysis-backend | [
"1d7775740bc6d4cce3a846064fd57bb0fcdb8269"
] | [
"car/api.py"
] | [
"from rest_framework import viewsets\nfrom rest_framework.decorators import action\nfrom django.http import JsonResponse\nfrom django.core.files.base import ContentFile\nfrom django.conf import settings\nimport os\nimport json\nfrom celery.result import AsyncResult\nfrom viewer.tasks import check_services\nimport p... | [
[
"pandas.read_csv"
]
] |
kdheepak/carsons | [
"6919cd5be416a58f14c1d5d933a52905a6d5f6a6"
] | [
"carsons/carsons.py"
] | [
"from numpy import pi as π\n\nfrom numpy import zeros\nfrom numpy.linalg import inv\nfrom numpy import sqrt\nfrom numpy import log\nfrom numpy import cos\nfrom numpy import sin\nfrom numpy import arctan\nfrom itertools import islice\n\n\ndef convert_geometric_model(geometric_model):\n carsons_model = CarsonsEqua... | [
[
"numpy.log",
"numpy.sqrt",
"numpy.arctan",
"numpy.linalg.inv",
"numpy.cos",
"numpy.sin",
"numpy.zeros"
]
] |
maxwellzh/Torch-gather | [
"1e47e4d9dcb5a0039bbff12b8f8ce78431ad5322"
] | [
"test/test_cat.py"
] | [
"\nfrom gather._C import gather_cat_forward, gather_cat_backward\nfrom gather import cat as gathercat\nimport torch\nimport time\n\n\ndef vis(msg: str, L: int = 40):\n if len(msg) >= L:\n print(msg)\n else:\n pad_l = (L-len(msg))//2\n pad_r = (L-len(msg)) - pad_l\n print(\"{} {} {}... | [
[
"torch.randn_like",
"torch.all",
"torch.abs",
"torch.randint",
"torch.manual_seed",
"torch.cuda.amp.autocast",
"torch.no_grad",
"torch.autograd.gradcheck",
"torch.logical_not"
]
] |
olaals/end-to-end-RGB-pose-estimation-baseline | [
"c26151587657d7d496bb2c3ab47bb4549c0e83e6"
] | [
"models/perceiver.py"
] | [
"import torch\nfrom perceiver_pytorch import Perceiver as PerceiverTorch\nimport torch.nn as nn\n\n\nclass Perceiver(nn.Module):\n def __init__(self, input_channels, num_outputs):\n super(Perceiver, self).__init__()\n self.perceiver = PerceiverTorch(\n input_channels = input_channels... | [
[
"torch.randn"
]
] |
sourcery-ai-bot/semantic-kitti-api | [
"fb4088b9bdf58db0603409c4dcd0a796c020159d"
] | [
"evaluate_semantics_by_distance.py"
] | [
"#!/usr/bin/env python3\n# This file is covered by the LICENSE file in the root of this project.\n\nimport argparse\nimport os\nimport yaml\nimport sys\nimport numpy as np\n\nDISTANCES = [(1e-8, 10.0), (10.0, 20.0), (20.0, 30.0), (30.0, 40.0), (40.0, 50.0)]\n\n# possible splits\nsplits = [\"train\", \"valid\", \"te... | [
[
"numpy.fromfile",
"numpy.zeros",
"numpy.linalg.norm",
"numpy.logical_and"
]
] |
Merck/BioPhi-2021-publication | [
"988a34f4c482321105151fb626ffea6d5e136862"
] | [
"bin/humanness_z_score.py"
] | [
"#!/usr/bin/env python\n\nimport argparse\nimport pandas as pd\nfrom Bio import SeqIO\nimport os\nimport numpy as np\nfrom collections import OrderedDict\nfrom tqdm import tqdm\nfrom abnumber import Chain\nimport re\nimport requests\nimport time\n\nSCORE_REGEX = re.compile('<h3>The Z-score value of the Query sequen... | [
[
"pandas.DataFrame"
]
] |
Femi-Tofade/Visualization_Package | [
"9056e1c0d44962a3b519f4d260ba38d85c58b413"
] | [
"visualization_code.py"
] | [
"import matplotlib.pyplot as plt\nimport math\n\nclass VisualizationCode:\n def __init__(self):\n \"\"\"\n Class to create different well labelled visualizations such as line plots, and bar charts based off matplotlib\n \n \"\"\"\n \n x = []\n y = []\n \n ... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
Things-School/amazon-sagemaker-predictive-maintenance-deployed-at-edge | [
"d4849f7e01a9f5b4d6a4b6eaee7e4e27a50eec85"
] | [
"predictlambda_v2.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 18 22:24:45 2019\n@author: stenatu\n\nUpdated on Thu Nov 5 13:19:12 2020 IST\n@author: sufiankaki\n\n# Edit this lambda function which invokes your trained XgBoost Model deployed\n# on the Greengrass Core to make predictions whenever new s... | [
[
"numpy.array"
]
] |
gordominossi/EDOs | [
"151ac38ed6b269755740b56e990032bcb572f11a"
] | [
"Entrega/2.4 - Runge-Kutta4.py"
] | [
"#EP2 - MAP3122 - Métodos Numéricos e Aplicações\n\n########### Exercício 2.4 ##############\n########## Resolução por RK4 ###########\n\n# Nome: Gabriel Moreira Minossi | NUSP: 9349346\n# Nome: Vinicius Bueno de Moraes | NUSP: 10256432\n\nimport numpy as np #Import de Bibliotecas\nimport math\nimport matplotlib.... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"... |
chasebk/code_TWO_ELM | [
"c5145fa50175e63e467b7aa134065398235f8e5a"
] | [
"drafts/draw/draw_spider_chart_final2.py"
] | [
"import pandas as pd\nfrom math import pi\nimport matplotlib.pyplot as plt\n\n\ncolors = [\"teal\", \"red\", \"green\", \"blue\", \"orange\", \"yellow\"]\ntitles = [\"MLNN\",\"ELM\", \"GA-ELM\", \"PSO-ELM\", \"TWO-ELM\", \"OTWO-ELM\"]\n\n#Create a data frame from Messi and Ronaldo's 6 Ultimate Team data points from... | [
[
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show"
]
] |
Mynasino/DigitRecognizer | [
"a06e50e297a39c4ff626e4a5de00f781d9109592"
] | [
"DigitRecognizer/Trainer.py"
] | [
"import tensorflow as tf \r\nimport numpy as np \r\nimport DataLoader\r\n\r\nclass tf_trainer(object):\r\n def __init__(self):\r\n self.sess = tf.Session()\r\n self.sess.run(tf.global_variables_initializer())\r\n self.DataLoad = DataLoader.DataLoad()\r\n\r\n def train(self, graph, n_epoch... | [
[
"tensorflow.global_variables_initializer",
"numpy.arange",
"tensorflow.Session"
]
] |
HKUNLP/UnifiedSKG | [
"49a2ff950bb312b980c22ad72b11520db72ab6a3"
] | [
"models/adapter/adapter.py"
] | [
"import math\r\n\r\nimport torch\r\nfrom torch import nn\r\n\r\n\r\nclass Activation_Function_Class(nn.Module):\r\n \"\"\"\r\n Implementation of various activation function.\r\n \"\"\"\r\n\r\n def __init__(self, hidden_act):\r\n\r\n if hidden_act.lower() == \"relu\":\r\n self.f = nn.fu... | [
[
"torch.nn.Sequential",
"torch.sigmoid",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.pow"
]
] |
jrodrigopuca/procesamiento-img | [
"52078b80e88b548f4d034cc931deb711f4d0edbb"
] | [
"script/procesador.py"
] | [
"import numpy as np\nfrom scipy import ndimage\nimport cv2 as cv\nimport sys, os\nimport matplotlib.pyplot as plt\n\n#Lista de algunos kernels que andan por ahí\n\nkernelBlur =[[1.0/9,1.0/9,1.0/9],\n\t\t\t[1.0/9,1.0/9,1.0/9],\n\t\t\t[1.0/9,1.0/9,1.0/9]]\n\nkernelGaussianBlur =[[1.0/16,2.0/16,1.0/16],\n\t\t\t\t\t[2.... | [
[
"matplotlib.pyplot.imshow",
"numpy.amax",
"numpy.amin",
"scipy.ndimage.median_filter",
"scipy.ndimage.convolve",
"numpy.random.random_sample",
"numpy.random.normal",
"numpy.random.rayleigh",
"numpy.hypot",
"numpy.empty"
]
] |
RiteshMaheshwari/naarad | [
"401ae683e38900e94898b15ab64d4410a556956c"
] | [
"src/naarad/metrics/jmeter_metric.py"
] | [
"# coding=utf-8\n\"\"\"\n© 2013 LinkedIn Corp. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable... | [
[
"numpy.round_"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.