repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
bstee615/Devign | [
"721ee636234a7ee4d71b5696501061a446af1e7b"
] | [
"main.py"
] | [
"import argparse\nimport glob\nimport json\nimport os\nimport pickle\nimport random\nimport sys\n\nimport numpy as np\nimport sklearn.model_selection\nimport torch\nfrom torch.nn import BCELoss\nfrom torch.optim import Adam\n\nfrom data_loader.dataset import DataSet, SavedDataset\nfrom modules.model import DevignMo... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.nn.BCELoss"
]
] |
thatgeeman/pybx | [
"d1085d2942a3c5f5d33fcfd57bfd69bf51ce09ea"
] | [
"tests/test_vis.py"
] | [
"import json\nimport unittest\nimport warnings\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nfrom pybx.basics import *\nfrom pybx.vis import VisBx\n\nnp.random.seed(1)\n\nparams = {\n \"data_dir\": './data',\n \"annots_file\": 'annots_iou.json',\n \"annots_iou_file\": './data/annots_iou.js... | [
[
"numpy.random.seed",
"numpy.random.randn",
"numpy.random.randint",
"matplotlib.pyplot.close"
]
] |
nicolasmelo1/marketing-performance-report | [
"796534beeb729a38a142ae4a099a378c7eae6f99"
] | [
"pax/performance.py"
] | [
"from pax.appsflyer import appsflyerData\r\nfrom pax.facebook import facebookdata\r\nfrom pax.google import googlereports\r\nfrom pax.database import baseDatabase\r\nfrom utils.paths import PATH_SIGLAS_PRACAS\r\nfrom pax.twitter import twitterdata\r\nimport unidecode\r\nimport pandas\r\nimport utils.time\r\npandas.... | [
[
"pandas.read_csv"
]
] |
yuichikano/Fashion-Image-Retrieval-System | [
"5d712a4e400716e84337defe08f51c2165d44ade"
] | [
"DML/netlib.py"
] | [
"# Copyright 2019 Karsten Roth and Biagio Brattoli\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 appl... | [
[
"torch.nn.Linear",
"torch.nn.functional.normalize",
"torch.nn.ModuleList",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_"
]
] |
EthereumGeeks/dev | [
"daf2d0fb3418cac564461d03c1a9fed4fdec3589"
] | [
"packages/contracts/macroModel/macro_model.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Baseline vs Alternative V2 Copy\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1NNPdiKfO3950MuAGyIXTNrr4OMliINKb\n\n# Parameters and Initialization\n\"\"\"\n\nimport random\nimport numpy as np\nimport pandas as ... | [
[
"numpy.random.normal",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.random.gamma",
"matplotlib.pyplot.plot",
"numpy.random.chisquare",
"numpy.random.uniform",
"matplotlib.pyplot.show"
]
] |
onkarsabnis/realtime-facial-emotion-analyzer | [
"ac74f94e8caa211b615413819ca5a7bcaf0aa554",
"ac74f94e8caa211b615413819ca5a7bcaf0aa554"
] | [
"tests/test_face_detection_opencv.py",
"training/data_prep.py"
] | [
"# ---- coding: utf-8 ----\n# ===================================================\n# Author: Susanta Biswas\n# ===================================================\n\"\"\"Description: Tests for opencv face detector.\"\"\"\n# ===================================================\n\nfrom emotion_analyzer.exceptions impo... | [
[
"numpy.zeros"
],
[
"numpy.array",
"numpy.save"
]
] |
alexis-roche/nireg | [
"6ed32f2830ff6ebc1860519dc630ebdf8e969dcf"
] | [
"nireg/slicetiming/timefuncs.py"
] | [
"\"\"\" Utility functions for returning slice times from number of slices and TR\n\nSlice timing routines in nipy need a vector of slice times.\n\nSlice times are vectors $t_i i = 0 ... N$ of times, one for each slice, where\n$t_i% gives the time at which slice number $i$ was acquired, relative to the\nbeginning of... | [
[
"numpy.array",
"numpy.arange",
"numpy.argsort"
]
] |
Exhor/dfstore | [
"c314adbee048c24fdcb17ed975f4ed462061fc21"
] | [
"tests/test_api.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom fastapi.testclient import TestClient\n\nfrom src.client import DFStoreClient\nfrom src.server import make_app\nfrom tests.e2e import e2e\n\n\ndef make_awkward_data(nrows=100, ncols=5):\n df = pd.DataFrame(\n {\n \"const\": [1] * nrows,\n ... | [
[
"pandas.testing.assert_frame_equal",
"numpy.random.randn"
]
] |
aircov/- | [
"2e306b846dcdd3c57f1dba4493dc3d2babb036a7"
] | [
"data_nlp/kears_ner.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@time : 2020/07/18 10:45\n@author : 姚明伟\n\"\"\"\nimport pickle\nimport numpy as np\nfrom keras.preprocessing.sequence import pad_sequences\nfrom keras import Sequential\nfrom keras_contrib.layers import CRF\nimport pickle\nfrom keras.layers import Embedding, Bidirectional, LSTM\n... | [
[
"numpy.expand_dims"
]
] |
ManiBlitz/URA-text-analysis | [
"839eba038fa36782200905a43d710f51d1761b7a"
] | [
"parser/kmeansClusters.py"
] | [
"from copy import deepcopy\nimport numpy as np\nfrom matplotlib import pyplot as plt\nplt.rcParams['figure.figsize'] = (16, 9)\nplt.style.use('ggplot')\n\n# Euclidean Distance Caculator\ndef dist(a, b, ax=1):\n return np.linalg.norm(a - b, axis=ax)\n\n# Define the number of clusters and provide an array with the... | [
[
"numpy.linalg.norm",
"numpy.zeros",
"numpy.argmin",
"numpy.mean",
"numpy.random.randint",
"matplotlib.pyplot.style.use"
]
] |
hvanwyk/drifter | [
"a08df0cef81bc6ca76084ae8cac089644e2bd56b",
"a08df0cef81bc6ca76084ae8cac089644e2bd56b"
] | [
"tests/test_mesh/test_cell.py",
"tests/test_gmrf/test_spdmatrix.py"
] | [
"from mesh import Cell, HalfEdge, Vertex\nfrom mesh import convert_to_array\nfrom assembler import GaussRule\nimport numpy as np\nimport unittest\n\n\nclass TestCell(unittest.TestCase):\n \"\"\"\n Test Cell object(s).\n \"\"\"\n def test_constructor(self):\n \"\"\"\n Constructor\n \... | [
[
"numpy.array",
"numpy.ones",
"numpy.random.rand"
],
[
"scipy.sparse.issparse",
"numpy.array",
"numpy.dot",
"numpy.random.rand",
"numpy.linalg.matrix_rank",
"scipy.sparse.diags",
"scipy.sparse.csc_matrix",
"numpy.eye",
"numpy.allclose",
"sklearn.datasets.make... |
mepear/flow | [
"4fc6ceaf64ca522b5a5c4104a3098b20cf207dd4"
] | [
"train/myppo/train_ppo.py"
] | [
"import copy\nimport glob\nimport os\nimport sys\nimport time\nfrom collections import deque\nimport random\nfrom functools import partial\n\nimport gym\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.distributed import rpc\nimport t... | [
[
"torch.multiprocessing.Process",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.distributed.rpc.TensorPipeRpcBackendOptions",
"torch.multiprocessing.set_start_method",
"torch.manual_seed",
"torch.distributed.rpc.init_rpc",
"torch.cuda.is_available",
"torch.distribute... |
sumit-158/sktime | [
"e74c32ac6493291dacae36dbfc979de1eefeffac"
] | [
"sktime/datatypes/_convert.py"
] | [
"# -*- coding: utf-8 -*-\n# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\n\"\"\"Machine type converters for scitypes.\n\nExports\n-------\nconvert_to(obj, to_type: str, as_scitype: str, store=None)\n converts object \"obj\" to type \"to_type\", considerd as \"as_scitype\"\n\nconvert(obj,... | [
[
"pandas.DataFrame"
]
] |
gohsyi/tianshou | [
"9c0cd45a3bc6147ea94ff95f49df3e950ce02958"
] | [
"tianshou/utils/moving_average.py"
] | [
"import torch\nimport numpy as np\n\n\nclass MovAvg(object):\n \"\"\"Class for moving average. Usage:\n ::\n\n >>> stat = MovAvg(size=66)\n >>> stat.add(torch.tensor(5))\n 5.0\n >>> stat.add(float('inf')) # which will not add to stat\n 5.0\n >>> stat.add([6, 7, 8])\n... | [
[
"numpy.std",
"numpy.mean"
]
] |
DilipA/rlpyt | [
"edfd46484c56a47b4671006a16a642e6808da393"
] | [
"rlpyt/spaces/float_box.py"
] | [
"\nimport numpy as np\n\nfrom rlpyt.spaces.base import Space\n\n\nclass FloatBox(Space):\n \"\"\"A box in R^n, with specifiable bounds and dtype.\"\"\"\n\n def __init__(self, low, high, shape=None, null_value=0., dtype=\"float32\"):\n \"\"\"\n Two kinds of valid input:\n # low and hig... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.ones",
"numpy.random.uniform",
"numpy.isscalar",
"numpy.issubdtype",
"numpy.dtype"
]
] |
Sargastico/insp3ct0r | [
"3363fbcf4058054b1437620ee1deb640d272d0bf"
] | [
"core/processing/subtraction.py"
] | [
"from skimage.metrics import structural_similarity\nimport cv2 as cv\nimport numpy as np\n\ndef differenceInspection(baseimg, tocompareimg, showResults=False):\n\n height, width, _ = baseimg.shape\n\n tocompareimg = cv.resize(tocompareimg, (width, height))\n\n # Convert images to grayscale\n before_gray... | [
[
"numpy.zeros"
]
] |
davidstutz/bpy-visualization-utils | [
"9aec34f4b58d83992c3c3ce7eb6369d9055760bc"
] | [
"write_binvox.py"
] | [
"import numpy as np\nimport argparse\nimport binvox_rw\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description='Write an example BINVOX file.')\n parser.add_argument('output', type=str, help='BINVOX file.')\n\n args = parser.parse_args()\n\n volume = np.zeros((32, 32, 32))\n volu... | [
[
"numpy.zeros"
]
] |
MisterZhouZhou/pythonLearn | [
"8933c7a6d444d3d86a173984e6cf4c08dbf84039"
] | [
"opencv_demo/face_action/face_direction.py"
] | [
"#!/usr/bin/env python\n\nimport cv2\nimport numpy as np\nimport dlib\nimport time\nimport math\n\ndetector = dlib.get_frontal_face_detector()\npredictor = dlib.shape_predictor(\"shape_predictor_68_face_landmarks.dat\")\nPOINTS_NUM_LANDMARK = 68\n\n\n# 获取最大的人脸\ndef _largest_face(dets):\n if len(dets) == 1:\n ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
kaczmarj/tensorflow | [
"35a015349bab8f2e3276d843427a4501e56d18b6"
] | [
"tensorflow/python/keras/layers/preprocessing/text_vectorization.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.ragged.ragged_string_ops.string_split_v2",
"tensorflow.python.ops.math_ops.reduce_sum",
"tensorflow.python.ops.array_ops.expand_dims",
"tensorflow.python.ops.gen_string_ops.string_lower",
"tensorflow.python.ops.math_ops.cast",
"tensorflow.python.util.compat.as_text",... |
tanimutomo/advex-uar | [
"251e0978dba7a5473c40e55fb350aa2144135120"
] | [
"advex_uar/examples/eval.py"
] | [
"import click\nimport importlib\nimport os\n\nimport numpy as np\nimport torch\n\nfrom advex_uar.eval import ImagenetEvaluator, ImagenetCEvaluator\nfrom advex_uar.eval import CIFAR10Evaluator, CIFAR10CEvaluator\nfrom advex_uar.common.pyt_common import *\nfrom advex_uar.common import FlagHolder\n\ndef get_ckpt(FLAGS... | [
[
"torch.load"
]
] |
headupinclouds/pico | [
"45564fca95cbc8f598c78e3016ca21cffbe3d853"
] | [
"gen/sample/genki.py"
] | [
"#\n#\n#\n\n#\nimport sys\nimport random\nimport numpy\nfrom scipy import misc\nfrom PIL import Image\nfrom PIL import ImageOps\nimport struct\nimport argparse\nimport os\n\n#\nparser = argparse.ArgumentParser()\nparser.add_argument('src', help='GENKI source folder')\nargs = parser.parse_args()\n\n#\nsrc = args.src... | [
[
"numpy.asarray"
]
] |
YantingWan/cloudmesh-analytics | [
"00fc978e8bb720f321caa080995085f826fff5ce"
] | [
"cloudmesh/analytics/server/cloudmesh/analytics.py"
] | [
"import os\nfrom flask import jsonify, current_app\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression\nfrom werkzeug.utils import secure_filename\nfrom cloudmesh.file_helpers import *\n\ndef linear_regression(file_name, body):\n \"\"\"\n Linear regression operation on two dimension data. T... | [
[
"sklearn.linear_model.LinearRegression"
]
] |
vfdev-5/fairscale | [
"b75a5e266d0d7953186a59feff8d808af4e0bf82"
] | [
"fairscale/optim/oss.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n#\n# This source code is licensed under the BSD license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom collections import OrderedDict\nimport copy\nfrom itertools import chain\nimport logging\nfrom math import... | [
[
"torch.zeros",
"torch.distributed.get_world_size",
"torch.device",
"torch.no_grad",
"torch.tensor",
"torch.distributed.all_reduce",
"torch.distributed.get_rank",
"torch.empty",
"torch.distributed.distributed_c10d._get_global_rank",
"torch.distributed.broadcast"
]
] |
wenh06/database_reader | [
"179505ec5c21636b05e916e7b9025e6ef1f388d3"
] | [
"database_reader/image_databases/dermnet.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n\"\"\"\nimport os\nfrom typing import Union, Optional, Any, List, NoReturn\nfrom numbers import Real\n\nimport numpy as np\nnp.set_printoptions(precision=5, suppress=True)\nimport pandas as pd\n\nfrom ..utils.common import (\n ArrayLike,\n get_record_list_recursive,\n)\nfrom ... | [
[
"numpy.set_printoptions"
]
] |
guanghuixu/multi-model-forgetting | [
"d347b268124ef50ebb50b04aab76e0686c1a5819"
] | [
"main.py"
] | [
"\"\"\"Entry point.\"\"\"\nimport os\n\nimport torch\n\nimport data\nimport config\nimport utils\nimport trainer\n\nimport numpy\nimport random\n\nlogger = utils.get_logger()\n\n\ndef main(args): # pylint:disable=redefined-outer-name\n \"\"\"main: Entry point.\"\"\"\n utils.prepare_dirs(args)\n\n torch.ma... | [
[
"torch.manual_seed",
"torch.cuda.manual_seed",
"numpy.random.seed"
]
] |
kinghaoYPGE/my_python | [
"4f1368b7a1eba872ab67f8a867d81d5c71a2e9ba"
] | [
"remote_project/ershoufang_info2/pic.py"
] | [
"import numpy\nfrom matplotlib import pyplot as plt\n\nprice, size = numpy.loadtxt('houses.csv', delimiter='|', usecols=(1,2,), unpack=True)\nprint(price)\nprint(size)\n\n# 求价格和面积的平均值\nprice_mean = numpy.mean(price)\nsize_mean = numpy.mean(size)\n\nprint('平均房价: %s万'%round(price_mean, 2))\n\nplt.figure()\nplt.subplo... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"numpy.mean",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.hist",
"numpy.loadtxt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
qwerty29544/Volume_nonStationary_acoustics | [
"5b56e0417804b659f88364f7b8abe0f4ea11a68d"
] | [
"src/GMSI_test.py"
] | [
"import numpy as np\nfrom iterations.GMSI.iter_solver import muFind, GMSI_solver\n\nif __name__ == \"__main__\":\n lambs = np.array([6., 5. + 0j, 20.])\n print(muFind(lambs))"
] | [
[
"numpy.array"
]
] |
ClarkGuilty/Tesis | [
"2d0af394a8555bcfe8c977570fa584719ed7b037"
] | [
"Legacy/simPlots2D.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Aug 11 15:55:35 2018\n\n@author: Javier Alejandro Acevedo Barroso\nScript de Python para la visualización de la simulación en 2D.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nfrom matplotlib... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.clim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.loadtxt",
"matplotlib.rcParams.update",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.clf",
"matplotlib.ticker.FuncFormatter",
... |
OmegaZhou/MAgent | [
"65fd6fe82535a9502b3be1dcea692a183bdaa6f9"
] | [
"examples/train_trans.py"
] | [
"\"\"\"\ntrain agents to walk through some walls, avoiding collide\n\"\"\"\n\nimport argparse\nimport time\nimport os\nimport logging as log\nimport math\nimport random\n\nimport numpy as np\n\nimport magent\nfrom magent.builtin.tf_model import DeepQNetwork, DeepRecurrentQNetwork\n\n\ndef get_config(map_size):\n ... | [
[
"numpy.around"
]
] |
tvst/streamlit-forum-metrics | [
"d7bac10b13c9605d78f79e3b54eeea678d546570"
] | [
"discourse_api.py"
] | [
"from urllib.parse import urljoin, urlencode\nimport datetime\nimport pytz\n\nimport pandas as pd\nimport requests\n\nimport streamlit as st\n\n\nBASE_URL = 'https://discuss.streamlit.io'\nTTL = 60 * 60 # 1 hour\n\n\n@st.cache(ttl=TTL, show_spinner=False)\ndef fetch(path, **query):\n url = urljoin(BASE_URL, pat... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.concat"
]
] |
williamdjones/cv_assignment_4 | [
"3d654fb6b079e7c5b68c0ca545c28f29f0500a1b"
] | [
"source/utils.py"
] | [
"import h5py\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.cluster import KMeans\n\n\ndef get_codebook_features_labels(path,codebook,sample_size):\n train_data = pd.read_csv(path)\n\n if sample_size == None:\n sample_size = train_data.shape[0]\n\n # select a... | [
[
"numpy.array",
"matplotlib.pyplot.colorbar",
"numpy.random.choice",
"numpy.asarray",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"numpy.transpose",
"matplotlib.pyplot.tight_layout",
"mat... |
IrvingGomez/academic-hugo | [
"4f6e4ec4aab7a11f477883441b768bb6cf843a9c"
] | [
"content/courses/mod2021/17_logistic_regression_heart_disease.py"
] | [
"#########################\n## ##\n## Irving Gomez Mendez ##\n## May 04, 2021 ##\n## ##\n#########################\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.linear_model import LogisticRegression\n\n# Data from Hosmer, D.... | [
[
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.ones",
"numpy.exp",
"matplotlib.pyplot.figure",
"sklearn.linear_model.LogisticRegression",
"matplotlib.pyplot.ylabel",
"numpy.linalg.solve",
"pandas.read_csv",
"numpy.diag",
"numpy.vstack"
... |
eranbTAU/Closing-the-Reality-Gap-for-a-Multi-Agent-System-Using-GAN | [
"3df5f8ba1069ce3f16f1ab743da9cbdd3bddd43c"
] | [
"Fish/carnet/data/gan_trajectories.py"
] | [
"import logging\r\nimport os\r\nimport pickle\r\nimport numpy as np\r\nimport pandas as pd\r\nimport torch\r\nfrom torch.utils.data import Dataset\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\ndef standardization(pred_seq, real_seq):\r\n x, y = pred_seq, real_seq\r\n meansx, stdsx = x.mean(axis=0), x.std... | [
[
"numpy.array",
"torch.cat",
"torch.from_numpy"
]
] |
p2pquake/eew-detector | [
"0e9221c04c4c4ab051329ee117624abe1d841987"
] | [
"fft_analyze.py"
] | [
"import os\nimport sys\nimport wave\nimport numpy as np\n\n# ch: 1\n# bit: 8\n# sample rate: 8000\n\n# FFT window\nN = 1024\n\n# Keep \"detected\" status\nFREEZE_COUNT = int(8000 / N * 10)\n\n# -----------------------------------\n# Initialize answer data\n# -----------------------------------\ndef... | [
[
"numpy.array",
"numpy.fft.fft",
"numpy.abs",
"numpy.take"
]
] |
LucaCamerani/EcoFin-library | [
"ad8d628e0d447d1b5e8d3b16610d382e7df086e1",
"ad8d628e0d447d1b5e8d3b16610d382e7df086e1"
] | [
"Tesi/2_indicatorsModelling/4_noArbitrageReturn/noArbitragePrice.py",
"Tesi/3_modelTester/4_portfolioTester.py"
] | [
"\"\"\"\n4_noArbitragePrice.py\n\nCreated by Luca Camerani at 22/11/2020, University of Milano-Bicocca.\n(l.camerani@campus.unimib.it)\nAll rights reserved.\n\nThis file is part of the EcoFin-Library (https://github.com/LucaCamerani/EcoFin-Library),\nand is released under the \"BSD Open Source License\".\n\"\"\"\n\... | [
[
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.nanmin",
"numpy.abs",
"matplotlib.pyplot.show",
"numpy.nanmax"
],
[
"pandas.to_datetime",
"numpy.log",
"matplotlib.pyplot.subplots",
"pandas.concat",
"matplotlib.pyplot.show"
]
] |
ahhuisg/ML-Data-Prep-Zoo | [
"195733b5767d69c9992456f1380e6c646e30a5ae"
] | [
"clean/datazoo/base.py"
] | [
"import pandas as pd\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\nfrom logzero import logger\r\n\r\n\r\nclass ZooBase(object):\r\n def __init__(self):\r\n self.vectorizer = CountVectorizer(ngram_range=(2, 2), analyzer='char')\r\n\r\n def _process_stats(self, data):\r\n data1... | [
[
"sklearn.feature_extraction.text.CountVectorizer",
"pandas.concat"
]
] |
sdaulton/Ax-1 | [
"8815896c0ff094871a76b73e5adbe897a0df5bf1"
] | [
"ax/models/torch/botorch.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom copy import deepcopy\nfrom typing import Any, Callable, Dict, List, Optional, Tuple, cast\n\nimport num... | [
[
"torch.tensor",
"torch.ones"
]
] |
YiZhiXiaoGuLI/Differential-Evolution-Algorithm | [
"9505c31963c499f878daaa6d02c44d2320b32ff4"
] | [
"DEIndividual/DEIndividual.py"
] | [
"import numpy as np\r\nimport DE.ObjFunction as ObjFunction\r\n\r\n\r\nclass DEIndividual:\r\n\r\n '''\r\n individual of differential evolution algorithm\r\n '''\r\n\r\n def __init__(self, vardim, bound):\r\n '''\r\n vardim: dimension of variables\r\n bound: boundaries of variables... | [
[
"numpy.random.random",
"numpy.zeros"
]
] |
vsoch/NETransliteration-COLING2018 | [
"5d5f59e561ecea45a6d3602121e1049baa7a76c3"
] | [
"xlit_s2s_nmt/utils/iterator_utils.py"
] | [
"# Copyright 2017 Google Inc. 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 by appl... | [
[
"tensorflow.size",
"tensorflow.minimum",
"tensorflow.concat",
"tensorflow.contrib.data.group_by_window",
"tensorflow.TensorShape",
"tensorflow.reverse",
"tensorflow.constant",
"tensorflow.contrib.data.Dataset.zip",
"tensorflow.maximum",
"tensorflow.string_split"
]
] |
wychmod/chatrobot | [
"241b5ac09f2b5084a2a66c4aa95aba5752b32e43"
] | [
"chatbot/word_sequence.py"
] | [
"import numpy as np\n\nclass WordSequence(object):\n\n PAD_TAG = '<pad>'\n UNK_TAG = '<unk>'\n START_TAG = '<s>'\n END_TAG = '</s>'\n\n PAD = 0\n UNK = 1\n START = 2\n END = 3\n\n def __init__(self):\n #初始化基本的字典dict\n self.dict = {\n WordSequence.PAD_TAG: WordSequ... | [
[
"numpy.array"
]
] |
cheerfulwang/python-tutorial | [
"d0f7348e1da4ff954e3add66e1aae55d599283ee",
"d0f7348e1da4ff954e3add66e1aae55d599283ee"
] | [
"20pytorch/pos_tag_allennlp.py",
"37confident-learning/03cleanlib_retrain_model_isri_demo.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@author:XuMing(xuming624@qq.com)\n@description: \n\"\"\"\n\nfrom typing import Iterator, List, Dict\nimport torch\nimport torch.optim as optim\nimport numpy as np\nfrom allennlp.data import Instance\nfrom allennlp.data.fields import TextField, SequenceLabelField\nfrom allennlp.data... | [
[
"torch.manual_seed",
"torch.nn.LSTM",
"numpy.argmax"
],
[
"numpy.array",
"numpy.asarray",
"numpy.random.seed",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticRegression",
"numpy.unique",
"sklearn.model_selection.train_test_split",
"sklearn.datasets.... |
liyzcj/Texygen | [
"805264ff8cc4f1d09a919293812538ac2b5624e5"
] | [
"models/testrelgan/RelganGenerator.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\nfrom models.Gan import Gen\nfrom models.mrelgan.RelganMemory import RelationalMemory\nfrom tensorflow.python.ops import tensor_array_ops, control_flow_ops\nfrom utils.ops import *\n\n\nclass Generator(Gen):\n\n # def __init__(self, temperature, vocab_size, batch_si... | [
[
"tensorflow.multiply",
"tensorflow.train.AdamOptimizer",
"tensorflow.argmax",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.gradients",
"tensorflow.get_collection",
"tensorflow.reshape",
"tensorflow.constant",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"t... |
slikos/espresso | [
"fc0d315c267b8754b039e4062b6463556da3bd57"
] | [
"espresso/tools/specaug_noise.py"
] | [
"# Copyright (c) slikos\n\nimport numpy as np\nimport torch\nfrom torch import Tensor\n\n\nclass AddSpecNoise:\n \"\"\"Add noise spec to signal spec\"\"\"\n def __init__(self, noises_npz_path=None, noise_multiplier_range=None, noise_probability=0.5):\n \"\"\"\n Args:\n noises_npz_path... | [
[
"numpy.load",
"torch.from_numpy",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.random.random"
]
] |
TrainingDML/pytdml | [
"b1c21533a44d931717d9398cbdc57b1ee4ef3302"
] | [
"examples/scene_classification/utils/summaries.py"
] | [
"import os\nimport torch\nfrom torchvision.utils import make_grid\nfrom tensorboardX import SummaryWriter\n\n\nclass TensorboardSummary(object):\n def __init__(self, directory):\n self.directory = directory\n\n def creater_summary(self):\n writer = SummaryWriter(log_dir=self.directory)\n ... | [
[
"torch.sigmoid"
]
] |
dataubc/DSCI_532_Group_113_Overdose | [
"d22be4cbe925107453b7b4479fdd5250feaaed80"
] | [
"code/by_race_and_place_new.py"
] | [
"import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\nimport altair as alt\nimport vega_datasets\nimport pandas as pd\nimport numpy as np\nfrom collections import defaultdict\n\n### NEW IMPORT\n# See Docs here: https://dash-bootstrap-comp... | [
[
"pandas.read_csv"
]
] |
mansimane/notebooks | [
"acd5481dd7a041ad899bbf37da57c3a46863c985"
] | [
"sagemaker/05_spot_instances/scripts/train.py"
] | [
"from transformers import AutoModelForSequenceClassification, Trainer, TrainingArguments\nfrom transformers.trainer_utils import get_last_checkpoint\n\nfrom sklearn.metrics import accuracy_score, precision_recall_fscore_support\nfrom datasets import load_from_disk\nimport logging\nimport sys\nimport argparse\nimpor... | [
[
"sklearn.metrics.accuracy_score",
"sklearn.metrics.precision_recall_fscore_support"
]
] |
sergeyshilin/catalyst | [
"f4dfaac7bc3fe98b2a0a9cf0b4347b100750f82f"
] | [
"catalyst/data/sampler.py"
] | [
"from typing import List, Iterator\nimport numpy as np\n\nfrom torch.utils.data.sampler import Sampler\n\n\nclass BalanceClassSampler(Sampler):\n \"\"\"\n Abstraction over data sampler. Allows you to create stratified sample\n on unbalanced classes.\n \"\"\"\n def __init__(self, labels: List[int], mo... | [
[
"numpy.array",
"numpy.arange",
"numpy.random.choice",
"numpy.random.shuffle"
]
] |
gbiomech/BMC | [
"fec9413b17a54f00ba6818438f7a50b132353e42"
] | [
"functions/detect_peaks.py"
] | [
"\"\"\"Detect peaks in data based on their amplitude and other features.\"\"\"\r\n\r\nfrom __future__ import division, print_function\r\nimport numpy as np\r\n\r\n__author__ = \"Marcos Duarte, https://github.com/demotu/BMC\"\r\n__version__ = \"1.0.4\"\r\n__license__ = \"MIT\"\r\n\r\n\r\ndef detect_peaks(x, mph=None... | [
[
"numpy.array",
"numpy.isnan",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"numpy.where",
"matplotlib.pyplot.show",
"numpy.sort",
"numpy.atleast_1d",
"numpy.argsort",
"numpy.isfinite",
"numpy.hstack",
"numpy.vstack"
]
] |
wnstlr/SMERF | [
"27901688a417154de1ebad4f9bfb06686112a098"
] | [
"smerf/textbox_data.py"
] | [
"import numpy as np\nimport PIL\nfrom PIL import Image, ImageDraw, ImageFont, ImageEnhance\nfrom torch.utils.data import Dataset, DataLoader\nimport os\nfrom smerf.eval import setup_bboxes\nimport pickle\n\nDATA_DIR = '../data/'\n\nclass TextBoxDataset(Dataset):\n def __init__(self, X, y):\n self.X = X\n ... | [
[
"numpy.array",
"numpy.random.random_integers",
"numpy.random.choice",
"numpy.zeros",
"numpy.float32",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.random.random"
]
] |
leschzinerlab/myami-3.2-freeHand | [
"974b8a48245222de0d9cfb0f433533487ecce60d"
] | [
"appion/bin/edCenterStack.py"
] | [
"#!/usr/bin/env python\n\n#python\nimport os\nimport numpy\nfrom scipy import ndimage\n#appion\nfrom appionlib import appionScript\nfrom appionlib import apStack\nfrom appionlib import apDisplay\nfrom appionlib import apImagicFile\nfrom pyami import correlator, peakfinder\n\nclass centerStackScript(appionScript.App... | [
[
"numpy.flipud",
"scipy.ndimage.shift",
"numpy.fliplr"
]
] |
saeed-abdul-rahim/simple_connect | [
"c1d6945f5116825d9635915793f5ebbb488ef413"
] | [
"build/lib/simple_connect/connect.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Aug 10 15:20:03 2018\r\n\r\n@author: Saeed\r\n\"\"\"\r\n\r\nimport httplib2\r\nimport os\r\nimport json\r\nimport oauth2client\r\nfrom oauth2client import file, client, tools\r\nimport base64\r\nfrom email import encoders\r\nimport mimetypes\r\nfrom email.mime.au... | [
[
"pandas.read_sql_query"
]
] |
e-bug/mpre-unmasked | [
"cd12250b58152a558e15a33113bf98d90b88e776"
] | [
"code/vilbert/vilbert/datasets/retreival_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.\n\nimport json\nfrom typing import Any, Dict, List\nimport random\nimport os\n\nimport torch\nfrom torch.utils.data import Dataset\nimpo... | [
[
"torch.zeros",
"numpy.array",
"torch.stack",
"numpy.zeros",
"torch.tensor",
"torch.Tensor"
]
] |
weders/NeuralFusion | [
"4f0c14f67ad9d2368b68cbeb78c237a6328971e5"
] | [
"dataset/utils/augmentation.py"
] | [
"import numpy as np\nimport random\nimport time\n\n\nimport cv2\n\nfrom scipy.ndimage.filters import median_filter, maximum_filter, uniform_filter\nfrom scipy.ndimage.morphology import binary_dilation, binary_erosion\nfrom scipy.ndimage import generate_binary_structure\n\ndef add_kinect_noise(depth, sigma_fraction=... | [
[
"numpy.random.normal",
"numpy.zeros_like",
"numpy.count_nonzero",
"scipy.ndimage.morphology.binary_dilation",
"numpy.sum",
"numpy.copy",
"numpy.ones",
"numpy.multiply",
"numpy.random.uniform",
"numpy.arctan",
"numpy.power",
"numpy.sqrt",
"numpy.repeat",
"sci... |
qsyao/cudaBERT | [
"c93cb5ff0ccd387294a7229a9bef969c1375d0d6"
] | [
"cuda_model.py"
] | [
"import sys\r\nimport numpy as np\r\n\r\nclass Cuda_BERT(object):\r\n def __init__(self, id_gpu, config):\r\n self.id_gpu = id_gpu\r\n self.max_batchsize = config.batch_size\r\n self.max_seq_length = config.max_seq_length\r\n\r\n sys.path.insert(0, config.cubert_pth)\r\n from p... | [
[
"numpy.ones"
]
] |
aprieels/3D-watermarking-spectral-decomposition | [
"dcab78857d0bb201563014e58900917545ed4673"
] | [
"dependencies/PyMesh/scripts/scale_mesh.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nScalar input mesh.\n\"\"\"\n\nimport argparse\nimport pymesh\nimport numpy as np\n\ndef parse_args():\n parser = argparse.ArgumentParser(description=__doc__);\n parser.add_argument(\"--scale\", \"-s\", type=float, default=1.0,\n help=\"Uniform scaling factor\");\n ... | [
[
"numpy.ones"
]
] |
edlanglois/akro | [
"bcbeae4f5fd82606956a5dca3d5ef72a22760ce4"
] | [
"tests/akro/test_dict.py"
] | [
"import collections\nimport pickle\nimport unittest\n\nimport numpy as np\n\nfrom akro import Box\nfrom akro import Dict\nfrom akro import Discrete\nfrom akro import tf\nfrom akro import theano\nfrom akro.requires import requires_tf, requires_theano\n\n\nclass TestDict(unittest.TestCase):\n\n def test_pickleable... | [
[
"numpy.array"
]
] |
nitxiodev/vue-flask-celery-docker-leaflet | [
"0d09239dae668833a66744deff7201586b7b7a47"
] | [
"csp_solver_cloud/src/server/MapService.py"
] | [
"import os\nimport warnings\n\nfrom csp_solver_cloud.src.server.BaseService import BaseService\n\nwarnings.simplefilter(\"ignore\")\nfrom geopy.exc import GeocoderTimedOut, GeocoderServiceError, GeocoderQueryError\nfrom csp_solver_cloud.src.server.Fetcher import Fetcher\nimport geopandas as gp\nfrom csp_solver_clou... | [
[
"pandas.DataFrame.from_dict"
]
] |
PlaytikaResearch/abexp | [
"7f04e0fe29be6b027c84f670f4d09939b50f8eca"
] | [
"tests/test_analysis_bayesian.py"
] | [
"# MIT License\n# \n# Copyright (c) 2021 Playtika Ltd.\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, cop... | [
[
"numpy.random.seed",
"numpy.random.normal",
"pandas.DataFrame"
]
] |
0xangelo/nnrl | [
"c925af1c6ecc6e2e999b782935f7e2c7dee1ba81"
] | [
"nnrl/nn/distributions/flows/abstract.py"
] | [
"\"\"\"Distribution transforms as PyTorch modules compatible with TorchScript.\"\"\"\nfrom typing import Dict\n\nimport torch\nfrom torch import nn\n\nfrom .utils import sum_rightmost\n\n\nclass Transform(nn.Module):\n \"\"\"A diffeomorphism.\n\n Transforms are differentiable bijections with tractable Jacobia... | [
[
"torch.nn.ModuleList"
]
] |
garanews/cuml | [
"318f521a1d2681f4622a44921d27b5f592fe4407"
] | [
"python/cuml/experimental/hyperopt_utils/plotting_utils.py"
] | [
"#\n# Copyright (c) 2020, NVIDIA CORPORATION.\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 applicabl... | [
[
"numpy.array",
"pandas.DataFrame",
"matplotlib.pyplot.legend",
"numpy.where",
"numpy.stack",
"matplotlib.pyplot.show"
]
] |
liqihao2000/shenfun | [
"2164596ccf906242779d9ec361168246ee6214d8"
] | [
"shenfun/la.py"
] | [
"r\"\"\"\nThis module contains linear algebra solvers for SparseMatrixes\n\"\"\"\nimport numpy as np\nimport scipy.sparse as scp\nfrom scipy.sparse.linalg import spsolve, splu\nfrom shenfun.optimization import optimizer\nfrom shenfun.matrixbase import SparseMatrix, extract_bc_matrices, SpectralMatrix\n\n\nclass TDM... | [
[
"scipy.sparse.linalg.splu",
"scipy.sparse.linalg.spsolve",
"numpy.zeros_like",
"numpy.setxor1d",
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.prod",
"numpy.atleast_1d",
"numpy.moveaxis",
"numpy.broadcast_to",
"scipy.sparse.kron"
]
] |
exrich/PyTables | [
"72ac99fb1029c382530d6f70ae70e1c22265cdec"
] | [
"tables/utils.py"
] | [
"\"\"\"Utility functions.\"\"\"\n\nimport math\nimport os\nimport sys\nimport warnings\nimport weakref\nfrom pathlib import Path\nfrom time import perf_counter as clock\n\nimport numpy as np\n\nfrom .flavor import array_of_flavor\n\n# The map between byteorders in NumPy and PyTables\nbyteorders = {\n '>': 'big',... | [
[
"numpy.around",
"numpy.array",
"numpy.empty"
]
] |
wangzhen263/RelationPrediction | [
"bd3ce0a071032b65f0e5df391ab4fb51f8bb7502"
] | [
"code/train.py"
] | [
"import argparse\nimport random\n\nimport tensorflow as tf\nfrom optimization.optimize import build_tensorflow\nfrom common import settings_reader, io, model_builder, optimizer_parameter_parser, evaluation, auxilliaries\nfrom model import Model\nimport numpy as np\n\nparser = argparse.ArgumentParser(description=\"T... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.ones_like",
"numpy.random.choice",
"numpy.zeros",
"numpy.sum",
"tensorflow.Session",
"numpy.where",
"numpy.arange"
]
] |
vveitch/causal-network-embeddings | [
"0afe579c845370f04b0ede53831ab2acf9173764"
] | [
"src/semi_parametric_estimation/helpers.py"
] | [
"import numpy as np\nfrom scipy.special import logit\n\nimport sklearn.linear_model as lm\n\n\ndef calibrate_g(g, t):\n \"\"\"\n Improve calibation of propensity scores by fitting 1 parameter (temperature) logistic regression on heldout data\n\n :param g: raw propensity score estimates\n :param t: treat... | [
[
"numpy.square",
"numpy.log",
"numpy.copy",
"numpy.logical_and",
"sklearn.linear_model.LogisticRegression",
"scipy.special.logit"
]
] |
ifding/self-driving-car | [
"fc8bc808d5439686f0ee24a4f0f3b1f5354df6c0"
] | [
"faster-rcnn-tutorial/detection/transformations.py"
] | [
"from functools import partial\nfrom typing import List, Callable\n\nimport albumentations as A\nimport numpy as np\nimport torch\nfrom sklearn.externals._pilutil import bytescale\nfrom torchvision.ops import nms\n\n\ndef normalize_01(inp: np.ndarray):\n \"\"\"Squash image input to the value range [0, 1] (no cli... | [
[
"numpy.array",
"numpy.asarray",
"numpy.min",
"numpy.where",
"torch.tensor",
"sklearn.externals._pilutil.bytescale",
"numpy.ptp",
"numpy.empty_like"
]
] |
sebastiantiesmeyer/deeplabchop3d | [
"ee2dc65ef558a8c7ee052b3078c717ab8422fd5e"
] | [
"train_chop.py"
] | [
"import torch\nfrom torch.autograd import Variable\n#import time\nimport os\n#import sys\nimport h5py\nfrom utils import Logger\nimport pickle\nimport generator\n\nfrom train import train_epoch\nfrom validation import val_epoch\nfrom utils import AverageMeter, calculate_accuracy\nfrom generator import Generator\nim... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"numpy.arange",
"torch.nn.MSELoss"
]
] |
Jay-9912/AlignShift | [
"db0032ae7f10ec4acfe7593b9a985a8f8fd3c44e"
] | [
"deeplesion/dataset/DeepLesionDataset_align.py"
] | [
"import numpy as np\nimport os\nimport csv\nimport cv2\nimport logging \nfrom pycocotools import mask as mutils\nfrom mmcv import Config\nimport torch\nimport os\nfrom mmdet.datasets.registry import DATASETS\nimport pickle\nfrom mmdet.datasets.pipelines import Compose\nfrom mmdet.datasets.custom import CustomDatase... | [
[
"numpy.array",
"numpy.isnan",
"numpy.ceil",
"numpy.nonzero",
"numpy.sign",
"numpy.floor"
]
] |
vishalbelsare/emmental | [
"040ff13752a8443485abe5f664d7e7df2f30f894"
] | [
"tests/schedulers/test_mixed_scheduler.py"
] | [
"\"\"\"Emmental mixed scheduler unit tests.\"\"\"\nimport logging\n\nimport numpy as np\nimport torch\n\nfrom emmental import EmmentalDataLoader, EmmentalDataset, init\nfrom emmental.schedulers.mixed_scheduler import MixedScheduler\n\nlogger = logging.getLogger(__name__)\n\n\ndef test_mixed_scheduler(caplog):\n ... | [
[
"numpy.random.rand"
]
] |
xzx482/captcha_identify.pytorch_fork | [
"8c2ff599c6afb196dddca3d4bc477ac78c95992e"
] | [
"train.py"
] | [
"# -*- coding: UTF-8 -*-\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport datasets\nfrom models import *\n# import torch_util\nimport os, shutil\nimport argparse\nimport test\nimport torchvision\nimport settings\n\n# os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0,1\"\n\n# Hyper Paramete... | [
[
"torch.autograd.Variable",
"torch.device",
"torch.nn.MultiLabelSoftMarginLoss",
"torch.load"
]
] |
sharanyavenkat25/SearchEngine | [
"5c903fdc6e762c228f574a3dc2272f73f8b101d8"
] | [
"Src/pre-processing/create_corpus.py"
] | [
"import os\r\nimport pandas as pd\r\nimport re\r\nimport string\r\n\r\n\r\nimport nltk\r\nnltk.download('stopwords')\r\nnltk.download('punkt')\r\nfrom nltk.corpus import stopwords\r\nfrom nltk.tokenize import word_tokenize\r\n\r\ndirectory = '/mnt/d/SearchEngine/TelevisionNews/'\r\nop_dir='/mnt/d/SearchEngine/Corpu... | [
[
"pandas.read_csv"
]
] |
irisliucy/garage | [
"2f4dfe1c7472534df4187fde33d81af13e25c769"
] | [
"tests/garage/experiment/test_meta_evaluator.py"
] | [
"import csv\nimport tempfile\n\nimport cloudpickle\nfrom dowel import CsvOutput, logger, tabular\nimport numpy as np\nimport pytest\nimport tensorflow as tf\n\nfrom garage.envs import GarageEnv, PointEnv\nfrom garage.experiment import LocalTFRunner, MetaEvaluator, SnapshotConfig\nfrom garage.experiment.deterministi... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.reset_default_graph",
"numpy.argmax"
]
] |
dbirman/cs375 | [
"7aeac1ed57eff74cbecb3e1091b01f00d34629a8"
] | [
"final_project/combine_pred/combinet_builder.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport tensorflow as tf\nimport sys\nimport copy\n\nsys.path.append('../normal_pred/')\nfrom normal_encoder_asymmetric_with_bypass import *\n\ndef getWhetherResBlock(i, cfg, key_wan... | [
[
"numpy.load",
"tensorflow.transpose",
"tensorflow.cast",
"tensorflow.reshape",
"tensorflow.constant",
"tensorflow.variable_scope",
"tensorflow.get_variable_scope",
"tensorflow.stack",
"tensorflow.device",
"tensorflow.split",
"tensorflow.contrib.framework.arg_scope"
]
... |
xiaoyuehe/TFFinance | [
"8fd737671a0249a184ba7c7418133265abaaf4f7",
"8fd737671a0249a184ba7c7418133265abaaf4f7"
] | [
"test/test.py",
"src/rnn/SimpleLstmRnn.py"
] | [
"import random\nimport tensorflow as tf\n\nimport numpy as np\n\n\nprint(random.randint(30,300))\n\ns = [float(i) / 100 for i in\n range(32, 53)]\nprint(s)\n\nx = np.array([1, 2, 3, 4])\nprint(x.shape)\n\ny = np.zeros((2, 3, 4))\nprint(y)\na = tf.constant(y)\nb = tf.unstack(a,axis=0)\nc = tf.unstack(a,axis=1)\n... | [
[
"numpy.array",
"numpy.zeros",
"tensorflow.Session",
"tensorflow.constant",
"tensorflow.unstack"
],
[
"tensorflow.nn.rnn_cell.BasicLSTMCell",
"numpy.array",
"tensorflow.train.AdamOptimizer",
"tensorflow.Session",
"tensorflow.matmul",
"tensorflow.reshape",
"tensor... |
KayaDevSolutions/deepgaze | [
"a6d444c70bb75ffcfc23d3b31a0567711fb956a7"
] | [
"deepgaze/color_detection.py"
] | [
"#!/usr/bin/env python\n\n#The MIT License (MIT)\n#Copyright (c) 2016 Massimiliano Patacchiola\n#\n#THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \n#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVE... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.add"
]
] |
sontheimer/ModularScience-Cosim-Template | [
"cc5718217a695b70d8f38c38452f1403706014d3"
] | [
"cosim_example_demos/TVB-NEST-demo/nest_elephant_tvb/Interscale_hub/pivot.py"
] | [
"# ------------------------------------------------------------------------------\n# Copyright 2020 Forschungszentrum Jülich GmbH\n# \"Licensed to the Apache Software Foundation (ASF) under one or more contributor\n# license agreements; and to You under the Apache License, Version 2.0. \"\n#\n# Forschungszentrum ... | [
[
"numpy.concatenate",
"numpy.sum",
"numpy.array",
"numpy.empty"
]
] |
KushanChamindu/Capsules-for-text | [
"03643d47e592d2034b5e72ddee769a4edae7137d"
] | [
"trainer.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom tensorflow.keras.preprocessing.sequence import pad_sequences\nfrom tensorflow.keras.preprocessing.text import Tokenizer\nfrom tensorflow.keras import utils\n\n# import ensemble_capsule_network\nimport ensemble_capsu... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"tensorflow.keras.utils.to_categorical",
"numpy.array",
"pandas.concat",
"tensorflow.keras.preprocessing.text.Tokenizer",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
ab3llini/ASLRecognizer | [
"9a98887b13b73bb81bd4d6d8ebbfb13c4ef7e856"
] | [
"src/plots/Plot.py"
] | [
"import seaborn as sb\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as cols\n\n\n\"\"\"Plots a two lines graph.\n@:param x is a list of the values on the x-axis for both lines.\n@:param y1 is a list with the corresponding y-values for one line\n@:param y2 is a list with the corresponding y-values for t... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.pcolor",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.colors.ListedColormap"
]
] |
dblalock/sprintz | [
"a056cdb67d049669875ab5487359aca99ae873ea"
] | [
"python/test_scratch.py"
] | [
"#!/usr/bin/env python\n\n# import itertools\nimport numpy as np\n\nfrom .scratch1 import my_old_transform, my_transform_inverse\n\n\ndef test_my_old_transform_nonincreasing_abs():\n x = np.zeros((1, 2), dtype=np.int32)\n\n # idxs = np.arange(256)\n # left_col = np.tile(idxs, 256).reshape((256, 256)).T.res... | [
[
"numpy.abs",
"numpy.array_equal",
"numpy.zeros"
]
] |
danielnflam/GAN-Tests | [
"f112e27b802d717f64a8f2cfa79b9898667da14c"
] | [
"blocks.py"
] | [
"# IMPLEMENT THE RESNET\nimport torch\nfrom torch import Tensor\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import init\n\nimport torchvision.transforms as vtransforms\nfrom typing import Type, Any, Callable, Union, List, Optional\nimport os, random, sys, time, pathlib\nfrom operator impo... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.exp",
"torch.sigmoid",
"torch.mul",
"torch.nn.MaxPool2d",
"torch.unsqueeze",
"torch.abs",
"torch.nn.init.normal_",
"torch.Tensor",
"torch.nn.Flatten",
"torch.nn.Tanh",
"... |
Guan-t7/DeepAR | [
"d7d76a7e90df7a69ad23b736caac9ab79f926717"
] | [
"evaluate.py"
] | [
"import argparse\nimport logging\nimport os\n\nimport numpy as np\nimport torch\nfrom torch.utils.data.sampler import RandomSampler\nfrom tqdm import tqdm\n\nimport utils\nimport model.net as net\nfrom dataloader import *\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nlogger = loggi... | [
[
"matplotlib.use",
"torch.device",
"torch.zeros",
"numpy.concatenate",
"torch.utils.data.sampler.RandomSampler",
"numpy.random.choice",
"torch.no_grad",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"numpy.arange",
"torch.sum"
]
... |
dovallev/pooling-network | [
"fecbd6c8d10cb458d44c40b741c2f5d3f73cfc8e"
] | [
"tests/test_haverly.py"
] | [
"import numpy as np\nimport pyomo.environ as pe\nfrom galini.relaxations.relax import relax, RelaxationData\n\nfrom pooling_network.formulation.pq_block import PoolingPQFormulation\nfrom pooling_network.instances.data import pooling_problem_from_data\nfrom pooling_network.instances.literature import literature_prob... | [
[
"numpy.testing.assert_almost_equal"
]
] |
cyoon1729/distributedRL | [
"1338bc2655e9af31fd21d40996153515aa8d75f9"
] | [
"common/abstract/worker.py"
] | [
"import asyncio\nimport random\nimport time\nfrom abc import ABC, abstractmethod\nfrom collections import deque\nfrom copy import deepcopy\nfrom datetime import datetime\nfrom typing import Deque\n\nimport numpy as np\nimport pyarrow as pa\nimport torch\nimport torch.nn as nn\nimport zmq\n\nfrom common.utils.utils ... | [
[
"torch.abs",
"torch.FloatTensor",
"torch.clamp"
]
] |
Lornatang/PyTorch-Tutorials | [
"eaca673c46b012fb0f4741d96a5f797715a0c7d5"
] | [
"v2/beginner_source/examples_nn/two_layer_net_optim.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nPyTorch: optim\n--------------\n\nA fully-connected ReLU network with one hidden layer, trained to predict y from x\nby minimizing squared Euclidean distance.\n\nThis implementation uses the nn package from PyTorch to build the network.\n\nRather than manually updating the weights ... | [
[
"torch.nn.MSELoss",
"torch.nn.Linear",
"torch.randn",
"torch.nn.ReLU"
]
] |
mamdamin/MVCNN-TensorFlow | [
"6d8dd3f8d68feccd90ce1b82de31c4b8524b59ab"
] | [
"input.py"
] | [
"import cv2\n\nfrom PIL import Image\nimport random\nimport numpy as np\nimport time\nimport queue as Queue\nimport threading\nimport globals as g_\nfrom concurrent.futures import ThreadPoolExecutor\nfrom augment import augmentImages\nimport tensorflow as tf\n\nW = H = 256\n\nclass Shape:\n def __init__(self, li... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros"
]
] |
QAMP-Spring-2022-Transpiler-Hackathon/qiskit-terra | [
"aee0dc4d538991560f212411db92cde5f511f65b"
] | [
"test/python/quantum_info/operators/symplectic/test_clifford.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio... | [
[
"numpy.array",
"numpy.random.default_rng",
"numpy.eye"
]
] |
brandonkrull/matminer | [
"17e52ea03080c9517681774b45fda800f3329aeb"
] | [
"matminer/utils/data.py"
] | [
"from __future__ import division, unicode_literals, print_function\n\n\"\"\"\nUtility classes for retrieving elemental properties. Provides\na uniform interface to several different elemental property resources\nincluding ``pymatgen`` and ``Magpie``.\n\"\"\"\n\nimport os\nimport json\nimport six\nimport abc\nimport... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
icheft/MGT2001_package | [
"8be8f76bef803bc58eab46a788851598ec5a6e1d"
] | [
"mgt2001/team.py"
] | [
"from matplotlib import pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\nimport scipy.stats as stats\nimport statsmodels.api as sm\nimport statsmodels.stats.api as sms\nimport statsmodels.formula.api as smf\nimport statsmodels.stats.multicomp as smm\nimport statsmodels.stats.outliers_i... | [
[
"numpy.dot",
"numpy.mean",
"numpy.sign",
"scipy.stats.t.ppf",
"numpy.histogram",
"scipy.stats.chi2.sf",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"scipy.stats.chisquare",
"scipy.stats.chi2.ppf",
"scipy.stats.norm.isf",
"numpy.vdot",
"numpy.square",
"... |
achaar/autokeras | [
"7e10593b6ac88497150710a59c6807cc04d9f810"
] | [
"tests/utils.py"
] | [
"import kerastuner\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\n\nimport autokeras as ak\n\nSEED = 5\nCOLUMN_NAMES_FROM_NUMPY = [\n 'bool_',\n 'num_to_cat_',\n 'float_',\n 'int_',\n 'morethan_32_',\n 'col1_morethan_100_',\n 'col2_morethan_100_',\n 'col3_morethan_100_']\... | [
[
"numpy.concatenate",
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.datasets.imdb.load_data",
"numpy.array",
"numpy.random.rand",
"tensorflow.data.Dataset.from_tensor_slices",
"numpy.random.choice",
"numpy.random.seed",
"numpy.random.randint",
"tensorflow.keras.... |
syeehyn/spug | [
"216976e0171bbc14042377fbbb535180bd2efaf3"
] | [
"spug/data_pipeline/extraction/twitter.py"
] | [
"\"\"\"Matrix Constructor for Twitter\n\"\"\"\nfrom tqdm import tqdm\nimport pandas as pd\nfrom .base import MatrixConstructor\n\n\nclass TwitterMatrixConstructor(MatrixConstructor):\n \"\"\"Twitter Matrix Constructor\"\"\"\n\n def __init__(self, **configs):\n super().__init__(**configs)\n\n def get... | [
[
"pandas.DataFrame"
]
] |
savagewil/SavageML | [
"d5aa9a5305b5de088e3bf32778252c877faec41d"
] | [
"savageml/utility/activation_functions.py"
] | [
"from typing import Union\nimport numpy as np\n\n\ndef sigmoid_der(y: Union[int, float, np.array]) -> Union[int, float, np.array]:\n return np.multiply(np.subtract(1.0, y), y)\n\n\ndef tanh_derivative(y: Union[int, float, np.array]) -> Union[int, float, np.array]:\n return np.subtract(1.0, np.square(y))\n\n\n... | [
[
"numpy.square",
"numpy.negative",
"numpy.subtract"
]
] |
PhilippaHartley/sim-mid-pointing | [
"0f11d37e6fac231d7f20e4a7e20ee76e7d2d560f"
] | [
"beam_models/EMSS/with_elevation/SKADCBeamPatterns/2019_08_06_SKA_Ku/interpolated/interpolate_beam_Ku.py"
] | [
"import logging\nimport sys\n\nimport numpy\n\nfrom processing_library.image.operations import create_empty_image_like\nfrom rascil.processing_components.image.operations import export_image_to_fits, import_image_from_fits\n\nimport matplotlib.pyplot as plt\n\nlog = logging.getLogger()\nlog.setLevel(logging.INFO)\n... | [
[
"numpy.max",
"numpy.array",
"scipy.interpolate.interp1d",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.min",
"numpy.std",
"numpy.arange",
"matplotlib.pyplot.show",
... |
mdai/mdai-client-py | [
"59595a023e73571f36e1c7951325476d73ef3823"
] | [
"mdai/utils/transforms.py"
] | [
"import os\nimport cv2\nimport numpy as np\nimport dicom2nifti\nimport pydicom\n\nDEFAULT_IMAGE_SIZE = (512.0, 512.0)\n\n\ndef sort_dicoms(dicoms):\n \"\"\"\n Sort the dicoms based on the image position patient.\n Find most significant axis to use during sorting. The original way of sorting\n (first x t... | [
[
"numpy.max",
"numpy.min",
"numpy.nonzero",
"numpy.stack",
"numpy.clip"
]
] |
jiaojiening/pytorch-CycleGAN | [
"ab83fe4638f32cb560b8cd1117e8307153b8b5a1"
] | [
"models/bigan_model.py"
] | [
"import torch\nimport itertools\nfrom util.image_pool import ImagePool\nfrom .base_model import BaseModel\nfrom . import networks\n\n\nclass BiGANModel(BaseModel):\n def name(self):\n return 'BiGANModel'\n\n @staticmethod\n def modify_commandline_options(parser, is_train=True):\n # default GA... | [
[
"torch.nn.L1Loss"
]
] |
Valzavator/YouTubeTrendingVideosAnalysis | [
"4baca01a351a20bec04331936cd9f6eafaea815d"
] | [
"cli/analyze_data_from.py"
] | [
"import os\n#import subprocess\nimport time\nimport pycountry\nimport gc\nimport pandas as pd\nfrom pandas import DataFrame\n\nfrom cli.form import Form\nfrom database.database import Database\nimport processing_tool.data_analysis as da\nfrom util.args import Args\n\n\nclass AnalyzeDataForm(Form):\n\n def __init... | [
[
"pandas.DataFrame"
]
] |
KaiserKlayton/lpa_cnn | [
"93d7b7b31d458b9ca002612df0882aa039b5885a"
] | [
"extract_caffe_weights.py"
] | [
"#!/usr/bin/env python\n\n__author__ = \"C. Clayton Violand\"\n__copyright__ = \"Copyright 2017\"\n\n## Extracts Caffe weights from Caffe models. Writes to file at: 'weights/<model_name>/..'.\n## REQUIRED: Caffe .prototxt and .caffemodel in: 'models/<model_name>/..'\n##\n\nimport os\nimport re\nimport sys\n\nimport... | [
[
"numpy.zeros"
]
] |
deep-learning/facenet | [
"e74cf7c2a29477ed76cd34e243f993090c6f6987"
] | [
"src/align/align_dataset_mtcnn.py"
] | [
"\"\"\"Performs face alignment and stores face thumbnails in the output directory.\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# i... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.minimum",
"tensorflow.Graph",
"scipy.misc.imresize",
"scipy.misc.imread",
"tensorflow.ConfigProto",
"numpy.vstack",
"numpy.argmax",
"numpy.power",
"numpy.maximum",
"numpy.squeeze",
"tensorflow.GPUOptions",
"scipy.misc.i... |
googlr/Parallelograms-Detection | [
"7e53b809955973fbe4f2c535fce6019cc52072b2"
] | [
"pd.py"
] | [
"# -*- coding: utf-8 -*-\n\n# The program will consist of three steps:\n#\t(1) detect edges using the Sobel’s operator,\n#\t(2) detect straight line segments using the Hough Transform, and\n#\t(3) detect parallelograms from the straight-line segments detected in step (2).\n# In step (1), compute edge magnitude usin... | [
[
"numpy.array",
"matplotlib.pylab.savefig",
"numpy.zeros",
"numpy.copy",
"numpy.ones",
"matplotlib.pylab.close",
"numpy.amax",
"numpy.fromfile",
"matplotlib.image.imsave",
"matplotlib.pylab.imshow"
]
] |
fujingguo/tf_adapter_npu | [
"96e796fca0359b984a8504f920844ae572b5d30e"
] | [
"tf_adapter/python/npu_bridge/estimator/npu_ops.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# Copyright (c) Huawei Technologies Co., Ltd. 2019-2021. 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#... | [
[
"tensorflow.python.framework.random_seed.get_seed",
"tensorflow.python.ops.nn_ops._get_noise_shape",
"tensorflow.python.framework.ops.convert_to_tensor",
"tensorflow.python.framework.ops.RegisterGradient",
"tensorflow.python.eager.context.executing_eagerly"
]
] |
pllim/halotools | [
"6499cff09e7e0f169e4f425ee265403f6be816e8",
"6499cff09e7e0f169e4f425ee265403f6be816e8",
"6499cff09e7e0f169e4f425ee265403f6be816e8"
] | [
"halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/conc_mass/dutton_maccio14.py",
"halotools/empirical_models/phase_space_models/analytic_models/satellites/nfw/tests/test_biased_nfw/test_biased_nfw_phase_space.py",
"halotools/empirical_models/phase_space_models/analytic_models/monte_c... | [
"\"\"\"\n\"\"\"\nfrom __future__ import division, print_function, absolute_import, unicode_literals\n\nimport numpy as np\n\n\n__all__ = ('dutton_maccio14', )\n\n\ndef dutton_maccio14(mass, redshift):\n r\"\"\" Power-law fit to the concentration-mass relation from\n Equations 12 & 13 of Dutton and Maccio 2014... | [
[
"numpy.log10",
"numpy.exp"
],
[
"numpy.array",
"numpy.zeros",
"numpy.median",
"numpy.mean",
"numpy.allclose",
"numpy.all",
"numpy.linspace"
],
[
"numpy.random.normal",
"numpy.array",
"numpy.sin",
"numpy.zeros_like",
"numpy.digitize",
"numpy.where... |
FarnazAdib/Crash_course_on_RL | [
"e645594524130e060954f73ab7d59294346fdc9b"
] | [
"lq/policies.py"
] | [
"import numpy as np\n\nclass LinK:\n def __init__(self, K):\n # self.rand_seed = 1\n # np.random.seed(self.rand_seed)\n self.K = K\n self.m, self.n = self.K.shape\n self.stddev = 0.0\n\n def lin_policy(self, x):\n '''\n A linear policy u=K x\n ... | [
[
"numpy.random.uniform"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.