repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
jamiechang917/SnakeAI | [
"dae1b8f86bd529eafbaab8fa981a83e3a9f55bde"
] | [
"one_hidden_layer/GeneticAlgorithm/crossover.py"
] | [
"'''\r\nGeneticAlgorithm-Crossover\r\n@Author: JamieChang\r\n@Date: 2020/05/27\r\n'''\r\nimport numpy as np\r\nfrom typing import Tuple\r\n\r\ndef single_point_crossover(chormosome1:np.ndarray,chormosome2:np.ndarray) -> Tuple[np.ndarray,np.ndarray]: # chormosomes should be 1 dimension array\r\n if chormosome1.nd... | [
[
"numpy.concatenate",
"numpy.empty",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.random.random"
]
] |
yingzha/pylearn2 | [
"9132584e906d4af0f0255a9d7e6bc160fbe11e65"
] | [
"pylearn2/datasets/preprocessing.py"
] | [
"\"\"\"\nFunctionality for preprocessing Datasets.\n\"\"\"\n\n__authors__ = \"Ian Goodfellow, David Warde-Farley, Guillaume Desjardins, \" \\\n \"and Mehdi Mirza\"\n__copyright__ = \"Copyright 2010-2012, Universite de Montreal\"\n__credits__ = [\"Ian Goodfellow\", \"David Warde-Farley\", \"Guillaume De... | [
[
"numpy.dot",
"numpy.asarray",
"numpy.zeros",
"scipy.linalg.eigh",
"numpy.float",
"numpy.sum",
"numpy.load",
"numpy.exp",
"numpy.mean",
"numpy.diff",
"numpy.where",
"numpy.savez",
"scipy.sparse.identity",
"numpy.transpose",
"numpy.sqrt",
"numpy.repeat... |
ShahiraAbousamra/mihc_analysis_dp_paper | [
"cea39fb57485861688cb827acd91627a5548f4c4"
] | [
"src_postprocess/seg_argmax_sup_unet.py"
] | [
"import os\r\nimport numpy as np\r\nfrom skimage import io;\r\nimport glob;\r\n#from skimage.draw import circle_perimeter\r\n#from skimage.measure import label, find_contours\r\nimport cv2 ; #############\r\n#import scipy;\r\nimport sys;\r\nfrom scipy.misc import imresize\r\nfrom scipy.ndimage.filters import convol... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.log",
"numpy.zeros",
"numpy.ones",
"numpy.exp",
"numpy.where",
"numpy.stack",
"numpy.expand_dims"
]
] |
jesbu1/gym-minigrid | [
"fd799f90bcd88d5418dcb074140e65862d44f064"
] | [
"gym_minigrid/window.py"
] | [
"import sys\nimport numpy as np\n\n# Only ask users to install matplotlib if they actually need it\ntry:\n import matplotlib.pyplot as plt\nexcept:\n print('To display the environment in a window, please install matplotlib, eg:')\n print('pip3 install --user matplotlib')\n sys.exit(-1)\n\nclass Window:\... | [
[
"matplotlib.pyplot.ion",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.show"
]
] |
kl2792/ignite | [
"ffe9b6e25822aaeb15932e68ff294ccc6f5b0697"
] | [
"examples/mnist/mnist.py"
] | [
"from __future__ import print_function\nfrom argparse import ArgumentParser\n\nfrom torch import nn\nfrom torch.optim import SGD\nfrom torch.utils.data import DataLoader\nimport torch\nimport torch.nn.functional as F\nfrom torchvision.transforms import Compose, ToTensor, Normalize\nfrom torchvision.datasets import ... | [
[
"torch.nn.Linear",
"torch.nn.functional.dropout",
"torch.nn.functional.log_softmax",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.nn.Dropout2d"
]
] |
Data-Only-Greater/SNL-Delft3D-CEC-Verify | [
"3aaab93b8fab6e3b6710b68d181b9946ae3ab74a"
] | [
"tests/test_result_edges.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport warnings\n\nimport pandas as pd\nimport pytest\nfrom shapely.geometry import LineString\n\nwith warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n import geopandas as gpd\n\nfrom snl_d3d_cec_verify.result.edges import _map_to_edge... | [
[
"pandas.Timestamp"
]
] |
cuhk-eda/neural-ilt | [
"7ba7b219e5f934672772f7820d7b3d733965933d"
] | [
"utils/ilt_utils.py"
] | [
"import lithosim.lithosim_cuda as litho\nfrom utils.epe_checker import get_epe_checkpoints\nimport torch, torchvision\nimport numpy as np\nimport os \nfrom PIL import Image\n\n\ndef sigmoid_ilt_z(intensity_map, theta_z=50, threhold_z=0.225):\n sigmoid_layer = torch.nn.Sigmoid()\n intensity_map = (intensity_ma... | [
[
"torch.zeros",
"torch.nn.Sigmoid",
"torch.nn.AvgPool2d",
"torch.nn.functional.interpolate",
"torch.flip"
]
] |
jbscoggi/deepxde | [
"41611fe491c33d94a46c2dc9074707183c71fc38"
] | [
"deepxde/model.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport pickle\nfrom collections import OrderedDict\n\nimport numpy as np\n\nfrom . import display\nfrom . import losses as losses_module\nfrom . import metrics as metrics_module\nfrom . import train as... | [
[
"numpy.std",
"numpy.hstack",
"numpy.sum",
"numpy.mean"
]
] |
AlanJiang98/NeRFPersonal | [
"abf0273b701af9b59a83d8e2033d7a5774a2a83a"
] | [
"run_nerf_helpers.py"
] | [
"import torch\ntorch.autograd.set_detect_anomaly(True)\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\n# Misc\nimg2mse = lambda x, y : torch.mean((x - y) ** 2)\nmse2psnr = lambda x : -10. * torch.log(x) / torch.log(torch.Tensor([10.]))\nto8b = lambda x : (255*np.clip(x,0,1)).astype(np... | [
[
"torch.nn.Linear",
"torch.cat",
"numpy.ones_like",
"torch.stack",
"numpy.random.rand",
"torch.randperm",
"numpy.tile",
"numpy.broadcast_to",
"torch.sum",
"numpy.concatenate",
"torch.searchsorted",
"numpy.arange",
"numpy.transpose",
"torch.zeros_like",
"t... |
Adam1679/vnpy_adam | [
"91e384c9372ee36689d9bb600fe7f45fbb68976e"
] | [
"examples/CtaBacktesting/ctaBacktestingDollar.py"
] | [
"# encoding: UTF-8\n\n'''\n本文件中包含的是CTA模块的回测引擎,回测引擎的API和CTA引擎一致,\n可以使用和实盘相同的代码进行回测。\n'''\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom datetime import datetime, timedelta\nfrom collections import OrderedDict\nfrom itertools import product\nimport multiprocessing\nimport pymongo\n\nf... | [
[
"numpy.array",
"numpy.int"
]
] |
LukasHedegaard/ride | [
"31f707c628205ccd3b7b20043130172ad41f172d"
] | [
"ride/feature_visualisation.py"
] | [
"from operator import attrgetter\nfrom pathlib import Path\nfrom typing import List\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nimport torch\n\nfrom ride.core import Configs, RideClassificationDataset\nfrom ride.feature_extraction import FeatureExtractable\nfrom ride.logging impor... | [
[
"numpy.array",
"matplotlib.pyplot.legend",
"sklearn.manifold.TSNE",
"numpy.save",
"matplotlib.pyplot.figure",
"numpy.stack",
"numpy.prod",
"matplotlib.pyplot.tight_layout",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.axis"
]
] |
arnabgho/classifying-pix2pix | [
"3083203589abdb42017f722115bf73ba68a6441d"
] | [
"scripts/combine_A_and_B.py"
] | [
"from pdb import set_trace as st\nimport os\nimport numpy as np\nimport cv2\nimport argparse\n\nparser = argparse.ArgumentParser('create image pairs')\nparser.add_argument('--fold_A', dest='fold_A', help='input directory for image A', type=str, default='../dataset/50kshoes_edges')\nparser.add_argument('--fold_B', d... | [
[
"numpy.concatenate"
]
] |
TAEYOUNG-SYG/OpenNMT-py | [
"bdb1fe2ca78aa374109d989eed401ade878f8abe"
] | [
"onmt/inputters/audio_dataset.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n AudioDataset\n\"\"\"\nimport codecs\nimport os\n\nimport torch\nimport torchtext\n\nfrom onmt.inputters.dataset_base import DatasetBase, PAD_WORD, BOS_WORD, \\\n EOS_WORD\n\n\nclass AudioDataset(DatasetBase):\n \"\"\" Dataset for data_type=='audio'\n\n Build `Examp... | [
[
"torch.FloatTensor",
"numpy.log1p"
]
] |
MelonDLI/ATSPrivacy | [
"2cf4bd67c9c0c69092b63dcdc3d06b33acf32812"
] | [
"benchmark/cifar100_train.py"
] | [
"import os, sys\nsys.path.insert(0, './')\nimport torch\nimport torchvision\nseed=23333\ntorch.manual_seed(seed)\ntorch.cuda.manual_seed(seed)\nimport random\nrandom.seed(seed)\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom collections import defaultdict\nfrom PIL import Image\nimport inversefed\nimpo... | [
[
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.load"
]
] |
Amoza-Theodore/Baidu2020 | [
"6871bafe9a4b287ba23b31ce957aef5f3be6bcd5"
] | [
"nn/reader.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\nimport random\nfrom multiprocessing import cpu_count\nimport numpy as np\nimport paddle\nfrom PIL import Image\nimport cv2 as cv\n\n# 训练图片的预处理\ndef train_mapper(sample):\n img_path, label, crop_size, resize_size = sample\n try:\n img = Image.open(img_path)\n ... | [
[
"numpy.array",
"numpy.random.shuffle"
]
] |
Build-Week-Med-Cabinet-2-MP/bw-med-cabinet-2-de | [
"ccc7b3463147dd6c39a73dcd4388ccb59615942d"
] | [
"web_app/ml_models/StrainRecommendation.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn.neighbors import NearestNeighbors\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.decomposition import PCA\n\nURL = \"https://raw.githubusercontent.com/Build-Week-Med-Cabinet-2-MP/bw-med-cabinet-2-ml/data-generation/data/CLEAN_WMS_2020_05_24.csv... | [
[
"pandas.read_csv",
"sklearn.neighbors.NearestNeighbors",
"sklearn.decomposition.PCA",
"sklearn.preprocessing.StandardScaler"
]
] |
bdilday/pythonfun | [
"a4840a1e947d8fcf00203fee07b7c5878540bec2"
] | [
"ftebb/bbnbinom.py"
] | [
"\"\"\" baseball with negative binomial distribution simulations\n\nThis code uses numerical simulations to estimate the winning percentages\nfor the three teams. The file ftebb.py does exact calculations\n\"\"\"\nimport attr\nimport sys\nimport pandas as pd\nimport numpy as np\nimport requests\nimport json\nimport... | [
[
"numpy.random.RandomState"
]
] |
blu3r4y/AdventOfCode2018 | [
"5ef6ee251f9184e0f66657d0eb8b5b129a6f93e5"
] | [
"src/day2.py"
] | [
"# Advent of Code 2018, Day 2\n# (c) blu3r4y\n\nimport numpy as np\nimport itertools\n\n\ndef part1(boxes):\n doubles, triples = 0, 0\n for box in boxes:\n # count occurrences of each char\n _, counts = np.unique(list(box), return_counts=True)\n\n # look for at least one double or triple\... | [
[
"numpy.count_nonzero"
]
] |
myungsub/meta-interpolation | [
"72dd3b2e56054bb411ed20301583a0e67d9ea293"
] | [
"dain/my_package/DepthFlowProjection/setup.py"
] | [
"#!/usr/bin/env python3\nimport os\nimport torch\n\nfrom setuptools import setup, find_packages\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\ncxx_args = ['-std=c++11']\n\nnvcc_args = [\n '-gencode', 'arch=compute_75,code=sm_75'\n #'-gencode', 'arch=compute_50,code=sm_50',\n #'-gen... | [
[
"torch.utils.cpp_extension.CUDAExtension"
]
] |
fangd123/TextBrewer | [
"866f4363d9bd964f00aa60b0db5e9252a7905448"
] | [
"examples/cmrc2018_example/modeling.py"
] | [
"import logging\nimport torch\nfrom torch import nn\nfrom torch.nn import CrossEntropyLoss, BCEWithLogitsLoss\nimport torch.nn.functional as F\nimport config as Conf\nfrom pytorch_pretrained_bert.my_modeling import BertModel, BertLayerNorm\n\n\ndef initializer_builder(std):\n _std = std\n def init_bert_weight... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.functional.log_softmax",
"torch.nn.functional.softmax",
"torch.nn.CrossEntropyLoss"
]
] |
lbakerIsazi/HMMs | [
"0353ba6a5e863fa1f9f10b97eaa316a8a34889aa"
] | [
"setup.py"
] | [
"import glob\nfrom setuptools import setup, find_packages\nfrom Cython.Build import cythonize\nimport numpy\n\n\nwith open('README') as f:\n long_description = ''.join(f.readlines())\n\n\nsetup(\n name='hmms',\n version='0.1',\n description='Discrete-time and continuous-time hidden Markov model library ... | [
[
"numpy.get_include"
]
] |
abhmul/JetsPytorchFrontend | [
"c781d5088b9717b339617471a639c74a5389edc2"
] | [
"pyjet/test_utils.py"
] | [
"from .models import SLModel\nfrom . import layers\nfrom .augmenters import Augmenter\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass ReluNet(SLModel):\n\n def __init__(self):\n super(ReluNet, self).__init__()\n self.param = nn.Linear(100, 100)\n\n def forward(se... | [
[
"torch.nn.Linear",
"torch.nn.functional.relu"
]
] |
NCAR/benchmarking | [
"57863782ef327f5d0c33594b11d01bc8ff590bf5"
] | [
"benchmarks/utils.py"
] | [
"import datetime\nimport logging\nimport os\nfrom contextlib import contextmanager\nfrom time import sleep, time\n\nimport fsspec\nimport pandas as pd\nfrom distributed import Client\nfrom distributed.utils import format_bytes\nfrom fsspec.implementations.local import LocalFileSystem\n\nfrom . import __version__\nf... | [
[
"pandas.DataFrame"
]
] |
olgabot/pandas | [
"ceec8bf305fbd0258edb66c648b87219a435bc32"
] | [
"pandas/computation/expressions.py"
] | [
"\"\"\"\nExpressions\n-----------\n\nOffer fast expression evaluation through numexpr\n\n\"\"\"\n\nimport numpy as np\nfrom pandas.core.common import _values_from_object\n\ntry:\n import numexpr as ne\n _NUMEXPR_INSTALLED = True\nexcept ImportError: # pragma: no cover\n _NUMEXPR_INSTALLED = False\n\n_TEST... | [
[
"numpy.prod",
"pandas.core.common._values_from_object"
]
] |
zhaoyang97/mmdetection | [
"93ce0e7b735ad1ed2e7d856ef80e3aa598cb47e5"
] | [
"mmdet/models/necks/icarafe_3.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\n\nclass ConvBNReLU(nn.Module):\n '''Module for the Conv-BN-ReLU tuple.'''\n\n def __init__(self, c_in, c_out, kernel_size, stride, padding, dilation,\n use_relu=True):\n super(ConvBNReLU, self).__init__()\n ... | [
[
"torch.nn.Unfold",
"torch.einsum",
"torch.nn.BatchNorm2d",
"torch.nn.PixelShuffle",
"torch.nn.Upsample",
"torch.nn.Conv2d",
"torch.nn.ReLU",
"torch.nn.functional.softmax",
"torch.Tensor"
]
] |
sedrickkeh/COCON_ICLR2021 | [
"216f60f45147f9972669efaa02cae6ad8b5fea3d"
] | [
"transformers/pipelines.py"
] | [
"# coding=utf-8\n# Copyright 2018 The HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"numpy.array",
"torch.no_grad",
"numpy.exp",
"numpy.triu",
"numpy.unravel_index",
"torch.cuda.set_device",
"numpy.where",
"numpy.argmax",
"torch.tensor",
"numpy.argsort",
"numpy.argpartition",
"numpy.expand_dims"
]
] |
KamalShrest/Customer-Churn-Prediction | [
"0598c527af1d970bf62b87e4036ba885d671a05f"
] | [
"churnprediction/utils/generate_roc.py"
] | [
"import os\n\nimport matplotlib.pyplot as plt\nfrom sklearn import metrics\n\nfrom churnprediction.config import config\n\n\ndef generate_roc(test_y, prediction, model_name):\n fpr, tpr, _ = metrics.roc_curve(test_y, prediction)\n auc = metrics.roc_auc_score(test_y, prediction)\n plt.plot(fpr, tpr, label=\... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.roc_curve"
]
] |
andy-sweet/napari-plugin-accelerator | [
"e5f55bcf42f6890fc0b6ae1005bf171df1cc9def"
] | [
"src/napari_plugin_accelerator/_widget.py"
] | [
"from enum import auto\nimport pandas as pd\nfrom qtpy.QtWidgets import QWidget, QTableWidget, QTableWidgetItem, QVBoxLayout\nfrom napari import Viewer\nfrom napari.layers import Image, Labels, Layer\nfrom napari.types import ImageData\nfrom napari.utils.misc import StringEnum\nfrom npe2.types import FullLayerData\... | [
[
"pandas.DataFrame"
]
] |
an-dhyun/fcaf3d_temp | [
"84c80cf5002745b7ed36a9a549f6670076415430"
] | [
"mmdet3d/core/evaluation/indoor_eval.py"
] | [
"import numpy as np\nimport torch\nfrom mmcv.utils import print_log\nfrom terminaltables import AsciiTable\n\n\ndef average_precision(recalls, precisions, mode='area'):\n \"\"\"Calculate average precision (for single or multiple scales).\n\n Args:\n recalls (np.ndarray): Recalls with shape of (num_scal... | [
[
"torch.zeros",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.mean",
"numpy.where",
"numpy.finfo",
"numpy.arange",
"numpy.argsort",
"numpy.cumsum",
"numpy.hstack",
"numpy.maximum"
]
] |
shrey-bansal/ABINBEV | [
"09d0eaca6e7edf1820aa79b88a56d1ed39b6300f"
] | [
"backend/CRNNModel/data_provider/data_provider.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 17-9-22 下午1:39\n# @Author : Luo Yao\n# @Site : http://github.com/TJCVRS\n# @File : data_provider.py\n# @IDE: PyCharm Community Edition\n\"\"\"\nProvide the training and testing data for shadow net\n\"\"\"\nimport os.path as ops\nimport numpy as np... | [
[
"numpy.array"
]
] |
daviddmc/Deform2Self | [
"478b325aea1f37d570231ebd3c647ec73f505f62"
] | [
"utils.py"
] | [
"import torch\nimport numpy as np\n\nnoise_g = np.random.RandomState(233)\n\ndef add_gaussian_noise(img, sigma): # img [0,1]\n #noise = torch.zeros_like(img)\n if sigma > 0:\n noise = noise_g.randn(*img.shape) * (sigma / 255.)\n noise = torch.tensor(noise, dtype=img.dtype, device=img.device)\n ... | [
[
"torch.sqrt",
"torch.stack",
"numpy.random.RandomState",
"torch.tensor",
"numpy.clip",
"torch.zeros_like",
"torch.fft"
]
] |
hukuda222/Chat-Yojo-Bot | [
"b431506ae85335f1b6fe7fe35074594dcd8fa6ca"
] | [
"src/w2v/word_2_vec.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nImplemention of skip-gram model and continuous-bow model.\n\"\"\"\n\nimport argparse\nimport collections\nimport time\nimport numpy as np\nimport six\n\nimport chainer\nfrom chainer import cuda\nimport chainer.functions as F\nimport chainer.initializers as I\nimport chainer.links as ... | [
[
"numpy.array",
"numpy.random.randint",
"numpy.random.shuffle",
"numpy.arange"
]
] |
hiroooo1997/youtube_livechat_replay_crawler | [
"94386f70981a451b6d7eae87880af5ad5eb0675d"
] | [
"channel_video_list/main.py"
] | [
"from flask import escape\nfrom apiclient.discovery import build\nfrom dotenv import load_dotenv\nimport platform\nimport json\nimport sys\nimport os\nimport numpy\nimport math\nfrom unittest.mock import Mock\nfrom oauth2client.client import GoogleCredentials\nfrom httplib2 import Http\nfrom datetime import datetim... | [
[
"numpy.array_split"
]
] |
krdav/MaxSnippetModel | [
"a083a98abedcd4ea3f0014a2635e7ee4f3337828"
] | [
"dataplumbing_synthetic_data.py"
] | [
"#########################################################################################\r\n# Author: Jared L. Ostmeyer\r\n# Date Started: 2016-07-26\r\n# Environment: Python3\r\n# License: See LICENSE\r\n# Purpose: Generate synthetic dataset and create interfaces for piping the data to the model.\r\n# Note: Over... | [
[
"numpy.zeros"
]
] |
xsqiii/albert-text-classification | [
"d21aeb6137128ecab4211ce74b3ddde755dd9523"
] | [
"tokenization.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.io.gfile.GFile"
]
] |
agile-geoscience/jeep | [
"87aa1a89e3248a941d2519817ee95581c0defa27"
] | [
"tests/test_model.py"
] | [
"# -*- coding: utf 8 -*-\n\"\"\"\nDefine a suite a tests for jeepr.\n\"\"\"\nimport numpy as np\n\nfrom jeepr import Model\nfrom jeepr import utils\n\n\ndef test_vti():\n \"\"\"\n Test loading from VTI.\n \"\"\"\n model = Model.from_gprMax_vti('tests/Cylinder_halfspace.vti')\n assert model.shape == (... | [
[
"numpy.allclose",
"numpy.ones",
"numpy.sqrt"
]
] |
gupta-shivam/Single-Image-Haze-Removal-Using-CGANs | [
"9f5ba6d313c47ab5801906e09920cd5ba373dbbc"
] | [
"inference.py"
] | [
"\"\"\"Translate an image to another image\nAn example of command-line usage is:\npython export_graph.py --model pretrained/apple2orange.pb \\\n --input input_sample.jpg \\\n --output output_sample.jpg \\\n --image_size 256\n\"\"\"\n\nimport tensorfl... | [
[
"tensorflow.flags.DEFINE_string",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.GraphDef",
"tensorflow.flags.DEFINE_integer",
"tensorflow.gfile.FastGFile",
"tensorflow.app.run",
"tensorflow.image.resize_images",
"tensorflow.image.decod... |
nivnac/improver | [
"a5c31be3430df429ae38e7c16e267fcbc2af1858",
"a5c31be3430df429ae38e7c16e267fcbc2af1858"
] | [
"improver_tests/standardise/test_grid_contains_cutout.py",
"improver_tests/ensemble_copula_coupling/test_utilities.py"
] | [
"# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# (C) British Crown Copyright 2017-2020 Met Office.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following c... | [
[
"numpy.ones",
"numpy.zeros"
],
[
"numpy.array",
"numpy.ones",
"numpy.sort",
"numpy.linspace"
]
] |
uibcdf/MolModMTs | [
"4f6b6f671a9fa3e73008d1e9c48686d5f20a6573"
] | [
"molsysmt/item/mdtraj_HDF5TrajectoryFile/get.py"
] | [
"#######################################################################################\n########### THE FOLLOWING LINES NEED TO BE CUSTOMIZED FOR EVERY CLASS ################\n#######################################################################################\n\nfrom molsysmt._private.execfile import execfil... | [
[
"numpy.concatenate"
]
] |
Cgadal/sphinx-gallery-test | [
"63d41260936349d4d2843b0c78d06d10ec2d0711"
] | [
"Examples/example2.py"
] | [
"\"\"\"\n============\nExample 2\n============\n\ntest\n\n\"\"\"\n\nimport numpy as np\nimport sys\nsys.path.append('../')\nfrom mytoolbox.submodule.module1 import my_scatter\n\nx, y = np.random.random((100,)), np.random.random((100,))\n\nmy_scatter(x, y)\n"
] | [
[
"numpy.random.random"
]
] |
arfon/starry_process | [
"72b2a540e7e4fdb2e6af61507efa1c9861d5c919"
] | [
"joss/figures/stability.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom starry_process import StarryProcess, gauss2beta\nimport theano\nimport theano.tensor as tt\nfrom tqdm import tqdm\nimport os\n\n# Compile the function to get the covariance matrix\nr = tt.dscalar()\na = tt.dscalar()\nb = tt.dscalar()\nc = tt.dscalar()\nn = ... | [
[
"numpy.random.seed",
"matplotlib.pyplot.subplots",
"numpy.linalg.cond",
"numpy.random.uniform",
"numpy.arange",
"numpy.random.random"
]
] |
DStelter94/ARLinBfW | [
"fb14f13bdab4d19ba8d27ae26f1c64930e219d61",
"fb14f13bdab4d19ba8d27ae26f1c64930e219d61"
] | [
"PythonController/01_double_dqn/lib/dqn_model.py",
"PythonController/02_rainbow_dqn/play_multiplayer.py"
] | [
"import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport numpy as np\n\n\nclass DQN(nn.Module):\n def __init__(self, input_shape, n_actions):\n super(DQN, self).__init__()\n\n self.conv = nn.Sequential(\n nn.Conv2d(input_shape[0], 32, kernel_size=4, st... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.zeros"
],
[
"torch.device",
"torch.load",
"numpy.random.random"
]
] |
thomeou/General-network-architecture-for-sound-event-localization-and-detection | [
"03b3aaccf3c87dd8fb857960e765ae768ad36625"
] | [
"experiments/train.py"
] | [
"import fire\nimport logging\nimport os\n\nimport pytorch_lightning as pl\nimport torch\nfrom pytorch_lightning.callbacks import ModelCheckpoint\nfrom pytorch_lightning.loggers import TensorBoardLogger\n\n# from models.rfcx import Rfcx\nfrom utilities.builder_utils import build_database, build_datamodule, build_mod... | [
[
"torch.cuda.device_count"
]
] |
vimalmanohar/pb_chime5 | [
"8e2589d9c3311002e63c354706cf87c1d56cbf1a"
] | [
"pb_chime5/database/chime5/database.py"
] | [
"\nimport numpy as np\nfrom pb_chime5.database import JsonDatabase\nfrom pb_chime5.database import keys as K\n\nfrom pb_chime5.database.iterator import AudioReader\nfrom pb_chime5.io import load_audio\nfrom pb_chime5 import git_root\nfrom pb_chime5.utils.numpy_utils import segment_axis_v2\nfrom pb_chime5.utils.nump... | [
[
"numpy.pad",
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.min",
"numpy.broadcast_to"
]
] |
amadavan/PhasorPy | [
"01e69c7ca6f0bf65a5c31e98557b1c945511d618"
] | [
"phasor/network.py"
] | [
"import pkg_resources\nimport re\nimport requests\n\nimport numpy as np\nimport scipy as sp\nimport scipy.sparse\nimport scipy.sparse.linalg\n\nfrom . import index\n\n__all__ = ['PowerNetwork', 'load_case']\n\n\nclass PowerNetwork:\n def __init__(self, basemva, bus=None, gen=None, gencost=None, branch=None, peru... | [
[
"numpy.concatenate",
"numpy.divide",
"numpy.max",
"scipy.sparse.csc_matrix",
"numpy.sum",
"numpy.ones",
"numpy.multiply",
"numpy.where",
"numpy.arange",
"numpy.all"
]
] |
rursvd/pynumerical2 | [
"4b2d33125b64a39099ac8eddef885e0ea11b237d"
] | [
"5_2_3.py"
] | [
"from numpy import array\nb = array([1,2,3,4])\nC = b.reshape(2,2)\nprint('B = ',b)\nprint('C = ',C)\n"
] | [
[
"numpy.array"
]
] |
DavisTownsend/forecast | [
"9276fc2cf9946ff35f956da724706977c253151c"
] | [
"magi/utils.py"
] | [
"import pandas as pd\nimport numpy as np\n\ndef gen_ts(freq='MS',ncols=5,nrows=24,num_range=[0,10000],end_date='2018-04-01'):\n colnames = []\n for i in range(ncols):\n colnames.append('ts'+str(i))\n df = pd.DataFrame(np.random.randint(num_range[0],num_range[1],size=(nrows, ncols)), columns=colnames... | [
[
"pandas.date_range",
"numpy.random.randint"
]
] |
CharlesPikachu/CharlesFace | [
"90bfe38c58068228d0069dce43b55b2570acaa16"
] | [
"FaceClassify/datasets/LFWDataset.py"
] | [
"# Author:\n# \tCharles\n# Function:\n# \tFor test LFW dataset.\nimport os\nimport numpy as np\nimport torchvision.datasets as datasets\n\n\nclass LFWDataset(datasets.ImageFolder):\n\tdef __init__(self, dir_, pairs_path, transform=None):\n\t\tsuper(LFWDataset, self).__init__(dir_, transform)\n\t\tself.pairs_path = ... | [
[
"numpy.array"
]
] |
dali92002/DocEnTR | [
"71d321007e64a641d342667defba8a743b81c663"
] | [
"train.py"
] | [
"from typing import Any\nimport torch\nfrom vit_pytorch import ViT\nfrom models.binae import BINMODEL\nimport torchvision.transforms as transforms\nimport numpy as np\nimport torch.optim as optim\nfrom einops import rearrange\nimport loadData2 as loadData\nimport utils as utils\nfrom config import Configs\nimport ... | [
[
"numpy.array",
"torch.no_grad",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.utils.data.DataLoader"
]
] |
10thJanuary/subtype_scz | [
"29b25d6ad897d95ac108d19d9544920694466e18"
] | [
"data_process/rsfmri_process.py"
] | [
"# coding=utf-8\n\nimport os\nimport joblib\nimport CONFIG\nimport numpy as np\nimport pandas as pd\nfrom nilearn.connectome import ConnectivityMeasure\nfrom general_io import dump_obj_pkl, load_obj_pkl\n\n\ndef create_fmri_df(cached_path=os.path.join(os.path.abspath('.'), 'cached_objects'), from_cached=True):\n ... | [
[
"numpy.array",
"numpy.triu_indices",
"numpy.fill_diagonal",
"numpy.sum",
"numpy.where",
"numpy.tril_indices",
"numpy.abs",
"numpy.all",
"numpy.vstack"
]
] |
ZWJCSU/DL-project | [
"cab297255bad815d032f9c04d1192a2156090df9"
] | [
"datasets/coco.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nCOCO dataset which returns image_id for evaluation.\n\nMostly copy-paste from https://github.com/pytorch/vision/blob/13b35ff/references/detection/coco_utils.py\n\"\"\"\nfrom pathlib import Path\n\nimport torch\nimport torch.utils.data\... | [
[
"torch.zeros",
"torch.as_tensor",
"torch.stack",
"torch.tensor"
]
] |
rpatil524/pykg2vec | [
"492807b627574f95b0db9e7cb9f090c3c45a030a"
] | [
"pykg2vec/utils/criterion.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Criterion:\n \"\"\"Utility for calculating KGE losses\n\n Loss Functions in Knowledge Graph Embedding Models\n http://ceur-ws.org/Vol-2377/paper_1.pdf\n \"\"\"\n\n @staticmethod\n def pariwise_logistic(pos_preds... | [
[
"torch.nn.functional.softplus",
"torch.nn.Softmax",
"torch.nn.functional.logsigmoid",
"torch.clamp",
"torch.nn.BCEWithLogitsLoss",
"torch.zeros_like"
]
] |
z-x-yang/NS-Outpainting | [
"4e07a72bad0f84053025e129bac16d5620374f7b"
] | [
"dataset/build_dataset.py"
] | [
"import random\nimport os\nfrom glob import glob\nimport numpy as np\nfrom PIL import Image\nimport tensorflow as tf\nimport argparse\n\nparser = argparse.ArgumentParser(description='Model training.')\nparser.add_argument('--dataset-path', type=str, default='./scenery/')\nparser.add_argument('--result-path', type=s... | [
[
"tensorflow.train.Example",
"tensorflow.train.BytesList",
"tensorflow.train.Features",
"tensorflow.python_io.TFRecordWriter"
]
] |
mvcf10/cdnsim | [
"7ccab5deea416b379ffd86136a1ff2aff4c97e17"
] | [
"hl_sim.py"
] | [
"\"\"\"\n CDNSim\n\n file: hl_sim.py\n\n NEC Europe Ltd. PROPRIETARY INFORMATION\n\n This software is supplied under the terms of a license agreement\n or nondisclosure agreement with NEC Europe Ltd. and may not be\n copied or disclosed except in accordance with the terms of that\n agre... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.gca"
]
] |
jjcunningjam/socceraction | [
"20f7576bcc82e07891e485623542262410c26efd"
] | [
"socceraction/spadl/wyscout.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"Wyscout event stream data to SPADL converter.\"\"\"\r\nfrom typing import Any, Dict, List, Optional, Set\r\n\r\nimport pandas as pd # type: ignore\r\nfrom pandera.typing import DataFrame\r\n\r\nfrom . import config as spadlconfig\r\nfrom .base import (\r\n _add_dribbles,\r\n ... | [
[
"pandas.concat",
"pandas.DataFrame",
"pandas.merge",
"pandas.Series"
]
] |
kguerda-idris/POT | [
"14c30d4cfac060ff0bf8c64d4c88c77df32aad86"
] | [
"ot/optim.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nGeneric solvers for regularized OT\n\"\"\"\n\n# Author: Remi Flamary <remi.flamary@unice.fr>\n# Titouan Vayer <titouan.vayer@irisa.fr>\n#\n# License: MIT License\n\nimport numpy as np\nfrom scipy.optimize.linesearch import scalar_search_armijo\nfrom .lp import emd\nfrom .br... | [
[
"numpy.divide",
"numpy.dot",
"numpy.log",
"numpy.sum",
"numpy.atleast_1d",
"numpy.outer",
"scipy.optimize.linesearch.scalar_search_armijo"
]
] |
mathigatti/ArtificialWorldBuildingCourse | [
"881e0800dc2b02db195dc1de17996e99c59d53f5"
] | [
"lecture_1/3D/npy2blender.py"
] | [
"import bpy\nimport numpy as np\n\nwith open('data/test.npy', 'rb') as f:\n matrix_3d = np.load(f)\n\ni = 0\nfor matrix_2d in matrix_3d:\n j = 0\n for row in matrix_2d:\n k = 0\n for value in row:\n if value == 1:\n bpy.ops.mesh.primitive_cube_add(location=(i,j,k))\n... | [
[
"numpy.load"
]
] |
jeffhsu3/chumpy | [
"00e83955ea45cd129d55a3017c08f89045842224"
] | [
"chumpy/optimization_internal.py"
] | [
"import sys\nimport warnings\nimport numpy as np\nimport scipy.sparse as sp\nfrom . import ch\nfrom .ch import pif\nfrom .utils import timer, dfs_do_func_on_graph\n\n\ndef clear_cache_single(node):\n node._cache['drs'].clear()\n if hasattr(node, 'dr_cached'):\n node.dr_cached.clear()\n\ndef vstack(x):\... | [
[
"numpy.linalg.lstsq",
"scipy.sparse.linalg.spsolve",
"numpy.count_nonzero",
"numpy.linalg.norm",
"numpy.eye",
"numpy.arange",
"numpy.sqrt",
"numpy.vstack",
"numpy.atleast_2d",
"scipy.sparse.issparse",
"numpy.array",
"scipy.sparse.csc_matrix",
"scipy.sparse.linal... |
Alex4386/CIRNO | [
"f8862ab8251cf5a718e608ba25b0ebcc8309d4dd"
] | [
"CIRNO/CIRNONetwork.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nfrom Utils.ConvNet import conv2DOutsize\n\n# The Network Configuration for CIRNO\n\nclass CIRNONetwork(nn.Module):\n def __init__(self, w, h, actions):\n super(CIRNONetwork, self).__init__()\n\n self.conv1 = nn.Conv2d(3, 12, kernel_size=5, st... | [
[
"torch.nn.Linear",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d"
]
] |
MSKCC-Computational-Pathology/PenAnnotationExtractor | [
"83a9120729b7e6e0e063932c589e6f004e5f8172"
] | [
"penAnnotationExtractor.py"
] | [
"# penAnnotationExtractor.py\r\n# A tool to extract pen annotated regions from WSI thumbnails.\r\n# Created by PJ Schueffler and DVK Yarlagadda, MSKCC\r\n# schueffp@mskcc.org\r\n#\r\n# Schüffler PJ, Yarlagadda DVK, Vanderbilt C, Fuchs TJ: Overcoming an Annotation Hurdle: Digitizing Pen Annotations from Whole Slide ... | [
[
"numpy.array",
"numpy.count_nonzero",
"numpy.zeros",
"numpy.unique"
]
] |
forkbabu/homura | [
"3c2ba10593831af09ca7e5812c6471884cb4ec50",
"3c2ba10593831af09ca7e5812c6471884cb4ec50"
] | [
"homura/modules/functional/knn.py",
"tests/test_modules/test_ema.py"
] | [
"from __future__ import annotations\n\nimport torch\n\nfrom homura.utils import is_faiss_available\n\nif is_faiss_available():\n import faiss\n\n\ndef _tensor_to_ptr(input: torch.Tensor):\n assert input.is_contiguous()\n assert input.dtype in {torch.float32, torch.int64}\n if input.dtype is torch.float3... | [
[
"torch.nn.functional.normalize",
"torch.no_grad"
],
[
"torch.nn.Linear",
"torch.randn",
"torch.Size"
]
] |
KlonicOne/adventofcode-2019 | [
"63884458720c8b0b83613272750453f51708439f"
] | [
"aoc-2021/day22/day22p2.py"
] | [
"import numpy as np\nfrom itertools import combinations\nimport re\n\n\ndef main():\n # Get file in lines and convert to int\n with open(\"input.txt\", \"r\", encoding=\"utf-8\") as file:\n # strip out the new line\n puzzle_lines = [line.rstrip('\\n') for line in file]\n\n # Parse input and e... | [
[
"numpy.diff"
]
] |
gusbeane/galpy | [
"d6db971285f163456c81775fc2fdc7d75189762c"
] | [
"galpy/potential/FerrersPotential.py"
] | [
"###############################################################################\n# FerrersPotential.py: General class for triaxial Ferrers Potential\n#\n# rho(r) = amp/[a^3 b c pi^1.5] Gamma(n+5/2)/Gamma(n+1) (1 - (m/a)^2)^n\n#\n# with\n#\n# m^2 = x^2 + y^2/b^2 + z^2/c^2\n######################... | [
[
"numpy.iscomplex",
"numpy.array",
"numpy.sin",
"scipy.special.gamma",
"numpy.roots",
"numpy.fabs",
"numpy.sqrt",
"numpy.cos"
]
] |
parampavar/sight | [
"d04db64a03a5c2808027246b23384ea2e474479c"
] | [
"build/lib/sightseer/zoo.py"
] | [
"import os\nimport wget\nimport struct\nimport shutil\nimport logging\n\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Input, UpSampling2D, concatenate\nfrom tensorflow.keras.models import Model, load_model\n\nfrom .blocks import ConvBlock, BoundingBox, SightLoader\n\n... | [
[
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.UpSampling2D",
"tensorflow.autograph.set_verbosity",
"numpy.ones",
"numpy.exp",
"tensorflow.keras.models.Model",
"tensorflow.keras.models.load_model",
"numpy.random.randint",
"numpy.argsort",
"tensorflow.keras.layers... |
heitor57/binary-knapsack-ga | [
"02e03a7fadbfc1a304ca41316c71491c3d9b1460"
] | [
"src/lib/selection_policy.py"
] | [
"import sys\n\nimport numpy as np\n\nclass SelectionPolicy:\n def __init__(self,population):\n self.population = population\n\nclass Tournament(SelectionPolicy):\n def select(self):\n population=self.population\n fathers = []\n for i in range(2):\n inds = []\n ... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.sum",
"numpy.finfo",
"numpy.argsort",
"numpy.random.random"
]
] |
LachlanStuart/slingpy | [
"35a9582f0546a1714927f402ef6cca058faf8cdc"
] | [
"slingpy/data_access/data_sources/hdf5_tools.py"
] | [
"\"\"\"\nCopyright (C) 2021 Patrick Schwab, Arash Mehrjou, GlaxoSmithKline plc; Andrew Jesson, University of Oxford; Ashkan Soleymani, MIT\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software... | [
[
"numpy.array"
]
] |
thuliu-yt16/torchx | [
"24ddc404af0048ae8e9097764e78c0b1508d77ad"
] | [
"utils.py"
] | [
"import os\r\nimport time\r\nimport shutil\r\nimport math\r\n\r\nimport torch\r\nfrom torch import nn\r\nimport numpy as np\r\nfrom torch.optim import SGD, Adam\r\nfrom tensorboardX import SummaryWriter\r\n\r\nimport fnmatch\r\n\r\nclass Averager():\r\n\r\n def __init__(self):\r\n self.n = 0.0\r\n ... | [
[
"torch.arange",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"numpy.prod",
"torch.meshgrid"
]
] |
nitinthedreamer/pytorch-ts | [
"7f81b2fbab2e8913792d841b0d66deb489ee6185"
] | [
"pts/model/estimator.py"
] | [
"from typing import NamedTuple, Optional\nfrom functools import partial\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nfrom torch.utils import data\nfrom torch.utils.data import DataLoader\n\nfrom gluonts.env import env\nfrom gluonts.core.component import validated\nfrom gluonts.dataset.common import... | [
[
"numpy.random.get_state",
"torch.utils.data.DataLoader"
]
] |
The-Intelligence-of-Information/jax | [
"3ffa328e95277542e3ad0953e87d71102a9d2537"
] | [
"jax/_src/numpy/lax_numpy.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.not_equal",
"numpy.multiply",
"numpy.sign",
"numpy.where",
"numpy.size",
"numpy.issubdtype",
"numpy.broadcast_to",
"numpy.dtype",
"numpy.concatenate",
"numpy.empty",
"numpy.log",
"numpy.arange",
"numpy.ndim",
"numpy.equal",
"numpy.array",
"num... |
kevinjohncutler/ncolor | [
"36d56090aaea4fde4f7c1cbb6c7bb1d207a006a1"
] | [
"ncolor/label.py"
] | [
"#4-color algorthm based on https://forum.image.sc/t/relabel-with-4-colors-like-map/33564 with extensions and improvements \n\nimport numpy as np\nfrom numba import njit\nimport scipy \nfrom .format_labels import format_labels\n\ndef label(lab,n=4,conn=2,max_depth=5, offset=0):\n # needs to be in standard label ... | [
[
"numpy.array",
"numpy.dot",
"numpy.cumprod",
"numpy.pad",
"numpy.random.seed",
"numpy.random.shuffle",
"numpy.where",
"scipy.ndimage.generate_binary_structure",
"numpy.random.randint",
"numpy.argsort",
"numpy.hstack",
"numpy.unique"
]
] |
pierre-moreau/DQPM_thermo | [
"12bb51b2040977ed658424746707712cce60393d"
] | [
"DQPM_thermo/test/__init__.py"
] | [
"import time\nfrom matplotlib.pyplot import rc\n\n########################################################################\ndef timef(fun):\n \"\"\"\n decorator to record execution time of a function\n \"\"\"\n def wrapper(*args,**kwargs):\n start = time.time()\n res = fun(*args,**kwargs)\n end = time.... | [
[
"matplotlib.pyplot.rc"
]
] |
andrawaag/Zika_Data2LinkedData | [
"997aa6ad4a4f3fc0a782088a52070bed5b238149"
] | [
"zika_data_bot.py"
] | [
"# Author: Andra Waagmeester\n\nimport pandas as pd\nfrom SPARQLWrapper import SPARQLWrapper, JSON\nimport pprint\nfrom rdflib import Namespace, Graph, URIRef, BNode, Literal\nfrom rdflib.namespace import DCTERMS, RDFS, RDF, DC, XSD\nimport datetime\n\nzikaGraph = Graph()\nwdt = Namespace(\"http://www.wikidata.org/... | [
[
"pandas.notnull",
"pandas.read_csv"
]
] |
jswang/handful-of-trials | [
"fcb1ef4eec1045b6de0cb64f7e69202f25aa2ee6"
] | [
"dmbrl/env/reacher.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport os\n\nimport numpy as np\nfrom gym import utils\nfrom gym.envs.mujoco import mujoco_env\n\n\nclass Reacher3DEnv(mujoco_env.MujocoEnv, utils.EzPickle):\n def __init__(self):\n self.view... | [
[
"numpy.concatenate",
"numpy.random.normal",
"numpy.square",
"numpy.linalg.norm",
"numpy.sin",
"numpy.zeros",
"numpy.copy",
"numpy.cos",
"numpy.cross"
]
] |
rileyhales/dataTools | [
"86b32ecb47388a7c9fda8b45972fadaac132dffb"
] | [
"nctools/netcdf_to_geotiff.py"
] | [
"def nc1_to_gtiff(file_path, var, save_dir_path):\n \"\"\"\n Description: This script accepts a netcdf file in a geographic coordinate system, specifically the NASA GLDAS\n netcdfs, and extracts the data from one variable and the lat/lon steps to create a geotiff of that information.\n Dependencies:... | [
[
"numpy.asarray"
]
] |
Atokulus/flora-tools | [
"6f878a4495e4dcb6b9bc19a75aaac37b9dfb16b0"
] | [
"flora_tools/lwb_round.py"
] | [
"import typing\nfrom enum import Enum\nfrom typing import Union\n\nimport numpy as np\n\nfrom pandas._libs.tslibs import np_datetime\n\nimport flora_tools.lwb_slot as lwb_slot\nimport flora_tools.sim.sim_node as sim_node\nimport flora_tools.sim.lwb_stream as stream\nfrom flora_tools.radio_configuration import Radio... | [
[
"numpy.ceil"
]
] |
arunboson/self-driving-golf-cart | [
"8d891600af3d851add27a10ae45cf3c2108bb87c"
] | [
"ros/src/segmentation/scripts/helper.py"
] | [
"#!/usr/bin/env python\n#\n# THE KITTI VISION BENCHMARK SUITE: ROAD BENCHMARK\n#\n# Copyright (C) 2013\n# Honda Research Institute Europe GmbH\n# Carl-Legien-Str. 30\n# 63073 Offenbach/Main\n# Germany\n#\n# UNPUBLISHED PROPRIETARY MATERIAL.\n# ALL RIGHTS RESERVED.\n#\n# Authors: Tobias Kuehnl <tkuehnl@cor-... | [
[
"numpy.concatenate",
"numpy.histogram",
"numpy.zeros",
"numpy.sum",
"numpy.flipud",
"numpy.where",
"numpy.arange",
"numpy.cumsum",
"numpy.linspace"
]
] |
PrateekMunjal/genedisco | [
"04f45f8a18da18472adb85c32ea22bcaee354597"
] | [
"genedisco/active_learning_methods/batchbald_redux/consistent_mc_dropout.py"
] | [
"\"\"\"\nCopyright 2021 Patrick Schwab, Arash Mehrjou, GlaxoSmithKline plc; Andrew Jesson, University of Oxford; Ashkan Soleymani, MIT\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n ... | [
[
"torch.empty"
]
] |
albb762/deepreplay | [
"5f3f6dad94dad88271b86bb8bd2f4f057ff83e18"
] | [
"examples/moons_dataset.py"
] | [
"from keras.layers import Dense\nfrom keras.models import Sequential\nfrom keras.optimizers import SGD\nfrom keras.initializers import normal, glorot_normal\n\nfrom deepreplay.callbacks import ReplayData\nfrom deepreplay.replay import Replay\nfrom deepreplay.plot import compose_animations, compose_plots\n\nfrom skl... | [
[
"sklearn.datasets.make_moons",
"matplotlib.pyplot.subplot2grid",
"matplotlib.pyplot.figure"
]
] |
kamilazdybal/multipy | [
"ebdcddb63bfb1cd647ca99bbf9002b04a9b50ed9"
] | [
"tests/Diffusion/test_Diffusion.py"
] | [
"import unittest\nimport numpy as np\nimport multipy\n\n################################################################################\n################################################################################\n####\n#### Class: Diffusion\n####\n##########################################################... | [
[
"numpy.array"
]
] |
iamchetry/DataChallenge-Fall2021 | [
"fa7748c9ea2f3c0f6bde8d0b094fc75463e28f33"
] | [
"scripts/data_creation.py"
] | [
"from chemml.datasets import load_organic_density\nimport pandas as pd\n\nfrom sklearn.model_selection import train_test_split\n\n\ndef get_necessary_data():\n '''\n\n :return: Train & Test splits of data, Scaled value of target Density, Mean & Standard Deviation of Target Density\n '''\n molecules, ta... | [
[
"pandas.qcut"
]
] |
monte-flora/py-mint | [
"23f9a952726dc0e69dfcdda2f8c7c27858aa9a11",
"0dd22a2e3dce68d1a12a6a99623cb4d4cb407b58"
] | [
"build/lib/pymint/main/global_interpret.py",
"pymint/main/interpret_toolkit.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom math import sqrt\nfrom scipy.spatial import cKDTree\nfrom scipy.interpolate import interp1d\nimport itertools\nfrom functools import reduce\nfrom operator import add\nimport traceback\nfrom copy import copy\n\nfrom sklearn.linear_model import LinearRegression\nfrom skl... | [
[
"numpy.random.choice",
"sklearn.linear_model.LinearRegression",
"numpy.mean",
"numpy.where",
"numpy.cumsum",
"sklearn.metrics.r2_score",
"pandas.DataFrame",
"numpy.arange",
"numpy.sqrt",
"numpy.array",
"scipy.interpolate.interp1d",
"numpy.zeros",
"numpy.shape",
... |
Razdeep/PythonSnippets | [
"76f9313894f511c487a99bc38bdf0fe5e594caf5"
] | [
"NOV13/10.py"
] | [
"# reading csv file with pandas\nimport pandas as pd\ndf=pd.read_csv('data.csv')\n# df=pd.read_csv('data.csv',header=None) # Use this to ignore header from the csv\nprint(df)"
] | [
[
"pandas.read_csv"
]
] |
MeepoAII/vision | [
"6e10e3f88158f12b7a304d3c2f803d2bbdde0823"
] | [
"torchvision/models/mobilenet.py"
] | [
"from torch import nn\nfrom .utils import load_state_dict_from_url\n\n\n__all__ = ['MobileNetV2', 'mobilenet_v2']\n\n\nmodel_urls = {\n 'mobilenet_v2': 'https://download.pytorch.org/models/mobilenet_v2-b0353104.pth',\n}\n\n\ndef _make_divisible(v, divisor, min_value=None):\n \"\"\"\n This function is taken... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Sequential",
"torch.nn.init.kaiming_normal_",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.init.ones_",
"torch.nn.ReLU6",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.init.zeros_"
]
] |
9600dev/mmr | [
"b08e63b7044f2b2061d8679b216822c82d309c86"
] | [
"trader/common/helpers.py"
] | [
"import tempfile\nimport pandas as pd\nimport numpy as np\nimport scipy.stats as st\nimport logging\nimport functools\nimport asyncio\nimport datetime as dt\nimport exchange_calendars as ec\nimport plotille as plt\nimport socket\nimport warnings\nimport io\nimport json\nimport locale\nimport os\nimport click\nimpor... | [
[
"numpy.histogram",
"pandas.DataFrame",
"numpy.roll",
"numpy.power",
"pandas.Series",
"pandas.read_csv"
]
] |
tiagoColli/tcc | [
"fb98c323b4e50fed6cb1cbf52e6eb8a3f648a5b3"
] | [
"oam/test/sample_search.py"
] | [
"import sys\nsys.path.insert(0, '../../')\nimport pandas as pd\n\nfrom oam.score.isolation_path import IsolationPath\nfrom oam.search.simple_combination import SimpleCombination\n\n\ndf = pd.read_csv('../../datasets/df_outliers.csv')\n\nipath = IsolationPath(\n subsample_size=256,\n number_of_paths=50\n)\n\ns... | [
[
"pandas.read_csv"
]
] |
6041/tf_hdlr | [
"1516af8309a33f8395d2f955f75d2504a3823e55"
] | [
"tf_hdlr.py"
] | [
"\"\"\"\r\nПеречень необходимых библиотек:\r\n \r\nmath: библиотека для проведения вычислений\r\nmatplotlib: библиотека для визуализации данных\r\nnumpy: библиотека для работы с многомерными массивами, ускоряющая реализацию вычислительных алгоритмов\r\npandas: библиотека для обработки и анализа данных, используе... | [
[
"tensorflow.logging.set_verbosity",
"numpy.array",
"sklearn.metrics.mean_squared_error",
"tensorflow.python.data.Dataset.from_tensor_slices",
"pandas.DataFrame",
"numpy.random.permutation",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"ma... |
jiangnanboy/gnn4lp | [
"3d67cd140f62acd146e27547e1403a3f0484ed83"
] | [
"src/graph_att_gan/train.py"
] | [
"import scipy.sparse as sp\nimport numpy as np\nimport torch\nimport time\nimport os\nfrom configparser import ConfigParser\n\nimport sys\nsys.path.append('/home/shiyan/project/gnn4lp/')\n\nfrom src.util.load_data import load_data_with_features, load_data_without_features, sparse_to_tuple, mask_test_edges, preproce... | [
[
"torch.Size",
"numpy.array",
"torch.FloatTensor",
"scipy.sparse.eye",
"numpy.save",
"torch.cuda.is_available",
"torch.LongTensor",
"scipy.sparse.identity",
"torch.tensor"
]
] |
sungyihsun/meta-transfer-learning | [
"b96dfdfcdcdbdc553139b5abe42cf045e33e1f57"
] | [
"trainer/asr/trainer.py"
] | [
"import time\nimport numpy as np\nimport torch\nimport logging\nimport sys\n\nfrom tqdm import tqdm\n# from utils import constant\nfrom utils.functions import save_model, post_process\nfrom utils.optimizer import NoamOpt\nfrom utils.metrics import calculate_metrics, calculate_cer, calculate_wer\nfrom torch.autograd... | [
[
"torch.zeros_like",
"torch.cuda.empty_cache"
]
] |
tongni1975/Deep-Learning-with-TensorFlow-Second-Edition | [
"6964bf3bf11c1b38113a0459b4d1a9dac416ed39"
] | [
"Chapter06/LSTM_Time_Series/plot_time_series.py"
] | [
"import csv\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport time_series_preprocessor as tsp\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\n\ntimeseries = tsp.load_series('input/international-airline-passengers.csv')\nprint(timeseries)\nprint(np.shape(timeseries))\n\nplt.figure()\nplt.plot(tim... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.shape",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
moulin1024/WIRELES2 | [
"2fcd190531d24e4f98885824c7d78acb3f79b304"
] | [
"prc/app_post2.py"
] | [
"'''\nCreated on 18.04.2018\n\n@author: trevaz\n\n--------------------------------------------------------------------------------\napp: post-process\n--------------------------------------------------------------------------------\n'''\n\n############################################################################... | [
[
"matplotlib.pyplot.xlim",
"numpy.copy",
"matplotlib.pyplot.semilogy",
"numpy.mean",
"numpy.size",
"matplotlib.pyplot.colorbar",
"numpy.log",
"numpy.arange",
"numpy.sqrt",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.axes",
"numpy.vstack",
"matplotlib.... |
ocampor/libsvm | [
"a9770761bc11d6eb809ec1adf9def1ee71d8db34"
] | [
"libsvm/svm.py"
] | [
"#!/usr/bin/env python\n\nimport sys\nfrom ctypes import *\nfrom os import path, listdir, pardir\n\ntry:\n import scipy\n from scipy import sparse\nexcept:\n scipy = None\n sparse = None\n\nif sys.version_info[0] < 3:\n range = xrange\n from itertools import izip as zip\n\n__all__ = ['libsvm', 'sv... | [
[
"scipy.where",
"scipy.ctypeslib.as_array",
"scipy.ascontiguousarray",
"scipy.empty",
"scipy.arange"
]
] |
KimYongGyu/3dreconstruction | [
"22e02f5a6977258da17ada8de903d36a342c08d3"
] | [
"im2mesh/onet_upconv2d_occtolocal/config.py"
] | [
"import torch\nimport torch.distributions as dist\nfrom torch import nn\nimport os\nfrom im2mesh.encoder import encoder_dict\nfrom im2mesh.onet_upconv2d_occtolocal import models, training, generation\nfrom im2mesh import data\nfrom im2mesh import config\n\n\ndef get_model(cfg, device=None, dataset=None, **kwargs):\... | [
[
"torch.zeros",
"torch.ones"
]
] |
Eomys/Pyleecan | [
"4d7f0cbabf0311006963e7a2f435db2ecd901118"
] | [
"pyleecan/Methods/Slot/SlotM16/plot_schematics.py"
] | [
"import matplotlib.pyplot as plt\nfrom numpy import pi, exp\n\nfrom ....Classes.Arc1 import Arc1\nfrom ....Classes.LamSlot import LamSlot\nfrom ....Classes.Segment import Segment\nfrom ....definitions import config_dict\nfrom ....Functions.Plot import (\n ARROW_COLOR,\n ARROW_WIDTH,\n MAIN_LINE_COLOR,\n ... | [
[
"matplotlib.pyplot.close",
"matplotlib.pyplot.get_current_fig_manager"
]
] |
LBJ-Wade/axion-miniclusters | [
"14f742f6f524f7b1c817ef5cf6ab811eb38dd034"
] | [
"code/mass_function.py"
] | [
"import numpy as np\nG = 4.32275e-3 # (km/s)^2 pc/Msun\nG_pc = G*1.05026504e-27 # (pc/s)^2 pc/Msun\nfrom scipy.interpolate import interp1d, InterpolatedUnivariateSpline\nfrom scipy.integrate import quad\nfrom abc import ABC, abstractmethod, abstractproperty\n\n#def SampleAMC(n_samples):\n \ndef P_delta(... | [
[
"numpy.max",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.asarray",
"numpy.log",
"numpy.zeros",
"numpy.min",
"numpy.geomspace",
"numpy.trapz",
"numpy.abs",
"numpy.sqrt",
"numpy.squeeze"
]
] |
lapisco/pdi-python-lectures | [
"765356a6e58311742dd1f76356d5b9a24b7d2fe5"
] | [
"notebooks/Complementar/src/navFunc/limiar.py"
] | [
"def limiar (Filter):\r\n ### Imports\r\n import numpy as np\r\n import matplotlib.pyplot as plt\r\n import math as m\r\n import navFunc as nf\r\n\r\n # Load image into numpy matrix\r\n\r\n A = Filter.img\r\n\r\n size = nf.structtype()\r\n size.A = nf.structtype()\r\n size.A.lin, size.... | [
[
"numpy.max",
"numpy.uint8",
"numpy.min",
"numpy.zeros"
]
] |
GSA/css_logit_regression | [
"f9611ee19e743ff0b796f1b5b55b20fe2280f670"
] | [
"munge_funcs.py"
] | [
"import pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.linear_model import LinearRegression, LogisticRegression\n\nfrom mord import LogisticAT\n\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.metrics import mean_absolute_error\nfrom sklearn.metrics import make... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.pivot_table",
"pandas.get_dummies"
]
] |
vedkharche538/Pandas | [
"8e299c79c9a1c8caaa4d3a7fd08440b84ec248fc",
"8e299c79c9a1c8caaa4d3a7fd08440b84ec248fc"
] | [
"pandas/tests/indexes/datetimes/test_ops.py",
"pandas/tests/indexing/test_iloc.py"
] | [
"from datetime import datetime\n\nfrom dateutil.tz import tzlocal\nimport numpy as np\nimport pytest\n\nfrom pandas.compat import IS64\n\nimport pandas as pd\nfrom pandas import (\n DateOffset,\n DatetimeIndex,\n Index,\n Series,\n Timestamp,\n bdate_range,\n date_range,\n)\nimport pandas._test... | [
[
"numpy.repeat",
"numpy.concatenate",
"numpy.array",
"pandas.Index",
"pandas.DatetimeIndex",
"pandas.tseries.offsets.BDay",
"pandas.date_range",
"pandas.Timestamp",
"pandas._testing.assert_numpy_array_equal",
"pandas.tseries.offsets.Hour",
"numpy.arange",
"pandas.bda... |
StillWaterRUN/D-MIL.pytorch | [
"4ed6ef3ca27e3632cf77adaa0feae21bf4b13e90"
] | [
"lib/datasets/pascal_voc.py"
] | [
"from __future__ import print_function\nfrom __future__ import absolute_import\n# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# ----------------------------------------... | [
[
"numpy.mean",
"scipy.io.loadmat",
"numpy.zeros"
]
] |
w495/shot_detector | [
"617ff45c9c3c96bbd9a975aef15f1b2697282b9c"
] | [
"shot_detector/features/norms/l1_norm.py"
] | [
"# -*- coding: utf8 -*-\n\"\"\"\n This is part of shot detector.\n Produced by w495 at 2017.05.04 04:18:27\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nimport numpy as np\n\nfrom .base_norm import BaseNorm\n\n\nclass L1Norm(BaseNorm):\n \"\"\"\n ...\n \"\"\"\n\n ... | [
[
"numpy.sum",
"numpy.abs"
]
] |
Iglohut/autoscore_3d | [
"04d039900c0ae1d535d1d624257ce1760edaf50e"
] | [
"i3d_generator.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 19 15:03:23 2018\n\n@author: sebastian\n\"\"\"\n\nimport numpy as np\nfrom keras.utils.data_utils import Sequence\nimport cv2\nimport random\nimport copy\n\n\nclass i3d_generator(Sequence):\n def __init__(self, X, Y, batch_size, input_f... | [
[
"numpy.ceil",
"numpy.asarray",
"numpy.zeros",
"numpy.round",
"numpy.random.permutation",
"numpy.random.random"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.