repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
AshleySetter/optosim | [
"248d18216bbe8c494d43b2ed43646546ca30dc6b"
] | [
"optosim/optosim/deprecated_code/sde_solver_deprecated/setup.py"
] | [
"from distutils.core import setup, Extension\nfrom Cython.Build import cythonize\nimport numpy \n\nextensions = [Extension(\n name=\"solve\",\n sources=[\"solve.pyx\"],\n include_dirs=[numpy.get_include()],\n )\n]\n\nsetup(\n ext_modules = cythonize(extensions),\n)\n"
] | [
[
"numpy.get_include"
]
] |
Qcircuits/exopy_hqc_legacy | [
"1566f08e88c828b5410c02347b3539252e197d40"
] | [
"exopy_hqc_legacy/tasks/tasks/util/load_tasks.py"
] | [
"# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# Copyright 2015-2018 by ExopyHqcLegacy Authors, see AUTHORS for more details.\n#\n# Distributed under the terms of the BSD license.\n#\n# The full license is in the file LICENCE, distributed with this softwar... | [
[
"numpy.array",
"numpy.genfromtxt",
"numpy.ones"
]
] |
xiaoyu2018/QuantumCnn--NetworkAttackDetection | [
"fe96b3ab9641e0c2a4df421f3fa470be1c4061ed"
] | [
"prehandle.py"
] | [
"#coding:utf-8\r\n\r\n#KDD99数据集预处理\r\n#共使用39个特征,去除了原数据集中20、21号特征\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport csv\r\nfrom datetime import datetime\r\nfrom sklearn import preprocessing # 数据标准化处理\r\n\r\n\r\n\r\n#定义KDD99字符型特征转数值型特征函数\r\ndef char2num(sourceFile, handledFile):\r\n print('START: 字符型特征转数值... | [
[
"numpy.random.seed",
"numpy.tile",
"numpy.random.shuffle",
"pandas.DataFrame",
"numpy.seterr",
"numpy.array",
"sklearn.preprocessing.scale"
]
] |
TuTou1024/computer-vision | [
"bdb71c3037c02e594900ae39367b7ecd69f9fc30"
] | [
"exp3/blend.py"
] | [
"import math\nimport sys\n\nimport cv2\nimport numpy as np\n\n\nclass ImageInfo:\n def __init__(self, name, img, position):\n self.name = name\n self.img = img\n self.position = position\n\n\ndef imageBoundingBox(img, M):\n \"\"\"\n This is a useful helper function that you might ch... | [
[
"numpy.dot",
"numpy.meshgrid",
"numpy.min",
"numpy.linalg.inv",
"numpy.arange",
"numpy.linspace",
"numpy.dstack",
"numpy.ones",
"numpy.max",
"numpy.identity",
"numpy.array",
"numpy.zeros"
]
] |
webclinic017/Backtrader-14 | [
"b10d816ddfecef9cdafa5f936081a8035c5c49ba"
] | [
"samples/TURTLE_RULES/utils.py"
] | [
"import pandas as pd\n\ndef read_bars(csv_file: str)->pd.DataFrame:\n dtypes = {'exchange': 'category', 'market_type': 'category', 'pair': 'category', 'bar_type': 'category',\n 'bar_size':'category', 'open': 'float32', 'timestamp': 'int64', 'timestamp_end': 'int64',\n 'high': 'float32',... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
carlocontaldi/hellofresh_case_study | [
"08c060f5a620f51beec7fadebe5853a4b020d5a0"
] | [
"code/evaluate.py"
] | [
"from sklearn.metrics import accuracy_score, classification_report\r\nfrom code import train, test, visualize\r\n\r\n# Iteration 8\r\ndef eval_4(X_train, y_train, X_test, y_test):\r\n\tprint('Evaluate')\r\n\tbest_params, y_pred = train.train_4(X_train, y_train)\r\n\taccuracy = accuracy_score(y_train, y_pred)\r\n\tp... | [
[
"sklearn.metrics.classification_report",
"sklearn.metrics.accuracy_score"
]
] |
kkahloots/Variational-Autoencoders | [
"b71a7448f47ec5b5ab752adcf0e2d41cca160726"
] | [
"utils/utils.py"
] | [
"import math\r\nimport random\r\n\r\nimport numpy as np\r\nimport dask.array as da\r\nfrom dask import delayed\r\nimport dask.dataframe as dd\r\nfrom time import strftime\r\n\r\n\r\n\r\nimport os\r\nimport shutil\r\nimport time\r\n\r\n\r\nimport tensorflow as tf\r\nfrom sklearn.preprocessing import MinMaxScaler\r\n... | [
[
"numpy.unique",
"numpy.reshape",
"tensorflow.reduce_mean",
"numpy.vstack",
"numpy.ndarray",
"numpy.random.shuffle",
"numpy.ones",
"tensorflow.constant_initializer",
"tensorflow.name_scope",
"numpy.zeros",
"sklearn.preprocessing.MinMaxScaler",
"tensorflow.variable_sc... |
janihuuh/cd8_tlgll_manu | [
"fad8935bf6f7b99bcdc7d3c0b899d20a2975a636"
] | [
"python/run_tcrgp.py"
] | [
"import os\nme=\"janihuuh\"\n# os.chdir(\"/Users/hru/Dropbox/MelanoMAP/src/jani/python/tcrgp/\")\nos.chdir(\"/Users/janihuuh/Dropbox/MelanoMAP/src/jani/python/tcrgp/\")\n\nimport tcrgp\nimport pickle\nimport ast\nimport csv\nimport numpy as np\nfrom matplotlib import pyplot as plt\nplt.style.use('fivethirtyeight')\... | [
[
"matplotlib.pyplot.style.use"
]
] |
rezaabdullah/data_science_portfolio | [
"29ccb3409441d44696eb24b9191e4d7b1810b6bf"
] | [
"disaster_response_pipeline/data/process_data.py"
] | [
"# Import libraries\nimport sys\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\n# Load datasets\ndef load_data(messages_filepath, categories_filepath):\n \"\"\"\n Method for reading two CSV files and merge into one pandas dataframe\n\n Args:\n messages_filepath (str): The .csv file pat... | [
[
"pandas.merge",
"pandas.read_csv",
"pandas.to_numeric",
"pandas.concat"
]
] |
yunqiic/DeepSolarV1 | [
"2126aa1d686edc8728502ab53c7392186a65720b"
] | [
"inception/slim/losses.py"
] | [
"# Copyright 2016 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 applicab... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.multiply",
"tensorflow.reduce_mean",
"tensorflow.cast",
"tensorflow.contrib.nn.deprecated_flipped_softmax_cross_entropy_with_logits",
"tensorflow.nn.l2_loss",
"tensorflow.add",
"tensorflow.name_scope",
"tensorflow.add_to_collection",
... |
Sambor123/DRL_Navigation | [
"3694c1e99d26e448777f12eb5afd7bf22bd2e15b"
] | [
"keyboard_agent.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function\n\nimport sys\nimport signal\nimport argparse\nimport numpy as np\n\nfrom scene_loader import THORDiscreteEnvironment\nfrom utils.tools import SimpleImageViewer\n\n#\n# Navigate the scene using your keyboard\n#\n\ndef key_press(k... | [
[
"numpy.zeros_like",
"numpy.where"
]
] |
caiolang/voiture-autonome | [
"92def5b8ccd24cd4deab759df9bed7a028e9339d"
] | [
"DOCS/6-References/documentation_equipe_2019/trajectoire_2019/testtrouvecible.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nimport copy\r\nfrom zonesafe import *\r\nfrom adaptevitesserelat import *\r\nfrom trouvecible import *\r\n\r\norientation=0\r\norientationm1=0\r\nN=720\r\nlidar1=[]\r\nlidar2=[]\r\nrv=20\r\nm=5\r\ni=0\r\nr1=50\r\nr2=41\r\nepsilon=0.15\r\nalpha=15 #angle ... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
gokceneraslan/scib | [
"91cfe2e4872230d8806c8f9ad5a0c251f268fdc4"
] | [
"tests/metrics/test_kbet.py"
] | [
"import numpy as np\n\nfrom tests.common import *\n\n\ndef test_kbet(adata_pca):\n score = scIB.me.kBET(\n adata_pca,\n batch_key='batch',\n label_key='celltype',\n embed='X_pca'\n )\n score = 1 - np.nanmean(score['kBET'])\n LOGGER.info(f\"score: {score}\")\n assert np.isn... | [
[
"numpy.isnan",
"numpy.nanmean"
]
] |
fishfishson/MeshCNN | [
"8b4ddccf79638c0ca6c1ba17bec287981ddb65a1"
] | [
"models/attention.py"
] | [
"###########################################################################\n# Created by: CASIA IVA\n# Email: jliu@nlpr.ia.ac.cn\n# Copyright (c) 2018\n###########################################################################\n\nimport numpy as np\nimport torch\nimport math\nfrom torch.nn import Module, Sequent... | [
[
"torch.nn.Softmax",
"torch.max",
"torch.zeros",
"torch.nn.Conv3d",
"torch.bmm"
]
] |
nitthapr/transformers | [
"f8bf5713fa61a5009d0b66dfaa4e320b316ab1aa"
] | [
"src/transformers/modeling_bert.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"torch.nn.Softmax",
"torch.cat",
"torch.zeros",
"torch.nn.Embedding",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"torch.from_numpy",
"torch.tensor",
"torch.arange",
"tensorflow.train.list_variables",
"torch.nn.functional.softplus",
"torch.ful... |
jlikhuva/loompy | [
"b694a4d299604299b27e2a407f508ccf6baa8823"
] | [
"loompy/loom_validator.py"
] | [
"import h5py\nfrom typing import *\nimport logging\nimport numpy as np\nimport loompy\n\nfrom .utils import get_loom_spec_version\n\n\nclass LoomValidator:\n\tdef __init__(self, version: str = None) -> None:\n\t\t\"\"\"\n\t\tArgs:\n\t\t\tversion: \t\tThe Loom file format version to validate against (\"3.0.0\", \"2.... | [
[
"numpy.min",
"numpy.unique",
"numpy.issubdtype",
"numpy.max",
"numpy.isin"
]
] |
griffij/QuakeRates | [
"70069bb271a1987e72fcbdf3aa0c0a8a79591580"
] | [
"utilities/bilinear.py"
] | [
"\"\"\"Functions for bi-linear fitting\nWith thanks to Trevor Allen, Geoscience Australia\n\"\"\"\n\nimport numpy as np\nfrom numpy import zeros_like\nfrom scipy.odr import Data, Model, ODR, models\nimport scipy.odr.odrpack as odrpack\n\n# functions to return binary arrays\ndef highside(x, hx):\n from numpy impo... | [
[
"numpy.log10",
"numpy.zeros_like"
]
] |
bsulman/CORPSE_rhizosphere_Moore_etal_2019 | [
"cbe182ddaaf38b21291dc757a23c2dba1412e7b5"
] | [
"rhiz-sim.py"
] | [
"import CORPSE\nimport pandas\nfrom pylab import *\n\n# 5% clay\nparams={\n 'vmaxref':[1000,50,600], # Relative maximum enzymatic decomp rates. Multiply by 0.022 to get actual turnover rates (to take moisture equation into account)\n 'Ea':[37e3,54e3,50e3], # Activation energy\n 'kC':[0.01,0.01,0.01], ... | [
[
"pandas.read_excel",
"pandas.read_csv"
]
] |
syoyo/nnabla | [
"e94bac5bed65337010e2ac07a5937fb862ab2dd8"
] | [
"python/test/function/test_random_functions.py"
] | [
"# Copyright (c) 2017 Sony Corporation. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"numpy.all",
"numpy.array",
"numpy.isclose"
]
] |
ajitesh-30/ImageTagging | [
"e71cd83cd0c189ec2f64ed3219a89c7f4d1693d4"
] | [
"Loading Images/test1.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Jun 28 14:14:13 2018\r\n\r\n@author: HP-USER\r\n\"\"\"\r\n\r\nimport os\r\n\r\nroot='G:/INTERNSHIP IIITA/Dataset/NUS-WIDE/Testing_Image/'\r\ndirlist = [ item for item in os.listdir(root) if os.path.isdir(os.path.join(root, item)) ]\r\nprint (dirlist)\r\n\r\n\r\n\... | [
[
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.subplot",
"numpy.sort"
]
] |
nicolas-suarez/urban_emissions | [
"6a16bc52ad7c6fc05a583c1cff21ba32f8ad3090"
] | [
"build_dataset.py"
] | [
"import h5py\nimport numpy as np\nimport os\nimport pandas as pd\nimport pickle\nimport random\nimport utils\n\n\n# Define global means over each channel of the training set. These are\n# estimated means in order to compute channel standard deviations when\n# building the dataset\nGLOBAL_MEANS = np.array([0.2633464... | [
[
"pandas.read_csv",
"numpy.sqrt",
"numpy.random.seed",
"numpy.nditer",
"numpy.arange",
"numpy.random.permutation",
"numpy.mean",
"numpy.array",
"numpy.zeros"
]
] |
chrisconlon/DiversionReplication | [
"12d6f83a8f4621323e1542167f375d8dcf76b80a"
] | [
"code/tab34_params.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jul 27 15:07:45 2020\n\n@author: chitra\n\nMake Table 3: Parameter Estimates\nNevo Results\nBLP Results\n\nMake Table 4: PostEstimation Information for Table 2\n\nFirst, run_blp_cases and run_nevo_cases \nThen this file\n\n\"\"\"\n\nimport num... | [
[
"pandas.read_parquet",
"pandas.read_csv",
"pandas.Series",
"pandas.DataFrame"
]
] |
jw176/img2ascii | [
"61814be2103aa6f929b1dfc020b0b1be3697d903"
] | [
"main.py"
] | [
"import shutil\nfrom collections import namedtuple\nimport itertools\nimport time\nimport argparse\n\nimport numpy as np\nfrom PIL import ImageFont, Image, ImageDraw, ImageEnhance\nfrom colorama import Fore, init, Back, Style\nfrom numba import njit\n\n\n\ninit()\n\nColor = namedtuple('Color', ['name', 'fore', 'bac... | [
[
"numpy.array",
"numpy.abs"
]
] |
Soyuen/age_model_tfapi | [
"2ed7825f8c6aa800766c3efa0495146f4eaa8b3c"
] | [
"training/aec_model.py"
] | [
"import logging\r\nimport sys\r\nimport numpy as np\r\nfrom tensorflow.keras import Input, Model\r\nfrom tensorflow.keras.layers import Activation, Dense, Flatten, Dropout, Lambda,Conv2D,AveragePooling2D,BatchNormalization\r\nimport tensorflow as tf\r\nfrom generators import ker_init\r\nimport tensorflow.compat.v1 ... | [
[
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.keras.layers.Activation",
"numpy.random.seed",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.expand_dims",
"tensorflow.... |
mvdelt/coco-analyze | [
"38354dad9cdc838a58a10606eed8cf080ec00009"
] | [
"analysisAPI/utilities.py"
] | [
"## imports\nimport os, sys, time, json\nimport numpy as np\nfrom colour import Color\nimport matplotlib.pyplot as plt\nimport matplotlib.path as mplPath\nfrom matplotlib.collections import PatchCollection\nfrom matplotlib.patches import Polygon\n# from scipy.misc import imresize # i. 여기서 imresize 쓰지도 않는데? 근데문제는 sc... | [
[
"matplotlib.pyplot.imshow",
"numpy.sqrt",
"matplotlib.pyplot.plot",
"numpy.all",
"numpy.max",
"numpy.exp",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis",
"numpy.count_nonzero",
"numpy.zeros",
"matplotlib... |
PedroAugustoDev/Algoritmos-em-Python | [
"aae67133c249ca67a597431b3fc6d46d80a54a7e"
] | [
"src/matematica/matrizes/soma.py"
] | [
"# Lib para operações matemáticas mais complexas\nimport numpy as np\n\na = np.matrix([[1,2,3], [4,5,6]])\nb = np.matrix([ [0,0],[2,3], [1,1]])\n\n\nc = np.matrix([[1,1], [1,1]])\n''' \nMATRIX C = |1 1|\n |1 1|\n \n'''\n\n\n\n\ne = np.matrix([[1,2,3], [4,5,6], [7,8,9]])\nf = np.matrix([[1... | [
[
"numpy.matrix"
]
] |
m3rlin45/pytorch | [
"026cfe85b4f7dc7b63a53b357500014114d749ee"
] | [
"torch/testing/_internal/distributed/distributed_test.py"
] | [
"import copy\nimport itertools\nimport math\nimport os\nimport random\nimport sys\nimport tempfile\nimport time\nimport unittest\nfrom collections import namedtuple\nfrom contextlib import contextmanager, suppress\nfrom datetime import timedelta\nfrom functools import reduce\nfrom typing import Union, NamedTuple, C... | [
[
"torch.distributed.scatter",
"torch.zeros",
"torch.testing._internal.common_distributed.nccl_skip_if_lt_x_gpu",
"torch.distributed.algorithms.ddp_comm_hooks.post_localSGD_hook.PostLocalSGDState",
"torch.cuda.amp.autocast",
"torch.distributed.distributed_c10d._get_default_group",
"torch... |
k4rma99/Year_End_Project | [
"a21541afb01c0701e59c315946278988fd8e76aa"
] | [
"src/train_abstractive.py"
] | [
"#!/usr/bin/env python\n\"\"\"\n Main training workflow\n\"\"\"\nfrom __future__ import division\n\nimport argparse\nimport glob\nimport os\nimport random\nimport signal\nimport time\n\nimport torch\nfrom pytorch_transformers import BertTokenizer\n\nimport distributed\nfrom models import data_loader, model_build... | [
[
"torch.cuda.manual_seed",
"torch.cuda.set_device",
"torch.load",
"torch.manual_seed",
"torch.multiprocessing.get_context"
]
] |
mas-veritas2/veritastool | [
"37f36b620c3637e230efd8ed69cbb5e4ef87fe2b"
] | [
"veritastool/examples/customer_marketing_example/measures.py"
] | [
"\"\"\"\nBasic fairness measures specific to uplift models.\n\nWritten by Daniel Steinberg and Lachlan McCalman,\nGradient Institute Ltd. (info@gradientinstitute.org).\n\nCopyright © 2020 Monetary Authority of Singapore\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file ... | [
[
"sklearn.metrics.r2_score",
"numpy.logical_and",
"numpy.random.choice",
"numpy.linspace",
"numpy.arange",
"numpy.median",
"sklearn.preprocessing.OneHotEncoder",
"numpy.cumsum",
"pandas.DataFrame",
"numpy.logical_or",
"scipy.stats.multinomial",
"sklearn.metrics.log_l... |
sigeisler/robustness_of_gnns_at_scale | [
"0f4844711ace599f54c2abc760b53680a80d6a32"
] | [
"rgnn_at_scale/attacks/prbcd_old.py"
] | [
"import logging\n\nfrom collections import defaultdict\nimport math\nfrom typing import Tuple\nfrom typeguard import typechecked\n\nfrom tqdm import tqdm\nimport numpy as np\nimport torch\nimport torch_sparse\nfrom torch_sparse import SparseTensor\nfrom rgnn_at_scale.helper import utils\nfrom rgnn_at_scale.attacks.... | [
[
"torch.cuda.synchronize",
"torch.randint",
"torch.cat",
"torch.topk",
"torch.zeros_like",
"torch.cuda.empty_cache",
"torch.tensor",
"torch.full_like",
"torch.unique",
"torch.no_grad",
"torch.bernoulli",
"torch.where",
"torch.cuda.is_available",
"torch.stack"... |
betaBison/umnitsa_rpi | [
"c9a225781d91c1fdf16eb2234af8ff1784876301"
] | [
"src/umnitsa_hardware/src/motors.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nAuthor: D. Knowles\nDesc : ROS node that outputs to the umnitsaControl board\n\"\"\"\nimport os\nimport time\nimport rospy\nfrom geometry_msgs.msg import Twist\nfrom umnitsa_msgs.msg import Joystick\nif (os.environ['ARCHITECTURE'] == 'raspi'):\n\timport RPi.GPIO as GPIO\nelif (os.en... | [
[
"numpy.array"
]
] |
wennyyuan/pytorch3d | [
"4bb3fff52b7e26ec0f013021cb26fab7db3d8e0b"
] | [
"docs/examples/pulsar_optimization_unified.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\"\"\"\nThis example demonstrates scene optimization with the PyTorch3D\npulsar interface. For this, a reference image has been pre-generated\n(you can find it at `../../tests/pulsar/reference/examples_TestRenderer_tes... | [
[
"torch.nn.Parameter",
"torch.ones",
"torch.zeros",
"torch.manual_seed",
"torch.eye",
"torch.tensor",
"torch.no_grad",
"torch.rand",
"torch.optim.SGD",
"torch.device",
"torch.clamp"
]
] |
JoOkuma/pytorch-metric-learning | [
"4b17eb269d247c8725afcba100f2214680060ea3"
] | [
"examples/example_TrainWithClassifier.py"
] | [
"# The testing module requires faiss\r\n# So if you don't have that, then this import will break\r\nfrom pytorch_metric_learning import losses, miners, samplers, trainers, testers\r\nimport pytorch_metric_learning.utils.logging_presets as logging_presets\r\nimport numpy as np\r\nfrom torchvision import datasets, mo... | [
[
"torch.nn.CrossEntropyLoss",
"torch.cuda.is_available"
]
] |
xk97/test_stats | [
"7f985988e72bd375c2011b29d42315a62da7c86c"
] | [
"monty_hall.py"
] | [
"#%% Monty Hall problem\n# n_doors with 1 door with award, pick inital y, k rounds of opportunity to switch\nimport numpy as np\n\nn_trails, n_doors = 1000, 3\nk = n_doors - 2\n\nidx_X = np.random.choice(range(n_doors), n_trails)\nX = np.zeros((n_trails, n_doors))\nfor i in range(n_trails):\n X[i, idx_X[i]] = 1\... | [
[
"numpy.zeros",
"numpy.sum"
]
] |
lewisyangliu/LDP | [
"37d5b7a0ed08bd281fc880f8829535047c5a9e1c"
] | [
"code/model/__init__.py"
] | [
"import os\nfrom importlib import import_module\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\n\nclass Model(nn.Module):\n def __init__(self, args, ckp):\n super(Model, self).__init__()\n print('Making model...')\n\n self.precision = args.precision\n self... | [
[
"torch.device",
"torch.load"
]
] |
LaiYongqiang/mindspore | [
"1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e"
] | [
"mindspore/nn/optim/adam.py"
] | [
"# Copyright 2020-2021 Huawei Technologies Co., Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applica... | [
[
"numpy.array"
]
] |
aws-patlin/ml-io | [
"047e7d40609ced6f839d0b08d1917e9742a785af"
] | [
"src/mlio-py/mlio/integ/scipy.py"
] | [
"# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"... | [
[
"scipy.sparse.coo_matrix",
"numpy.array"
]
] |
lih627/MSMLNet | [
"868500144edd60599c804203534e08dd672a647a"
] | [
"model/mobilenetv3.py"
] | [
"\"\"\"\nCreates a MobileNetV3 Model as defined in:\nAndrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, Quoc V. Le, Hartwig Adam. (2019).\nSearching for MobileNetV3\narXiv preprint arXiv:1905.02244.\n\"\"\"\n\nimport torch.nn as nn... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.ReLU6",
"torch.load",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.Identity",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
akensert/autoencoder-chromatogram-enhancement | [
"9aeead5ba33bd97711c4de27841e9827f326b575"
] | [
"src/generator.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\n\nclass Generator(tf.keras.utils.Sequence):\n\n def __init__(self, path, batch_size, num_examples=190_000, random_seed=42):\n self.path = path\n self.batch_size = batch_size\n self.num_examples = num_examples\n self.random_seed = random_... | [
[
"numpy.random.seed",
"numpy.arange",
"numpy.random.shuffle",
"numpy.load",
"numpy.array",
"numpy.empty"
]
] |
pandrey-fr/csvtools | [
"9c11bb5a1564f5774117fd33682727f51c51bd58"
] | [
"csvtools/_csv_writers.py"
] | [
"# coding: utf-8\n\n\"\"\"Classes to handle record-type specific dynamic csv storage.\"\"\"\n\nfrom functools import reduce\n\nimport pandas as pd\nfrom yaptools import check_type_validity\n\nfrom csvtools._csv_writer import (\n AbstractCsvWriter, CSV_WRITER_DOCSTRING, CSV_WRITER_EXAMPLE\n)\n\n\nclass DictCsvWri... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
psimaj/numpy | [
"b03e4dc36b1b4441fbc955920e0fe92fd39f095e"
] | [
"numpy/core/tests/test_multiarray.py"
] | [
"try:\n # Accessing collections abstract classes from collections\n # has been deprecated since Python 3.3\n import collections.abc as collections_abc\nexcept ImportError:\n import collections as collections_abc\nimport tempfile\nimport sys\nimport shutil\nimport warnings\nimport operator\nimport io\nim... | [
[
"numpy.sqrt",
"numpy.core._multiarray_tests.test_as_c_array",
"numpy.all",
"numpy.min_scalar_type",
"numpy.exp",
"numpy.testing.break_cycles",
"numpy.where",
"numpy.place",
"numpy.matmul",
"numpy.core._multiarray_tests.test_pydatamem_seteventhook_end",
"numpy.core._mult... |
kaymes/terracotta | [
"30730e78e204b573d1c3eb755a0107e3f73021f0"
] | [
"terracotta/image.py"
] | [
"\"\"\"image.py\n\nUtilities to create and manipulate images.\n\"\"\"\n\nfrom typing import Sequence, Tuple, TypeVar, Union\nfrom typing.io import BinaryIO\n\nfrom io import BytesIO\n\nimport numpy as np\nfrom PIL import Image\n\nfrom terracotta.profile import trace\nfrom terracotta import exceptions, get_settings\... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.clip"
]
] |
alexstaley/machine-learning | [
"15a880638e45da64a4d52654c2757684ddd11cac"
] | [
"kMeans/Getters.py"
] | [
"\"\"\"\n Alex Staley -- Student ID: 919519311\n Assignment 4 -- March 2020\n\n This file defines the low-level functionality of the K-clusters\n algorithm. Implemented below are the following functions:\n\n # getRandomCenters() picks NUM_CLUSTERS random training\n objects to use a... | [
[
"numpy.log2",
"numpy.subtract",
"numpy.size",
"numpy.copy",
"numpy.mean",
"numpy.delete",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
MohammadAminAlamalhoda/Deep-Object | [
"1f96e7f2d31e1d45d6ed9240b23cae5000276381"
] | [
"datas.py"
] | [
"import torch\nfrom torch.utils.data import DataLoader, Dataset, random_split\nimport torchvision.transforms as transforms\nfrom PIL import Image\nimport mat73\nimport numpy as np\nimport os\nimport random\nimport utils\n\nimport torchvision.transforms.functional as TF\n\nclass ODD_Dataset(Dataset):\n\n '''\n ... | [
[
"torch.Generator",
"torch.zeros",
"numpy.unique",
"numpy.min",
"torch.utils.data.DataLoader",
"torch.tensor",
"numpy.max",
"numpy.array",
"numpy.where",
"torch.as_tensor"
]
] |
axb2035/keras-gym | [
"076ebbca022f4dbdcae2a14967f824652fe473c3"
] | [
"keras_gym/caching/test_experience_replay.py"
] | [
"import gym\nimport numpy as np\nfrom .experience_replay import ExperienceReplayBuffer\n\n\nclass MockEnv:\n action_space = gym.spaces.Discrete(7)\n\n def __init__(self, num_frames):\n self.num_frames = num_frames\n\n\nclass TestExperienceReplayBuffer:\n N = 7\n S = np.expand_dims(np.arange(N), a... | [
[
"numpy.clip",
"numpy.arange",
"numpy.ones",
"numpy.testing.assert_array_equal",
"numpy.argmax",
"numpy.zeros"
]
] |
spongebob03/PyTorch-tutorials-kr | [
"efe11ebede0d3384aacd1bdad5881ea8794223c8"
] | [
"intermediate_source/speech_command_classification_with_torchaudio_tutorial.py"
] | [
"\"\"\"\nSpeech Command Classification with torchaudio\n******************************************\n\nThis tutorial will show you how to correctly format an audio dataset and\nthen train/test an audio classifier network on the dataset.\n\nColab has GPU option available. In the menu tabs, select “Runtime” then\n“Cha... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.functional.log_softmax",
"torch.nn.utils.rnn.pad_sequence",
"torch.utils.data.DataLoader",
"torch.nn.MaxPool1d",
"torch.nn.Linear",
"torch.cuda.is_available",
"torch.nn.Conv1d",
"torch.stack",
"torch.nn.functional.avg_pool1d",
"torch.op... |
snakeztc/NeuralDialog-CVAE | [
"c8b61f23938ac7c95fc129f63ad921a310c6d425"
] | [
"models/decoder_fn_lib.py"
] | [
"# Copyright (C) 2017 Tiancheng Zhao, Carnegie Mellon University\nfrom tensorflow.python.framework import dtypes\nfrom tensorflow.python.util import nest\nfrom tensorflow.python.framework import ops\nfrom tensorflow.python.ops import array_ops\nfrom tensorflow.python.ops import control_flow_ops\nfrom tensorflow.... | [
[
"tensorflow.concat",
"tensorflow.python.ops.array_ops.shape",
"tensorflow.zeros",
"tensorflow.slice",
"tensorflow.python.ops.math_ops.argmax",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.expand_dims",
"tensorflow.python.ops.math_ops.equal",
"tensorflow.python.ops.... |
eduguerdex/BRT_ACTION | [
"01fc214e5fc97e871a379cd85052664a5b404e8a"
] | [
"src/BraccioDEV.py"
] | [
"import numpy as np\r\nfrom copy import copy\r\n#import rbdl\r\ncos=np.cos; sin=np.sin; pi=np.pi\r\n\r\ndef dh(d, theta, a, alpha):\r\n \"\"\"\r\n Matriz de transformacion homogenea asociada a los parametros DH.\r\n Retorna una matriz 4x4\r\n \"\"\"\r\n sth = np.sin(theta)\r\n cth = np.cos(theta)\... | [
[
"numpy.dot",
"numpy.linalg.norm",
"numpy.cos",
"numpy.sin",
"numpy.linalg.pinv",
"numpy.array",
"numpy.zeros"
]
] |
lucidrains/memorizing-transformers-pytorch | [
"83fa1479d6f7881dd977fbff55681e709e3b250e"
] | [
"memorizing_transformers_pytorch/knn_memory.py"
] | [
"import os\nimport math\nimport torch\nimport faiss\nimport numpy as np\nfrom pathlib import Path\nfrom functools import wraps\n\nfrom contextlib import ExitStack, contextmanager\n\nfrom einops import rearrange\nfrom einops_exts import rearrange_with_anon_dims, check_shape\n\n# multiprocessing\n\nfrom joblib import... | [
[
"numpy.ascontiguousarray",
"numpy.arange",
"numpy.memmap",
"torch.from_numpy",
"numpy.full",
"numpy.concatenate",
"numpy.zeros_like",
"torch.stack",
"numpy.array",
"numpy.zeros",
"numpy.where",
"numpy.empty"
]
] |
hermawanmulyono/ml | [
"bf617ee864134fb0eb9f3cb68c88d6efa8acd150"
] | [
"assignment1/utils/plots.py"
] | [
"import copy\nimport logging\nimport multiprocessing\nimport time\nfrom typing import List, Iterable, Optional, Union, Tuple\n\nimport numpy as np\nimport plotly.figure_factory as ff\nfrom plotly import graph_objects as go\nfrom plotly.subplots import make_subplots\nfrom sklearn.exceptions import ConvergenceWarning... | [
[
"numpy.logical_not",
"numpy.array_equal",
"numpy.min",
"sklearn.utils._testing.ignore_warnings",
"numpy.arange",
"sklearn.utils.shuffle",
"numpy.reshape",
"sklearn.model_selection.learning_curve",
"numpy.concatenate",
"numpy.max",
"numpy.argsort",
"numpy.array",
... |
laranjma/robmooc | [
"e0dfb04117ad7fc69cd871c0e7e00fca85572164"
] | [
"py_scripts/roblib.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom numpy import mean,pi,cos,sin,sqrt,tan,arctan2,exp,dot,array,log,inf, eye, zeros, ones, arange,reshape,concatenate,diag\r\nfrom matplotlib.pyplot import *\r\nfrom numpy.random import uniform as rand\r\nfrom numpy.random import randn as randn\r\nfrom nump... | [
[
"numpy.random.multivariate_normal",
"numpy.concatenate",
"numpy.arctan2",
"numpy.random.randn",
"numpy.mean",
"matplotlib.patches.Polygon",
"numpy.linalg.eig",
"numpy.arange",
"numpy.sin",
"scipy.linalg.norm",
"numpy.log",
"numpy.linalg.inv",
"matplotlib.patches... |
AhmedHani/Kaggle-Machine-Learning-Competitions | [
"b306816463affb0595618844ae479243e505418d"
] | [
"Easy/What's Cooking/logistic_regression.py"
] | [
"__author__ = 'Ahmed Hani Ibrahim'\n\nfrom sklearn.cross_validation import cross_val_score\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.linear_model import LogisticRegression, LinearRegression\nfrom sklearn.naive_bayes import BernoulliNB\nfrom sklearn import svm\nfrom get_data import *\nfrom g... | [
[
"sklearn.linear_model.LogisticRegression"
]
] |
bbueno5000/sc2_agents | [
"ea7b610667c37e528597c23589b91f167a1ea1fe"
] | [
"sc2_agents/agents/collect_mineral_shards.py"
] | [
"# MIT License\n#\n# Copyright (c) 2018 Benjamin Bueno (bbueno5000)\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#... | [
[
"numpy.array"
]
] |
zhaolongkzz/ROS | [
"52c70d9d22fe1714c438312fde61214920a4dc3c"
] | [
"BIRL_modular_robot/mr_setup_detect/scripts/setup_detector.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nlinkeway\nJan. 2017\n\nPARAMETERS:\n + /robot_name ~ default: 'robot'\nSUBSCRIPTIONS:\n + ar_pose_marker (ar_track_alvar_msgs/AlvarMarkers) ~ pose of all markers detected by ar_track_alvar\nOUTPUT:\nAutomatically generate robot.urdf.xacro to [PATH_TO_MR_DESCRIPTION_PACKAGE]/robot... | [
[
"numpy.dot",
"numpy.array",
"numpy.linalg.norm",
"numpy.cross"
]
] |
russellcaughey/ml-agents | [
"493c75bf683d35d512ae6fb57d4a1a332116df15"
] | [
"gym-unity/gym_unity/envs/unity_env.py"
] | [
"import logging\nimport itertools\nimport gym\nimport numpy as np\nfrom mlagents.envs import UnityEnvironment\nfrom gym import error, spaces\n\n\nclass UnityGymException(error.Error):\n \"\"\"\n Any error related to the gym wrapper of ml-agents.\n \"\"\"\n\n pass\n\n\nlogging.basicConfig(level=logging.I... | [
[
"numpy.array"
]
] |
WadeYin9712/GD-VCR | [
"001652810294a7de25ae96bcbbde515873871159"
] | [
"visualbert/dataloaders/coco_dataset.py"
] | [
"import os\nimport random\nimport json\nfrom collections import defaultdict\nfrom tqdm import tqdm\n\nimport numpy as np\nimport numpy\nimport torch\nfrom torch.utils.data import Dataset\nfrom allennlp.data.dataset import Batch\nfrom allennlp.data.fields import TextField, ListField, LabelField, SequenceLabelField, ... | [
[
"torch.all",
"torch.load",
"torch.from_numpy",
"numpy.ones",
"numpy.all",
"numpy.concatenate",
"numpy.row_stack",
"torch.stack",
"numpy.array",
"torch.save"
]
] |
StatBiomed/BBMix | [
"180a6d74a50e91a7a876d452c02459a6ebeb9b29"
] | [
"bbmix/models/model_base.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"binomial_mix.\n\nChen Qiao: cqiao@connect.hku.hk\n\"\"\"\n\nimport numpy as np\n\nfrom .statistics import bic_criterion, entropy_criterion\n\n\nclass ModelBase:\n \"\"\"Base class of all the models\n\n This class encapsulated some common functions shared by all the derived mode... | [
[
"numpy.any"
]
] |
valohai/yolov3-tf2 | [
"e98bd6fad30b7494cad561fa09bb49a70af5b69b"
] | [
"weights.py"
] | [
"import numpy as np\nfrom yolov3_tf2.models import YoloV3\nfrom yolov3_tf2.utils import load_darknet_weights\nimport tensorflow as tf\nimport valohai\n\nparams = {\n \"weights_num_classes\": 80,\n}\n\ninputs = {\n \"weights\": \"https://pjreddie.com/media/files/yolov3.weights\",\n}\n\nvalohai.prepare(step=\"w... | [
[
"tensorflow.config.experimental.list_physical_devices",
"numpy.random.random",
"tensorflow.config.experimental.set_memory_growth"
]
] |
zhengxiawu/pytorch-cifar | [
"53f83002a6da425e0ac3ba27e835db2ab42de38f"
] | [
"models/nas_models.py"
] | [
"import torch\nimport torch.nn as nn\nfrom collections import namedtuple\nGenotype = namedtuple('Genotype', 'normal normal_concat reduce reduce_concat')\n\nOPS = {\n 'none': lambda C, stride, affine: Zero(stride),\n 'avg_pool_3x3': lambda C, stride, affine: nn.AvgPool2d(3, stride=stride, padding=1, count_incl... | [
[
"torch.cat",
"torch.randn",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
VakhrameevaLiza/pytorch_segmentation_framework | [
"7df02ba5c575ed0ed082090f80eca4b421f0c98e"
] | [
"models/SegRevnet_1.py"
] | [
"import torch\nfrom torch import nn\nfrom reversible_blocks.revop import ReversibleBlock\n\n\nclass ConvBnReLu(nn.Module):\n def __init__(self, in_channels, out_channels, kernel_size=3, padding=1, dilation=1,\n has_bn=False, has_relu=True):\n super(ConvBnReLu, self).__init__()\n sel... | [
[
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.rand",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
kyuhyoung/tensortrade | [
"4dae999047f7d3c846bd4a7df9162fe91dfcac53"
] | [
"tensortrade/wallets/ledger.py"
] | [
"\nimport pandas as pd\n\nfrom typing import List\nfrom collections import namedtuple\n\n\nTransaction = namedtuple('Transaction', [\n 'poid',\n 'step',\n 'source',\n 'target',\n 'memo',\n 'amount',\n 'free',\n 'locked',\n 'locked_poid'\n])\n\n\nclass Ledger:\n\n def __init__(self):\n ... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
bubble-07/AnimeReal | [
"b12193f10d231ee85a2a86ec2defeca0b5a4e240"
] | [
"OldAnimeReal/load_cmu.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport numpy as np\n\nfrom camera import Camera\n\nimport json\nimport tensorflow as tf\n\n#Module responsible for loading file handles from CMU-like datasets\n\n#From a filename of the form... | [
[
"numpy.array"
]
] |
i2cy/lewdity_CNN | [
"f616a040c90069b0bd36501794abf1f6ab6ff55b"
] | [
"lewdity_API.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n# Author: i2cy(i2cy@outlook.com)\n# Filename: lewdity_API.py\n# Created on: 2020/9/13\n\nimport psutil\nimport os\nimport time\nimport random\n\n# *屏蔽tensorflow警告信息输出\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\nimport tensorflow as tf\n\n# *RTX硬件兼容性修改配置\nif len(tf.conf... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.models.load_model",
"tensorflow.constant",
"tensorflow.image.decode_png",
"tensorflow.cast",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.callbacks.TensorBoard",
"... |
luuknieuwdorp/gpt2-discord-bot | [
"ff2d04741522280f28b14ccd59e9f8b8a4e5f65b"
] | [
"src/chatbot.py"
] | [
"import json\nimport os\nimport model, sample, encoder\nimport numpy as np\nimport tensorflow as tf\n\n# import gpt.model, gpt.sample, gpt.encoder\n\nmodel_name='dojo10k'\nbatch_size = 1\nseed = None\nnsamples=1\nlength=30\ntemperature=0.7\ntop_k=40\nnp.random.seed(seed)\ntf.set_random_seed(seed)\n\nenc = encoder.g... | [
[
"tensorflow.Graph",
"numpy.random.seed",
"tensorflow.placeholder",
"tensorflow.set_random_seed",
"tensorflow.train.Saver"
]
] |
csaluigm/FinRL-Library | [
"396736443f1abb0088d678c85c63fbce0e9bbd77"
] | [
"finrl/autotrain/training.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom sklearn import preprocessing\n\nmatplotlib.use(\"Agg\")\nimport datetime\n\nfrom finrl.config import config\nfrom finrl.marketdata.yahoodownloader import YahooDownloader\nfrom finrl.preprocessing.preprocessors import ... | [
[
"matplotlib.use",
"pandas.DataFrame"
]
] |
Zozman/mindmeld | [
"d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5"
] | [
"mindmeld/models/nn_utils/classification.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.\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# http://www.apache.org/lic... | [
[
"torch.load",
"sklearn.model_selection.train_test_split",
"torch.cuda.is_available",
"torch.device",
"sklearn.metrics.f1_score",
"sklearn.metrics.accuracy_score"
]
] |
villarrealas/deltasigma | [
"b1c2e9f307d37064ed4163a2682be825b3a44bf2"
] | [
"chopper_ds/run_walker.py"
] | [
"import pair_counter as pc\nimport data_handler as dh\nimport numpy as np\nfrom thechopper import get_buffered_subvolumes\nimport yaml\nimport sys\nimport json\nfrom collections import OrderedDict\nfrom mpi4py import MPI\nimport psutil\nimport os\nimport gc\nfrom datetime import datetime\n\n# This script runs\nif _... | [
[
"numpy.log",
"numpy.log10"
]
] |
shun60s/BPF2 | [
"8e93d670e6e1315a4410bf7181cee577e986a72c"
] | [
"ema1.py"
] | [
"#coding:utf-8\r\n\r\n# A class of Exponential Moving Average with Half-wave rectification, and smoothing via lpf\r\n#\r\n# Half-wave rectification until a few KHz signal.\r\n# More than a few KHz signal is transformed to DC with ripple signal. And smooth ripple signal.\r\n\r\n\r\n# Check version\r\n# Python 3.6.4... | [
[
"numpy.clip",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"scipy.signal.lfilter",
"matplotlib.pyplot.show",
"scipy.io.wavfile.read",
"matplotlib.pyplot... |
machow/tidytext-py | [
"5000191a48d9f371fe5c3a8d7e3642877e9edbd5"
] | [
"tests/test_unnest_tokens.py"
] | [
"import pytest\n\nfrom tidytext import unnest_tokens\nimport pandas as pd\n\nfrom siuba.siu import _\n\n@pytest.mark.skip\ndef test_unnest_tokens_character():\n df = pd.DataFrame({\"txt\": \"Emily Dickinson\"})\n res = unnest_tokens(df, _.char, _.txt, token = \"characters\")\n\n nrow, ncol = res.shape\n ... | [
[
"pandas.DataFrame"
]
] |
keithpij/mint | [
"23b3dd946f2118eda625d2b3ff8e5427cbb90bb5"
] | [
"charts.py"
] | [
"\"\"\"\nDemo of a basic pie chart plus a few additional features.\n\nIn addition to the basic pie chart, this demo shows a few optional features:\n\n * slice labels\n * auto-labeling the percentage\n * offsetting a slice with \"explode\"\n * drop-shadow\n * custom start angle\n\nNote about the custo... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
helenacuesta/voas-vocal-quartets | [
"9b4341f072effdcf0d214694bc24f96eea962427"
] | [
"predict_on_salience.py"
] | [
"import numpy as np\nimport pandas as pd\n\nimport os\nimport argparse\nimport sys\n\nfrom voas import utils as utils\nfrom voas import config as config\nfrom voas import models as models\n\nPATCH_LEN = 128\n\n\ndef grab_input_slices(input_mat):\n '''Input mat will be [num_features x patch_len]\n '''\n\n s... | [
[
"numpy.hstack",
"numpy.arange",
"pandas.DataFrame",
"numpy.load",
"numpy.zeros",
"numpy.vstack"
]
] |
guojj33/VGNSL | [
"90a59c819032c95b74a859898e6eea3393a4d27d"
] | [
"src/model.py"
] | [
"from operator import length_hint\nimport numpy as np\nfrom collections import OrderedDict\n\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn as nn\nimport torch.nn.init\nimport torchvision.models as models\nfrom torch.autograd import Variable\nfrom torch.distributions import Categorical\nfrom t... | [
[
"torch.nn.functional.softmax",
"numpy.sqrt",
"torch.Tensor",
"torch.cat",
"torch.nn.utils.clip_grad.clip_grad_norm_",
"torch.nn.Linear",
"torch.set_grad_enabled",
"torch.distributions.Categorical",
"torch.log",
"torch.cuda.is_available",
"torch.arange",
"torch.nn.Re... |
sonaldangi12/DataScience | [
"3d7cd529a96f37c2ef179ee408e2c6d8744d746a"
] | [
"Groups/Group_ID_40/vcca.py"
] | [
"import os\nimport torch\nimport torch.utils.data\nfrom torch import optim\nfrom torch.autograd import Variable\nfrom torch.nn import functional as F\nfrom torchvision import datasets, transforms\nfrom torchvision.utils import save_image\nfrom autoencoder import Autoencoder\nfrom utils import *\n\nSEED = 1\nBATCH_S... | [
[
"torch.autograd.Variable",
"torch.manual_seed",
"torch.randn"
]
] |
vishalbelsare/online-centrality | [
"30901da7d558c417d2eea3f0e85224776df97b1e"
] | [
"python/centrality_utils/static_negative_beta_measure_computer.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nimport networkx as nx\nfrom collections import deque\nfrom .base_computer import *\n\nclass StaticNegativeBetaMeasureParams():\n def __init__(self,lookback_cnt=0):\n self.lookback_cnt = lookback_cnt\n if lookback_cnt > 0:\n self.graph_... | [
[
"pandas.Series",
"pandas.DataFrame"
]
] |
mavelim/twitter_selenium_get_tweets | [
"e1bdec1aff68c14c03a4b37ee8b5b5b22108f0a8"
] | [
"resources/scraper_function.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 12 18:27:54 2020\n\n@author: theo goe\n\"\"\"\n\n# imports\nfrom selenium import webdriver\nfrom selenium.webdriver.common.keys import Keys\nfrom time import sleep\nimport random\nimport pandas as pd\nfrom progressbar import ProgressBar\npbar = ProgressBar()\nfro... | [
[
"pandas.DataFrame"
]
] |
imcallister/accountifie | [
"094834c9d632e0353e3baf8d924eeb10cba0add4"
] | [
"accountifie/toolkit/utils/everything.py"
] | [
"from . import gl_helpers\n\nimport datetime\nimport json\n\n\n\nfrom dateutil.parser import parse\nfrom dateutil.relativedelta import relativedelta\nfrom decimal import Decimal, getcontext, ROUND_HALF_UP, ROUND_HALF_DOWN\nfrom bisect import insort\nimport locale\nimport operator\nimport re\n\nimport csv, os\nfrom ... | [
[
"pandas.tseries.offsets.BDay"
]
] |
Jie-Yuan/CTRZOO | [
"cf7810d2cb76fb0b2a48678cade01f64d1ed3fdb"
] | [
"ctrzoo/layers/DNN.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Project : Python.\n# @File : DNN\n# @Time : 2020-03-13 13:42\n# @Author : yuanjie\n# @Email : yuanjie@xiaomi.com\n# @Software : PyCharm\n# @Description :\nfrom typing import Any, Callable, Dict, List, Optional, Sequence, Type... | [
[
"tensorflow.keras.layers.Dense",
"tensorflow.keras.regularizers.l2",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Dropout"
]
] |
alanmaehara/Sales-Prediction | [
"ccc12fb1664a733f64a3064e787d070207f37444"
] | [
"api/handler.py"
] | [
"import pandas as pd\nimport pickle\nfrom flask import Flask, request, Response\nfrom rossmann.Rossmann import Rossmann #(from folder rossmann, import rossmann class)\n\n# loading model\nmodel = pickle.load(open('/home/alan/Sales-Prediction/model/model_rossmann.pkl','rb'))\n\n\n# initialize API\napp = F... | [
[
"pandas.DataFrame"
]
] |
vishalbelsare/chebpy | [
"55df1f84a08dcc5d63e687a7ab950d4a6e2666cc"
] | [
"chebpy/core/chebtech.py"
] | [
"from abc import ABC, abstractmethod\n\nimport numpy as np\n\nfrom .smoothfun import Smoothfun\nfrom .settings import _preferences as prefs\nfrom .decorators import self_empty\nfrom .algorithms import (bary, clenshaw, adaptive, coeffmult,\n vals2coeffs2, coeffs2vals2, chebpts2,\n ... | [
[
"numpy.imag",
"numpy.clip",
"numpy.arange",
"numpy.sort",
"numpy.ones",
"numpy.append",
"numpy.real",
"numpy.isscalar",
"numpy.iscomplexobj",
"numpy.array",
"numpy.zeros"
]
] |
Kandidatarbete-Chalmers-MCCX02-19-06/RaspberryPiRadarProgram | [
"f5d69d9084d37246aaf0e0061b3353b86e8d59e3"
] | [
"Archive for old stuff/Unused_files/Class_Thread.py"
] | [
"import time\nimport threading\nimport numpy as np\nimport queue\nimport copy\n\nfrom acconeer_utils.clients.reg.client import RegClient\nfrom acconeer_utils.clients.json.client import JSONClient\nfrom acconeer_utils.clients import configs\nfrom acconeer_utils import example_utils\nfrom acconeer_utils.mpl_process i... | [
[
"numpy.zeros"
]
] |
FrederikWR/course-02443-stochastic-virus-outbreak | [
"4f1d7f1fa4aa197b31ed86c4daf420d5a637974e"
] | [
"code/report-code/rio_olympics_cities.py"
] | [
"import _setup\n\nimport os.path as path\nimport numpy as np\nimport scipy.stats\nimport matplotlib.pyplot as plt\nimport scipy.stats\nimport math\nimport csv\n\nfrom simulator import State, Simulator\nfrom world import regions, routes\nimport sir\n\nthis_dir = path.dirname(path.realpath(__file__))\n\ndef plot_sir(... | [
[
"matplotlib.pyplot.legend",
"numpy.asarray",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.std",
"numpy.argmax",
"matplotlib.pyplot.subplot",
"numpy.mean",
"numpy.cov",
"numpy.var",
"numpy.corrcoef"
]
] |
elbuco1/INF8215_Workshop_Machine_Learning | [
"ce4ffde44a25c7f7c15699d1b8fe0be19c32a2f7"
] | [
"solution/SoftmaxClassifier.py"
] | [
"from sklearn.base import BaseEstimator, ClassifierMixin\nimport numpy as np\n\n\nclass SoftmaxClassifier(BaseEstimator, ClassifierMixin): \n \"\"\"A softmax classifier\"\"\"\n\n def __init__(self, lr = 0.1, alpha = 100, n_epochs = 1000, eps = 1.0e-5,threshold = 1.0e-10 , regularization = True, early_stoppin... | [
[
"numpy.square",
"numpy.log",
"numpy.abs",
"numpy.unique",
"numpy.matmul",
"numpy.ones",
"numpy.max",
"numpy.random.normal",
"numpy.argmax",
"numpy.exp",
"numpy.zeros"
]
] |
ga546/Bill_project_8p | [
"89c496b04c2b6da4558d0b2b972eeb47d84bb238"
] | [
"detectron2/structures/boxes.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\nimport math\nimport numpy as np\nfrom enum import IntEnum, unique\nfrom typing import List, Tuple, Union\nimport torch\nfrom torch import device\n\n_RawBoxType = Union[List[float], Tuple[float, ...], torch.Tensor, np.ndarray]\n\n\n@unique\nclass BoxMode(IntEnum):... | [
[
"torch.max",
"torch.empty",
"torch.zeros",
"torch.cat",
"torch.sin",
"torch.min",
"numpy.asarray",
"torch.tensor",
"torch.isfinite",
"torch.stack",
"torch.device",
"torch.cos",
"torch.as_tensor"
]
] |
nestauk/industrial_taxonomy | [
"eecfa393bc9c887d5cf9b752142cd18ed4ae4d01"
] | [
"industrial_taxonomy/pipeline/glass_clusters/utils.py"
] | [
"\"\"\"Utils to create a sector corpus\"\"\"\nfrom toolz import pipe\nfrom functools import partial\nfrom typing import Dict, List\nimport pandas as pd\n\nNE_CODES = {\n \"CARDINAL\",\n \"DATE\",\n \"GPE\",\n \"LOC\",\n \"MONEY\",\n \"NORP\",\n \"ORDINAL\",\n \"ORG\",\n \"PERSON\",\n \... | [
[
"pandas.Series"
]
] |
Danglich/flowers102_retrieval_streamlit | [
"a16bf87be1e3c2da04f067d53a2fcf8172c6dd90"
] | [
"flower_st.py"
] | [
"import itertools\n\nimport numpy as np\nfrom scipy.spatial.distance import cdist\nfrom PIL import Image\nimport streamlit as st\n\nfrom utils import FlowerArc, load_prec_embs\n\n\ndef main(top_k):\n\n flower_arc = FlowerArc()\n\n st.title(\"Flower retrieval\")\n train_img_fps, train_embs, train_labels = l... | [
[
"numpy.array",
"scipy.spatial.distance.cdist"
]
] |
HReynaud/Morpho-MNIST | [
"84bffa49a2ad38b2b426af744b07a9069cc83fcf"
] | [
"experiments/infogan_util.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport torch\n\nfrom models import infogan\nfrom morphomnist.util import plot_grid\n\n_TICK_LABEL_SIZE = 'x-large'\n_VAR_LABEL_SIZE = 'xx-large'\n\n\ndef _prep_ax(ax):\n ax.axis('on')\n ax.xaxis.set_visible(True)\n ax.yaxis.set_visible(True)\n ax.xax... | [
[
"torch.linspace",
"numpy.arange",
"numpy.prod",
"numpy.argsort",
"matplotlib.pyplot.suptitle"
]
] |
Vision-CAIR/HalentNet | [
"dedef73c57c63aa580fc497fa42d512f4241a64b"
] | [
"trajectron/model/components/discrete_latent.py"
] | [
"import torch\nimport torch.distributions as td\nimport numpy as np\nfrom model.model_utils import ModeKeys\n\n\nclass DiscreteLatent(object):\n def __init__(self, hyperparams, device):\n self.hyperparams = hyperparams\n self.z_dim = hyperparams['N'] * hyperparams['K']\n self.N = hyperparams... | [
[
"torch.distributions.OneHotCategorical",
"torch.mean",
"torch.reshape",
"numpy.eye",
"torch.sum",
"torch.eye",
"torch.unsqueeze",
"numpy.indices",
"torch.distributions.kl_divergence",
"torch.clamp",
"torch.argmax"
]
] |
ngxingyu/Domain-Transfer-for-Punctuation-Retrieval | [
"f5aa0ea0946c68aaf7fcf49a5085e6c823766a2f"
] | [
"experiment/data/punctuation_dataset_multi.py"
] | [
"from torch.utils.data import IterableDataset, Dataset, get_worker_info\nimport gc\nimport numpy as np\nfrom typing import List, Optional, Dict\nfrom core.utils import chunk_examples_with_degree, chunk_to_len_batch\nimport pandas as pd\nimport os\nimport torch\nimport subprocess\nfrom time import time\nfrom itertoo... | [
[
"pandas.read_csv",
"torch.ones",
"numpy.ones_like",
"torch.cat",
"torch.randperm",
"torch.utils.data.get_worker_info",
"pandas.DataFrame"
]
] |
andillio/CHiMES | [
"546788d207bb878d702df93f7f9ab07318f80851"
] | [
"husimi_sp.py"
] | [
"import numpy as np\nimport scipy.integrate as sp\nimport cupy as cp\n\n\n# x has to be defined from -L/2, L/2 or this won't work\ndef K_H(x, x_, u, hbar, mpart, sig_x, L, full = False):\n\tX, X_, U = np.meshgrid(x, x_, u) # x is on axis 1, x_ is on axis 0, u is on axis 2\n\n\tX_[X_ - X > L/2] -= L # shift x_ so it... | [
[
"numpy.exp",
"numpy.meshgrid",
"numpy.sqrt",
"numpy.fft.fftshift"
]
] |
shivupa/pyqmc | [
"f2e3b7443f69a2d48a74a8346e622fa64c87211f"
] | [
"pyqmc/obdm.py"
] | [
"\"\"\" Evaluate the OBDM for a wave function object. \"\"\"\nimport numpy as np\nfrom copy import deepcopy\nfrom pyqmc.mc import initial_guess\n\n\nclass OBDMAccumulator:\n \"\"\" Return the obdm as an array with indices rho[spin][i][k] = <c_{spin,i}c^+_{spin,j}>\n Args:\n\n mol (Mole): PySCF Mole object.\n... | [
[
"numpy.sqrt",
"numpy.einsum",
"numpy.random.choice",
"numpy.arange",
"numpy.concatenate",
"numpy.mean",
"numpy.random.rand",
"numpy.random.randn",
"numpy.zeros",
"numpy.sum",
"numpy.random.randint"
]
] |
spaicer/example-container | [
"65a93b63dad6c5ccbdf80c6541cdf2c776e2f5af"
] | [
"python/example/src/main.py"
] | [
"\"\"\"Example Container computing mean value and standard deviation.\"\"\"\n\n__version__ = '0.0.1'\n\nfrom typing import List\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel\nimport numpy\n\napp = FastAPI(\n title='Example Container',\n docs_url='/documentation',\n redoc_url='/redoc',\n d... | [
[
"numpy.std",
"numpy.mean"
]
] |
donkirkby/zero-play | [
"15e3afa950037cfd1f373ee4943cd8b42d4c82c9"
] | [
"zero_play/othello/game.py"
] | [
"import math\nimport typing\n\nimport numpy as np\n\nfrom zero_play.game_state import GridGameState\n\n\nclass OthelloState(GridGameState):\n game_name = 'Othello'\n\n def __init__(self,\n text: str = None,\n board_height: int = 6,\n board_width: int = 6,\n ... | [
[
"numpy.zeros"
]
] |
jbonaiuto/infant_eeg | [
"6368e253f9990dbfd9717f2d862c0b0c46d64f3b"
] | [
"src/python/infant_eeg/experiment.py"
] | [
"import sys\n# Import AVbin first\nif sys.platform == 'win32':\n import ctypes\n avbin_lib = ctypes.cdll.LoadLibrary('avbin')\n import psychopy.visual\nimport copy\nimport datetime\nfrom psychopy.visual import Window\nfrom psychopy import visual, core, event, monitors\nimport numpy as np\nimport egi.thread... | [
[
"numpy.random.shuffle"
]
] |
kramersi/cctv-flood-extraction | [
"73ff7949d544cfbdae26f683b974daa6ebbfe893"
] | [
"img_segmentation/model.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\n\nfrom keras.callbacks import ModelCheckpoint, TensorBoard, EarlyStopping, ReduceLROnPlateau\nfrom keras.layers import Conv2D, Concatenate, MaxPooling2D, Conv2DTranspose, UpSampling2D, Dropout, BatchNormalization\nfrom keras.models import Input, Model\nfrom keras... | [
[
"numpy.array",
"numpy.empty",
"pandas.DataFrame"
]
] |
heartexlabs/NeMo | [
"eb0da4b312090ba694a3dd7e41e513d1fce789cc"
] | [
"nemo/collections/tts/models/squeezewave.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"torch.stack",
"torch.utils.data.DataLoader"
]
] |
PeriscopeData/analytics-toolbox | [
"83effdee380c33e5eecea29528acf5375fd496fb"
] | [
"Python/Calculating_Trimmed_Means/calculating_trimmed_means1.py"
] | [
"# SQL output is imported as a pandas dataframe variable called \"df\"\n\n# Source: https://stackoverflow.com/questions/19441730/trimmed-mean-with-percentage-limit-in-python\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom scipy.stats import tmean, scoreatpercentile\nimport numpy as np\n\ndef trimmean(a... | [
[
"scipy.stats.tmean",
"scipy.stats.scoreatpercentile"
]
] |
curtislisle/miqa | [
"d7220e1ab9bdacce9e4344ba6549f16fe710862a"
] | [
"miqa/learning/correlator.py"
] | [
"#!/usr/bin/env python3\n\nimport pandas as pd\nfrom sklearn.metrics import confusion_matrix\n\ndf = pd.read_csv('M:/MIQA/data.csv') # manually converted TRUE/FALSE into 1/0\nprint(f'count NaN: {df.isnull().sum().sum()}')\ncorrelation_df = df.corr()\ncorrelation_df.to_csv('M:/MIQA/correlations2.csv')\nprint(correl... | [
[
"pandas.read_csv",
"sklearn.metrics.confusion_matrix"
]
] |
edfagan/ManuCostModel | [
"c3d97815f84d7cdff1365a472887da0fc712ae71"
] | [
"src/ManuCostModel/Tools.py"
] | [
"\"\"\"\nCost Model Data Processing Tools\n\nAuthor: Edward Fagan\n\"\"\"\nimport pandas as pd\n\ndef BOM(manuf_obj):\n \"\"\"\n Determine the bill of materials for manufacturing.\n\n Parameters\n ----------\n manuf_obj : obj\n A manufacturing object.\n\n Returns\n -------\n bom : Dat... | [
[
"pandas.DataFrame.from_dict"
]
] |
ginesam/semtagger | [
"ce5b0342ddf3bf1b30479ba7f1478fc2d66a6059"
] | [
"models/semtagger_predict.py"
] | [
"#!/usr/bin/python3\n# this script predicts semantic tags using a trained neural model\n\nimport sys\nsys.path.append(sys.argv[1])\n\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = '1'\n\nimport pickle\nimport numpy as np\n\nimport tensorflow as tf\nconfig = tf.ConfigPro... | [
[
"tensorflow.ConfigProto",
"numpy.argmax",
"tensorflow.Session"
]
] |
ethanm88/lingvo | [
"46314590ca80a557b6b95c8acdf5956f9e045eb7"
] | [
"lingvo/core/base_model_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.is_nan",
"tensorflow.get_variable",
"tensorflow.constant",
"numpy.random.seed",
"tensorflow.is_finite",
"tensorflow.ones_like",
"tensorflow.test.main",
"tensorflow.global_variables_initializer",
"tensorflow.no_op",
"tensorflow.log",
"tensorflow.variable_scop... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.