repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
AlexeyVatolin/sentence-transformers | [
"084b80cd351b135a1d48211ec4f4aea37f01a641"
] | [
"sentence_transformers/SentenceTransformer.py"
] | [
"import json\nimport logging\nimport os\nimport shutil\nfrom collections import OrderedDict\nfrom typing import List, Dict, Tuple, Iterable, Type, Union, Callable\nfrom zipfile import ZipFile\nimport requests\nimport numpy as np\nfrom numpy import ndarray\nimport transformers\nimport torch\nfrom torch import nn, Te... | [
[
"torch.cuda.device_count",
"torch.hub._get_torch_home",
"torch.is_tensor",
"torch.tensor",
"numpy.concatenate",
"torch.multiprocessing.get_context",
"torch.cuda.amp.GradScaler",
"torch.cuda.amp.autocast",
"torch.no_grad",
"torch.optim.swa_utils.SWALR",
"torch.cuda.is_av... |
Bren0Miranda/Udacity-Computer-Vision-Nanodegree- | [
"834bb274c9d514308947544bd819f514b275e167"
] | [
"1_1_Image_Representation/Green Screen Car Streamlit.py"
] | [
"import cv2\nimport numpy as np\nfrom PIL import Image\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\n\nst.set_option('deprecation.showfileUploaderEncoding', False)\n\nimg_file = st.file_uploader(\"Upload da imagem\", type=[\"png\", \"jpg\", \"jpeg\"])\n\nimg_file_backgr... | [
[
"numpy.copy",
"numpy.array",
"numpy.shape"
]
] |
fabiomolinar/excel-files-merger | [
"5cbd9c92582e5532fb75f3a095195f76a86bc6ce"
] | [
"source.py"
] | [
"import os\nimport glob\nimport pandas as pd\n\npath_sources = r\"./sources/*.xls\"\npath_output = r\"./output/output.xlsx\"\n\ndata = pd.DataFrame()\nfor file in glob.glob(path_sources):\n df = pd.read_excel(file, header=None)\n data = data.append(df, ignore_index=True, sort=False)\n\ndata = data.dropna(how=... | [
[
"pandas.read_excel",
"pandas.DataFrame",
"pandas.ExcelWriter"
]
] |
RFChallenge/rfchallenge_starter | [
"724a52f68541d3f9c3f460d88fe4e2be9662aa49",
"724a52f68541d3f9c3f460d88fe4e2be9662aa49"
] | [
"rfcutils/dataset_helper_fn.py",
"example/demod_bitregression/emisig1_supregdemod.py"
] | [
"import os\nimport warnings\nimport numpy as np\nimport pickle\n\nfrom .sigmf_helper_fn import write_sigmf_file, read_sigmf_file\n\ndef load_dataset_sample(idx, dataset_type, sig_type):\n foldername = os.path.join('dataset',dataset_type,sig_type)\n filename = f'{sig_type}_{dataset_type}_{idx:04d}'\n # Spec... | [
[
"numpy.abs"
],
[
"numpy.abs",
"numpy.random.seed",
"numpy.arange",
"numpy.stack",
"numpy.array"
]
] |
sozand/My-Portfolio | [
"cb644212b277896112db4f1685e01fc4cafe39c5"
] | [
"Deep learning project/Smile detection/train_model_smile.py"
] | [
"# คำสั่ง\n# python train_model_smile.py --dataset ../datasets/SMILEsmileD --model output/lenet.hdf5\n\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import classification_report\nfrom tensorflow.keras.preprocessing.image import img_to_arr... | [
[
"matplotlib.pyplot.legend",
"tensorflow.keras.preprocessing.image.img_to_array",
"matplotlib.pyplot.title",
"numpy.arange",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.LabelEncoder",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.array",
... |
mattsamson0203/enterprise_extensions | [
"cd2ebe0094f4b315da122e8acf790f056aa1628e"
] | [
"enterprise_extensions/models.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import (absolute_import, division,\n print_function, unicode_literals)\nimport numpy as np\nimport functools\nfrom collections import OrderedDict\n\nfrom enterprise.signals import parameter\nfrom enterprise.signals import selections\nfrom enterprise.s... | [
[
"numpy.abs"
]
] |
SachitNayak/google-research | [
"2893b06a7a60f243be22a06f975f1eb85702d0fa"
] | [
"grouptesting/simulator.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.arange",
"numpy.zeros",
"pandas.DataFrame"
]
] |
ttk21/lab_05 | [
"916bf12185af9668e7c4d71fa282e1bf95a685cc"
] | [
"ex_4_full_ba.py"
] | [
"import numpy as np\nimport visgeom as vg\n\nfrom camera import PerspectiveCamera\nfrom measurements import PrecalibratedCameraMeasurements\nfrom optim import BundleAdjustmentState, levenberg_marquardt\nfrom visualise_ba import visualise_full\n\n\"\"\"Example 4 - Full Bundle Adjustment\"\"\"\n\n\nclass Precalibrate... | [
[
"numpy.printoptions",
"numpy.linalg.inv",
"numpy.ones",
"numpy.identity",
"numpy.random.randn",
"numpy.array",
"numpy.zeros"
]
] |
WeiNingChen/GAPP-image | [
"77b54d2f68c97d5e92e63119a9b3700ffa0f5170"
] | [
"load_genki.py"
] | [
"import os\nimport pickle\nimport cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nSMILE_FOLDER = './genki4k/'\nF_SMILE_FOLDER = './data/smile_data/'\nNUM_SMILE_IMAGE = 4000\nWID_MEAN = 198\nLEN_MEAN = 184\n#SMILE_SIZE = 48\n\ndata = []\nlabels = []\n\nprint(\"Loading data...\")\nwith open(SMILE_FOL... | [
[
"numpy.arange",
"numpy.array"
]
] |
dendisuhubdy/grounded-video-description | [
"2667e216223a63cdc91b616a34f4c046e507a1dc"
] | [
"main.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_functio... | [
[
"torch.nn.functional.softmax",
"torch.max",
"torch.load",
"torch.cat",
"numpy.asarray",
"torch.utils.data.DataLoader",
"torch.sum",
"numpy.concatenate",
"numpy.round",
"torch.FloatTensor",
"numpy.mean",
"torch.cuda.manual_seed_all",
"torch.no_grad",
"torch.a... |
lorisercole/samos | [
"e0756f341a1f2faf86aa9c1d47d823879be2f084"
] | [
"samos/analysis/rdf.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom scipy.spatial.distance import cdist\nfrom ase import Atoms\nfrom samos.trajectory import Trajectory\nfrom samos.utils.attributed_array import AttributedArray\nfrom samos.lib.rdf import calculate_rdf, calculate_angular_spec\nimport itertools\nfrom abc import ABCM... | [
[
"numpy.dot",
"numpy.linalg.inv",
"numpy.arange",
"scipy.spatial.distance.cdist",
"numpy.array",
"numpy.histogram",
"numpy.where"
]
] |
lcl1026504480/network | [
"cf1175aa0377a4145e9a5dda2031259ef3d662c4"
] | [
"sgd_numpy.py"
] | [
"# -*- coding: utf-8 -*-\n# @Author: lenovouser\n# @Date: 2020-09-30 16:54:52\n# @Last Modified by: lenovouser\n# @Last Modified time: 2020-09-30 16:54:54\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Sep 29 14:42:21 2020\n\n@author: lenovouser\n\"\"\"\nimport numpy as np\n\nfrom matplotlib import pyplot as ... | [
[
"matplotlib.pyplot.legend",
"numpy.dot",
"matplotlib.pyplot.plot",
"numpy.asfarray",
"numpy.random.permutation",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.show"
]
] |
msteptoe/gcam_vis | [
"b02fa0a2421ef107d03b69bf9361c591f45dd61f"
] | [
"python/mini_kmeans_1.py"
] | [
"import sys\nimport numpy as np\nimport os\nimport warnings\n\nfrom sklearn.cluster import MiniBatchKMeans\nfrom json import dump\n\n\ndef mainFunc(): \n warnings.filterwarnings(\"ignore\")\n\n jobPath = \"jobs\" + os.path.sep + \"test\"\n query = 'Building floorspace' + os.path.sep + 'building' + os.path.... | [
[
"sklearn.cluster.MiniBatchKMeans",
"numpy.array"
]
] |
Coslate/DataMining_Final | [
"1c2519874b1005c68d97aa1003984b1f3bd936a2"
] | [
"Preprocess_FeatureExtraction_GamePrediction/nbaDataPreprocessing.py"
] | [
"##############################################\n## Author: I-No Liao ##\n## Date of update: 2018/05/15 ##\n## Description: Data Mining Final Project ##\n## - Data Preprocessing ##\n## - Remove NaN ##\n## - Add opponent label ... | [
[
"pandas.concat",
"pandas.read_csv"
]
] |
ashok-kollipara/multistrike-oi | [
"9ff3a792c22257aad6d5e635e1144a0f18d468a6"
] | [
"tkplot.py"
] | [
"import matplotlib\r\nimport matplotlib.pyplot as plt\r\n#import matplotlib.ticker as ticker\r\nimport matplotlib.animation as animate\r\nfrom matplotlib.figure import Figure\r\nfrom matplotlib.backends.backend_tkagg import (\r\n FigureCanvasTkAgg,\r\n NavigationToolbar2Tk\r\n )\r\n\r\nimport d... | [
[
"matplotlib.use",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gcf"
]
] |
CNES/zcollection | [
"f14616944d92d799cb1e5ee783b44c3819344fc2"
] | [
"zcollection/partitioning/date.py"
] | [
"# Copyright (c) 2022 CNES\n#\n# All rights reserved. Use of this source code is governed by a\n# BSD-style license that can be found in the LICENSE file.\n\"\"\"\nPartitioning by date\n====================\n\"\"\"\nfrom typing import Any, ClassVar, Dict, Iterator, Sequence, Tuple\n\nimport dask.array.core\nimport ... | [
[
"numpy.dtype"
]
] |
xiaohangcd/PPDM | [
"9b7c9161a3d94a2b57d927b347810da105a74e61"
] | [
"src/lib/models/decode.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nfrom .utils import _gather_feat, _tranpose_and_gather_feat\nimport numpy as np\n\n\ndef _nms(heat, kernel=3):\n pad = (kernel - 1) // 2\n\n hmax = nn.function... | [
[
"numpy.unique",
"torch.cat",
"numpy.ones",
"numpy.argsort",
"torch.nn.functional.max_pool2d",
"torch.argmax"
]
] |
allengueco/message_patterns | [
"0d50550187dad9fd08bacc0ff47da1fffadb1937"
] | [
"generate_graphs.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport seaborn as sns\nimport sys\nimport nltk\nfrom textblob import TextBlob\nfrom wordcloud import WordCloud\n\nif len(sys.argv) != 3:\n print(\"Error: Usage is 'py generate_graphs.p... | [
[
"pandas.read_csv",
"matplotlib.ticker.StrMethodFormatter",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.style.use"
]
] |
vbvg2008/ARC | [
"b7b16b907d1e62608ebb079594e953179e6a31ea"
] | [
"model/train_arc.py"
] | [
"import os\nimport pickle\n\nimport cv2\nimport fastestimator as fe\nimport numpy as np\nimport tensorflow as tf\nfrom fastestimator.op.numpyop import Delete\nfrom fastestimator.op.numpyop.meta import Sometimes\nfrom fastestimator.op.tensorop.loss import CrossEntropy\nfrom fastestimator.op.tensorop.model import Mod... | [
[
"tensorflow.python.keras.layers.LSTM",
"numpy.pad",
"tensorflow.python.keras.layers.Dense",
"tensorflow.math.reduce_max",
"tensorflow.keras.Sequential",
"tensorflow.math.log",
"numpy.concatenate",
"numpy.std",
"numpy.zeros_like",
"numpy.mean",
"numpy.float32",
"tens... |
HaithemH/norfair | [
"04f80dd900ed38c8537344ee07dec6c583ac4834"
] | [
"demos/motmetrics4norfair/motmetrics4norfair.py"
] | [
"import os.path\nimport numpy as np\nimport norfair\nfrom norfair import Detection, Tracker, metrics, video, drawing\nimport argparse\n\nframe_skip_period = 1\ndetection_threshold = 0.01\ndistance_threshold = 0.4\n\nparser = argparse.ArgumentParser(\n description=\"Evaluate a basic tracker on MOTChallenge data. ... | [
[
"numpy.linalg.norm",
"numpy.count_nonzero"
]
] |
beneisner/partnet_seg_exps | [
"54cd57885ba248fb9a35b42664e1c69c7ef62255"
] | [
"exps/utils/eval_utils.py"
] | [
"import os\nimport sys\nimport h5py\nimport numpy as np\nfrom progressbar import ProgressBar\nfrom commons import check_mkdir\n\ndef load_gt_h5(fn):\n \"\"\" Output: pts B x N x 3 float32\n gt_mask B x K x N bool\n gt_mask_label B x K uint8\n ... | [
[
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.ylim",
"numpy.cumsum",
"numpy.ones",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlim",
"numpy.mean",
"numpy.insert",
"matplotlib.pyplot.close",
"numpy.argsort",
"matplotl... |
lufovic77/DBx1000 | [
"1c2c15e48ca3bb4ee0b58ac1c09945f463f61cc9"
] | [
"scripts/runExpr.py"
] | [
"NUM_TRIALS = 4\n\nimport os.path\nfrom os import path\nimport subprocess\nfrom subprocess import TimeoutExpired\nimport re\nimport sys\nimport os\nimport datetime\nimport socket\nfrom numpy.core.numeric import full\n# from tools.logChecker import num\nfrom numpy.core.shape_base import block\nfrom scipy import opti... | [
[
"scipy.optimize.minimize_scalar"
]
] |
johntiger1/blog-posts | [
"0d67a598025abbef6dcf9a44fe3ef14c93d9d357"
] | [
"scripts/plot_roc.py"
] | [
"import matplotlib.pyplot as plt\r\nfrom matplotlib.gridspec import GridSpec\r\nfrom sklearn.metrics import confusion_matrix, roc_auc_score, roc_curve\r\nfrom sklearn.metrics import f1_score, roc_auc_score, precision_recall_curve, roc_curve\r\n\r\n\r\ndef plot_conf_matrix_and_roc(estimator, X, y, figure_size=(16, 6... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.roc_auc_score",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"sklearn.metrics.roc_curve",
"sklearn.metrics.precision_recall_curve",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
... |
vansweej/tensorrt_demos | [
"f3192204b2aa4f93e5271f499c605b7590d6099b"
] | [
"yolo/plugins.py"
] | [
"\"\"\"plugins.py\n\nI referenced the code from https://github.com/dongfangduoshou123/YoloV3-TensorRT/blob/master/seralizeEngineFromPythonAPI.py\n\"\"\"\n\n\nimport ctypes\n\nimport numpy as np\nimport tensorrt as trt\n\ntry:\n ctypes.cdll.LoadLibrary('../plugins/libyolo_layer.so')\nexcept OSError as e:\n rai... | [
[
"numpy.ascontiguousarray",
"numpy.array"
]
] |
mmadsen/axelrod-ct | [
"90ea4319dd571546888c4d2a50255514e7d7fb94"
] | [
"madsenlab/axelrod/analysis/descriptive_stats.py"
] | [
"#!/usr/bin/env python\n# Copyright (c) 2013. Mark E. Madsen <mark@madsenlab.org>\n#\n# This work is licensed under the terms of the Apache Software License, Version 2.0. See the file LICENSE for details.\n\n\"\"\"\nDescription here\n\n\"\"\"\n\nimport logging as log\nfrom collections import defaultdict\nimport n... | [
[
"numpy.asarray"
]
] |
QHZSS/SRAWL | [
"7862dea638f989f7ea34c1bcf404a654115c9ec7"
] | [
"code_for_mrc/optimization.py"
] | [
"\n\"\"\"PyTorch optimization for BERT model.\"\"\"\n\nimport math\nimport torch\nfrom torch.optim import Optimizer\nfrom torch.nn.utils import clip_grad_norm_\n\ndef warmup_cosine(x, warmup=0.002):\n if x < warmup:\n return x/warmup\n return 0.5 * (1.0 + torch.cos(math.pi * x))\n\ndef warmup_constant(... | [
[
"torch.nn.utils.clip_grad_norm_",
"torch.zeros_like",
"torch.cos"
]
] |
wadpac/SleepStageClassification | [
"5b288995e62bbd66faa66bd932b06af8a65f8445"
] | [
"deeplearning/get_resnet_weights.py"
] | [
"import sys,os\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras import Input, Model\nfrom tensorflow.keras.layers import Dense, Lambda, Dropout\nimport tensorflow.keras.backend as K\nfrom tensorflow.keras.constraints import MaxNorm\nfrom tensorflow.keras.initializers import glorot_uniform\nfrom r... | [
[
"tensorflow.keras.constraints.MaxNorm",
"tensorflow.keras.Input",
"tensorflow.keras.Model",
"tensorflow.keras.backend.abs",
"tensorflow.keras.initializers.glorot_uniform",
"tensorflow.keras.layers.Dropout"
]
] |
shijieS/OMOTDRecorder | [
"2e28c00d0ec682f4717a15a54da099085d6413b7"
] | [
"recording_utils/draw_utils.py"
] | [
"# Copyright (c) 2019. ShiJie Sun at the Chang'an University\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n# Author: shijie Sun\n# Email: shijieSun@chd.edu.cn\n# Github: www.github.com/shijieS\nimport numpy as np\nimport cv2\n\nde... | [
[
"numpy.zeros",
"numpy.zeros_like",
"numpy.random.randint"
]
] |
DawffyddRiv/unifac_liq_vap | [
"1cab5d94e4e699f08c4fa270da51a2ac49d9d06d"
] | [
"iteracionunifac_A.py"
] | [
"import pandas as pd\nimport numpy \nimport time\nprint(\"Modelo UNIFAC by Dawffydd Riv\")\nprint(\"\"\"Este programa estima los coeficientes de actividad para el equilibrio liquido vapor\nde los compuestos capturados en el archivo BBDDCompuestos \"\"\")\n#########################\tEntrada de variables \n\n####\t... | [
[
"numpy.log",
"pandas.read_csv",
"numpy.multiply",
"numpy.reshape",
"numpy.exp",
"numpy.array",
"numpy.mat",
"numpy.sum"
]
] |
umersheikh846/WQMIX | [
"3fbc088273c4ddb6876a352d18f057c50703546c"
] | [
"src/envs/pymarl_wrapper.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom .multiagentenv import MultiAgentEnv\n\nclass Environment(MultiAgentEnv):\n\n def __init__(self, env_name='matthew', seed=None):\n\n self._seed = seed\n self.normalize = True\n self.resource_type = 'all'\n self.obs3neighbors = ... | [
[
"matplotlib.pyplot.pause",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylim",
"numpy.arange",
"numpy.cos",
"numpy.ones",
"matplotlib.pyplot.plot",
"numpy.sin",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.ion"... |
Yixin-Cheng/8755Project | [
"6612b606e185bf27d020726817a13f12fa9dd680"
] | [
"Dropout_Prediction/feature_selector.py"
] | [
"\"\"\"\nThis file is for the feature selection based on Genetic Algorithm and SVM\n\"\"\"\n# import required libraries\nimport numpy as np\nfrom sklearn.svm import SVC\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split, cross_validate\n\n\n# ## Step 2: Define settings\n# 1. DNA size: the nu... | [
[
"pandas.read_csv",
"numpy.arange",
"numpy.argmax",
"numpy.random.rand",
"sklearn.svm.SVC",
"sklearn.model_selection.cross_validate",
"numpy.average",
"numpy.random.randint"
]
] |
peter0083/AttnGAN | [
"9f80f32ce288a79ed65b8779c37df751e2802f94"
] | [
"code/datasets.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n\nfrom nltk.tokenize import RegexpTokenizer\nfrom collections import defaultdict\nfrom miscc.config import cfg\n\nimport torch\nimport torch.utils.data as data\... | [
[
"pandas.read_csv",
"numpy.minimum",
"numpy.maximum",
"numpy.asarray",
"numpy.arange",
"numpy.random.shuffle",
"numpy.sort",
"numpy.random.randint",
"torch.sort",
"numpy.zeros",
"torch.autograd.Variable"
]
] |
Scitator/Run-Skeleton-Run | [
"c8aefbc448f2d78699355eb843c75a78ac5132a4"
] | [
"common/env_wrappers.py"
] | [
"import numpy as np\nimport gym\nfrom gym.spaces import Box\nfrom osim.env import RunEnv\n\nfrom common.state_transform import StateVelCentr\n\n\nclass DdpgWrapper(gym.Wrapper):\n def __init__(self, env, args):\n gym.Wrapper.__init__(self, env)\n self.state_transform = StateVelCentr(\n o... | [
[
"numpy.array"
]
] |
m-rubik/Account-Manager | [
"7438baf402ac471f6da3686d7a01ed9eeb3fba88"
] | [
"src/pytrademl/utilities/plot_utilities.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport pytrademl.utilities.dataframe_utilities as dataframe_utilities\nimport matplotlib.dates as mdates\nfrom matplotlib import style\nfrom pandas.plotting import register_matplotlib_converters\n\nregister_matplotlib_converters()\nstyle.use('ggplot')\n\n\ndef g... | [
[
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"matplotlib.pyplot.title",
"matplotlib.style.use",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.ylabel",
"pandas.plotting.register_matplotlib_converters",
"matplotlib.pypl... |
GYMS-PKU/Daily-Frequency-Quant | [
"808eda9930efecff04ecf98abf617404cadd0003"
] | [
"QBG/Tester/BackTester.py"
] | [
"# Copyright (c) 2021 Dai HBG\n\n\"\"\"\nBackTester类根据传入信号以及交易逻辑进行交易\n\n开发日志\n2021-09-07\n-- 更新:BackTester类统计pnl序列的平均日收益,最大回撤,标准差,夏普比,最长亏损时间\n\n2021-09-11\n-- 修复:回测时剔除涨停板\n\n2021-09-21\n-- 修复:回测是要根据上一期的持仓确定涨停板是否剔除,有可能涨停的股票是有持仓的\n\"\"\"\nimport numpy as np\nimport datetime\n\n\nclass BackTester:\n def __init__(se... | [
[
"numpy.isnan",
"numpy.std",
"numpy.mean",
"numpy.corrcoef",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.vstack"
]
] |
team-sparrow/Vision | [
"e827e5a127cf429bcffb72af2be0c8d1dca001b0"
] | [
"VisionMain/skin_cancer_coreml_model/train_skin_cancer_app.py"
] | [
"\n# coding: utf-8\n\n# In[1]:\n\nfrom sklearn.datasets import load_files \nfrom keras.utils import np_utils\nimport numpy as np\nfrom glob import glob\nimport keras\n\n# define function to load train, test, and validation datasets\ndef load_dataset(path):\n data = load_files(path)\n condition_files = n... | [
[
"numpy.hstack",
"numpy.expand_dims",
"sklearn.datasets.load_files",
"numpy.argmax",
"numpy.array",
"numpy.vstack"
]
] |
xiangyu-xing/pychaotic | [
"4bbe67d0da1d75e6c219115aae37496bf365a59a"
] | [
"lyapunov.py"
] | [
"from typing import NoReturn\nimport numpy\nimport math\nfrom scipy.integrate import odeint\nfrom scipy.linalg import solve_lyapunov\n\n\ndef lyapunov(n, rhs_ext_fcn, fcn_integrator, tstart, stept, tend, ystart):\n \"\"\"\n fcn_integrator: callable\n \"\"\"\n n1 = n\n n2 = n1*(n1+1)\n # number of ... | [
[
"numpy.array",
"numpy.zeros",
"numpy.matmul"
]
] |
tamnguyenvan/small_object_detection | [
"526ba8be016dd4781ce45c43848f0dac3924a0ee"
] | [
"model.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport math\nfrom utils import convert_to_corners, compute_iou\nfrom data_processing import resize_and_pad_image\nfrom tensorflow import keras\n\n\ndef get_backbone(name=\"resnet50\", weight=None):\n \"\"\"Supported backbone: resnet50, resnet101, densenet121\"\"\"\n ... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow.equal",
"tensorflow.keras.applications.resnet.preprocess_input",
"tensorflow.keras.Input",
"tensorflow.logical_or",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.la... |
mmstoll/Ocean569_Code | [
"228cb719f3e82f187f704f343d3b3590a38236d7"
] | [
"MaunaLoa_Code/MaunaLoaFiltering.py"
] | [
"#program to create spectra of MaunaLoa CO2 data\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport random\nfrom netCDF4 import Dataset\n#\n# read and plot Mauna Loa CO2 data, from a netcdf file\n# \n# define the netcdf reading function\ndef import_data(file_name):\n data_netcdf = Dataset(file_name, mo... | [
[
"matplotlib.pyplot.legend",
"numpy.absolute",
"numpy.fft.irfft",
"numpy.sqrt",
"numpy.fft.rfft",
"matplotlib.pyplot.title",
"numpy.isnan",
"numpy.imag",
"numpy.conj",
"matplotlib.pyplot.loglog",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"numpy.real",... |
bertsky/cis-ocrd-py | [
"c3fad1a8b04dc5a305460e8bb3c54cb79cd75515"
] | [
"ocrd_cis/ocropy/ocrolib/common.py"
] | [
"# -*- coding: utf-8 -*-\n################################################################\n### common functions for data structures, file name manipulation, etc.\n################################################################\n\n\n\nimport os\nimport os.path\nimport re\nimport sys\nimport sysconfig\nimport unico... | [
[
"numpy.amax",
"matplotlib.pyplot.imshow",
"numpy.minimum",
"scipy.ndimage.morphology.binary_dilation",
"numpy.sqrt",
"numpy.dtype",
"numpy.mean",
"matplotlib.pyplot.gray",
"numpy.clip",
"numpy.unique",
"numpy.sin",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot... |
ca7869/tensorflow | [
"2daf3a3121f0da5cb060dca3958b2fa9c2f5dbc2"
] | [
"tfmodel.py"
] | [
"import os\n\nimport tensorflow as tf\nfrom tensorflow.python import keras\n#import keras\nfrom tensorflow.python.keras.layers import Input, Dense\nfrom tensorflow.python.keras.preprocessing.image import ImageDataGenerator\nfrom tensorflow.python.keras.preprocessing.text import Tokenizer\nfrom keras.utils import to... | [
[
"tensorflow.python.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Flatten"
]
] |
530824679/YOLOv3 | [
"2ea5ccd136f00260b42eb459f5ab0884cb162483"
] | [
"model/ops.py"
] | [
"# -*- coding: utf-8 -*-\n# --------------------------------------\n# @Time : 2020/11/01\n# @Author : Oscar Chen\n# @Email : 530824679@qq.com\n# @File : ops.py\n# Description :base operators.\n# --------------------------------------\n\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\n\ndef... | [
[
"tensorflow.concat",
"tensorflow.image.resize_nearest_neighbor",
"tensorflow.shape",
"tensorflow.layers.max_pooling2d",
"tensorflow.contrib.slim.conv2d",
"tensorflow.pad",
"tensorflow.random_normal_initializer",
"tensorflow.nn.leaky_relu"
]
] |
buptlihang/ESPNetv2 | [
"9901d7e8a64cbfb24e5412a496d4ef230ac81093"
] | [
"segmentation/IOUEval.py"
] | [
"import numpy as np\n\n#adapted from https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/score.py\n\n#============================================\n__author__ = \"Sachin Mehta\"\n__license__ = \"MIT\"\n__maintainer__ = \"Sachin Mehta\"\n#============================================\n\nclass iouEval:\n ... | [
[
"numpy.diag",
"numpy.zeros",
"numpy.nanmean"
]
] |
SamuilYu/manim | [
"b726b40089a58a4684725d7216b01d8400ffb2bf"
] | [
"manim/mobject/graph.py"
] | [
"\"\"\"Mobjects used to represent mathematical graphs (think graph theory, not plotting).\"\"\"\n\n__all__ = [\n \"Graph\",\n]\n\nfrom copy import copy\nfrom typing import Hashable, List, Optional, Tuple, Type, Union\n\nimport networkx as nx\nimport numpy as np\n\nfrom ..animation.composition import AnimationGro... | [
[
"numpy.append",
"numpy.array"
]
] |
KishanGitASU/A3C-RL-baseline-agent-for-Grid2Op-environment | [
"675a559d03d9532505d687e11e3a2922348cc767"
] | [
"AsynchronousActorCritic.py"
] | [
"try:\r\n import grid2op\r\n import threading\r\n import numpy as np\r\n import time\r\n import json\r\n import copy\r\n import os\r\n from grid2op import make\r\n from grid2op.Agent import MLAgent\r\n from grid2op.Environment import Environment\r\n from grid2op.Parameters import Pa... | [
[
"numpy.sqrt",
"numpy.asarray",
"tensorflow.python.keras.backend.placeholder",
"numpy.zeros_like",
"tensorflow.python.keras.backend.log",
"numpy.hstack",
"tensorflow.python.keras.backend.square",
"numpy.reshape",
"tensorflow.python.keras.backend.sum",
"numpy.argmax",
"nu... |
VirtualEmbryo/lumen_network | [
"35b1dadccd087c9ef234f12c2735098b82890b34"
] | [
"network/network.py"
] | [
"# Library for the dynamics of a lumen network\n# The lumen are 2 dimensional and symmetric and connected with 1 dimensional tubes\n#\n# Created by A. Mielke, 2018\n# Modified by M. Le Verge--Serandour on 8/04/2019\n\n\"\"\"\n network.py conf.init\n \n Defines the class network and associated functions\n ... | [
[
"numpy.linalg.solve",
"numpy.sqrt",
"numpy.abs",
"numpy.arccos",
"numpy.sin",
"numpy.column_stack",
"numpy.zeros",
"numpy.sum",
"numpy.loadtxt"
]
] |
clixyz/droidbot | [
"e222af95b1e93f97625c862bbdeed04c0f78b827"
] | [
"droidbot/input_policy2.py"
] | [
"import logging\nimport collections\nimport copy\nimport logging\nimport random\nimport time\nimport math\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pad_sequence\n\nfrom .input_event import KeyEvent, IntentEvent, TouchEvent, UIEvent, K... | [
[
"torch.cat",
"torch.zeros",
"torch.nn.utils.rnn.pad_sequence",
"torch.nn.Embedding",
"torch.no_grad",
"torch.nn.Dropout",
"torch.ones",
"torch.sqrt",
"torch.nn.TransformerEncoder",
"torch.arange",
"numpy.zeros",
"numpy.random.choice",
"torch.nn.functional.logsig... |
ed-ortizm/anomaly | [
"87d0668133f0536532b9cd61c2a90fa998ec1ad3"
] | [
"src/anomaly/parallelReconstruction.py"
] | [
"\"\"\"process base parallelism to compute reconstruction anomaly scores\"\"\"\nimport itertools\nimport multiprocessing as mp\nfrom multiprocessing.sharedctypes import RawArray\n\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom anomaly.reconstruction import ReconstructionAnomalyScore\nfrom sdss.utils.managef... | [
[
"numpy.ctypeslib.as_array",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.compat.v1.Session",
"numpy.save"
]
] |
crackedcd/Intern.MT | [
"36398837af377a7e1c4edd7cbb15eabecd2c3103"
] | [
"simple-tensorflow-demo/3.neural network/tf_3rd_3_test.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\n## 参数\n# 学习率, 太小则每次optimizer变化很小, 学习速度慢; 太大则可能导致过度学习, 最终结果不准确\nlearning_rate = 0.01\n# 隐藏层深度\ntraining_epochs = 2000\n# 打印的节点层\ndisplay_step = 50\n\n\n## 构造训练数据\n## numpy.asarray将list/turple转成矩阵\ntrain_X = np.asarray([3.3, 4.4, 5.5, ... | [
[
"tensorflow.multiply",
"tensorflow.pow",
"numpy.asarray",
"tensorflow.placeholder",
"matplotlib.pyplot.plot",
"tensorflow.global_variables_initializer",
"tensorflow.train.GradientDescentOptimizer",
"numpy.random.randn",
"tensorflow.Session",
"matplotlib.pyplot.pause",
"... |
makersinchicago/socialraspi | [
"628f2555d4163e68fa97134c8507c3db77e93e7a"
] | [
"socialraspi.py"
] | [
"\"\"\"\n\nat boot, present prompt\n\nwait for user input\n\nat user input, record 1 minute of video and audio using picam\n\nafter recording is done, present prompt. user may play back video or record anew\n\nif the user is satisfied, they may press send to post the video to makersinchicago's twitter timeline, the... | [
[
"numpy.fromstring",
"numpy.abs"
]
] |
akeaveny/robo-gym | [
"9ad8cf2e7adf12062b1bc5e62afb2938f70d02a9"
] | [
"scripts/random_agent_sim.py"
] | [
"import gym\nfrom gym.wrappers import TimeLimit\nfrom gym.wrappers import FlattenObservation\n\nimport robo_gym\nfrom robo_gym.wrappers.exception_handling import ExceptionHandling\nfrom robo_gym.wrappers.flatten_action_space import FlattenAction\n\ntarget_machine_ip = 'localhost' # or other machine 'xxx.xxx.xxx.xxx... | [
[
"numpy.array"
]
] |
d9w/pyCGP | [
"8f23bda9d653b9def91e108e7fdad61c029178e1"
] | [
"test/test_functions.py"
] | [
"from pycgp import CGP\nfrom pycgp.cgpfunctions import *\nimport numpy as np\n\ndef rand_arg():\n return np.random.rand() * 2.0 - 1\n\ndef build_func_lib():\n return [CGP.CGPFunc(f_sum, 'sum', 2),\n CGP.CGPFunc(f_aminus, 'aminus', 2),\n CGP.CGPFunc(f_mult, 'mult', 2),\n CGP.CG... | [
[
"numpy.isnan",
"numpy.random.rand"
]
] |
andreasjansson/DeepBach | [
"588e1965772856b98d0816518c1c6c71fc30b317"
] | [
"DeepBach/data_utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n@author: Gaetan Hadjeres\n\"\"\"\n\nimport torch\nfrom DeepBach.helpers import cuda_variable\n\n\ndef mask_entry(tensor, entry_index, dim):\n \"\"\"\n Masks entry entry_index on dim dim\n similar to\n torch.cat((\ttensor[ :entry_index],\ttensor[ e... | [
[
"torch.LongTensor"
]
] |
PravyAI/DeepLearning | [
"2f6c32f526e649139b1762f3700db20c0d9bd83a"
] | [
"SimpleMnistClassifier/MNISTclassifier.py"
] | [
"\n# coding: utf-8\n\n# In[1]:\n\n\n# Copyright 2015 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/lic... | [
[
"tensorflow.matmul",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.InteractiveSession",
"tensorflow.zeros",
"tensorflow.cast",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.argmax",... |
Stelath/geoguessr-ai | [
"08f5ae7ca8d1e50d586ee66222814589f4095a6d"
] | [
"find_best_model.py"
] | [
"import os\nimport argparse\nfrom tqdm import tqdm\nimport numpy as np\nfrom datetime import datetime\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.data\nimport torchvision.models as models\nfrom geoguessr_dataset import GeoGuessrDataset\n\nmodel_names = sorted(name for name in models.__dict__\n if ... | [
[
"torch.load",
"torch.utils.data.DataLoader",
"torch.nn.Sigmoid",
"torch.nn.BCELoss",
"numpy.mean",
"torch.where",
"torch.device"
]
] |
lucfra/RFHO | [
"e08a36fcc342a46648c5e9d7f64a69cb3d3c6c79"
] | [
"rfho/models.py"
] | [
"# import data\n# import numpy as np\n# working with placeholders\nfrom functools import reduce\n\nimport tensorflow as tf\nfrom rfho.utils import MergedVariable\nimport tensorflow.contrib.graph_editor as ge\nimport rfho.utils as utils\n\ntest = False\ndo_print = False\n\n\ndef calc_mb(_shape, _type=32):\n from ... | [
[
"tensorflow.get_default_session",
"tensorflow.truncated_normal",
"tensorflow.concat",
"tensorflow.nn.max_pool",
"tensorflow.reshape",
"tensorflow.identity",
"tensorflow.variables_initializer",
"tensorflow.placeholder",
"tensorflow.contrib.layers.xavier_initializer",
"tensor... |
karakusc/OpenSeq2Seq | [
"87e9625af99b799808d5d9af8147f8ee4a2c5dbe"
] | [
"open_seq2seq/decoders/fc_decoders.py"
] | [
"# Copyright (c) 2018 NVIDIA Corporation\n\"\"\"This module defines various fully-connected decoders (consisting of one\nfully connected layer).\n\nThese classes are usually used for models that are not really\nsequence-to-sequence and thus should be artificially split into encoder and\ndecoder by cutting, for exam... | [
[
"tensorflow.nn.ctc_greedy_decoder",
"tensorflow.transpose",
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.layers.dense",
"tensorflow.SparseTensor",
"tensorflow.load_op_library"
]
] |
technetbytes/CNIC | [
"51b7f92d6e77509167b86643ee8fef44d39e193c"
] | [
"generate_tfrecord.py"
] | [
"\"\"\"\nUsage:\n\n# Create train data:\npython generate_tfrecord.py --label=<LABEL> --csv_input=<PATH_TO_ANNOTATIONS_FOLDER>/train_labels.csv --output_path=<PATH_TO_ANNOTATIONS_FOLDER>/train.record\n\n# Create test data:\npython generate_tfrecord.py --label=<LABEL> --csv_input=<PATH_TO_ANNOTATIONS_FOLDER>/test_la... | [
[
"tensorflow.compat.v1.python_io.TFRecordWriter",
"pandas.read_csv",
"tensorflow.compat.v1.app.run"
]
] |
zy-song/pysindy | [
"6ed02140c3e255c8bb69b19a7d9452930bd3253d"
] | [
"pysindy/feature_library/polynomial_library.py"
] | [
"from itertools import chain\nfrom itertools import combinations\nfrom itertools import combinations_with_replacement as combinations_w_r\n\nimport numpy as np\nfrom scipy import sparse\nfrom sklearn.preprocessing import PolynomialFeatures\nfrom sklearn.preprocessing._csr_polynomial_expansion import _csr_polynomial... | [
[
"scipy.sparse.isspmatrix",
"sklearn.preprocessing._csr_polynomial_expansion._csr_polynomial_expansion",
"sklearn.utils.validation.check_is_fitted",
"sklearn.utils.check_array",
"numpy.empty",
"numpy.ones",
"numpy.bincount",
"scipy.sparse.hstack",
"scipy.sparse.isspmatrix_csr",
... |
A-suozhang/aw_nas | [
"9feb24974c7b44592e22ee45b98e116603d06eba"
] | [
"aw_nas/rollout/ofa.py"
] | [
"\"\"\"\nDefinitions of mnasnet OFA rollout and search space.\n\"\"\"\n\nimport numpy as np\n\nfrom aw_nas import utils\nfrom aw_nas.rollout.base import Rollout\nfrom aw_nas.common import SearchSpace, genotype_from_str\n\n\nclass MNasNetOFASearchSpace(SearchSpace):\n NAME = \"ofa\"\n SCHEDULABLE_ATTRS = [\"wi... | [
[
"numpy.random.choice"
]
] |
VandanaAgarwal/SlowFast | [
"7b1271089fbfc0b5a65bf0c322eb6ecfc0391b1d"
] | [
"slowfast/visualization/video_visualizer_colab.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport itertools\nimport logging as log\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nfrom detectron2.utils.visualizer import Visualizer\n\nimport slowfast.utils.logging as logging\nfrom slowfas... | [
[
"numpy.sqrt",
"torch.Tensor",
"numpy.linspace",
"torch.from_numpy",
"matplotlib.pyplot.get_cmap",
"numpy.full",
"numpy.argmin",
"torch.nonzero",
"torch.topk",
"numpy.array"
]
] |
zergmk2/tf_ctpn | [
"f0f20606b3a2e58819cb330ede52b1d9e2c21d31"
] | [
"lib/layer_utils/proposal_layer.py"
] | [
"# --------------------------------------------------------\n# Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfr... | [
[
"numpy.reshape",
"numpy.hstack"
]
] |
0xNaN/tinygrad | [
"4bdb524da7696e47cec02a211a1829c14b434cda"
] | [
"tinygrad/gradcheck.py"
] | [
"import numpy as np\n\nfrom tinygrad.utils import mask_like\nfrom tinygrad.tensor import Tensor\n\ndef jacobian(func, input):\n output = func(input)\n\n ji = input.data.reshape(-1).shape[-1]\n jo = output.data.reshape(-1).shape[-1]\n J = np.zeros((jo,ji))\n\n for o in range(jo):\n # tinygrad doesn't support... | [
[
"numpy.zeros",
"numpy.allclose"
]
] |
MathiasPede/Fast-Time-Series-Clustering | [
"dc2d01fe3cfd57a80ba2a1f10d0fc00eaed05f09"
] | [
"tests/singular_values_test.py"
] | [
"import numpy as np\n\nfrom math import floor\nfrom ftsc.singular_values import calculate_best_relative_error_for_all_ranks, calculate_best_relative_error_rank\nfrom tests.plotting_utils import scatter_plot, multiple_scatter_plot\nfrom tests.tests_utils import get_singular_values, get_all_test_dataset_names\n\n\nde... | [
[
"numpy.arange",
"numpy.std",
"numpy.average",
"numpy.max"
]
] |
alzaia/improving_neural_nets_python | [
"52cc9c88d895e87d8024e36b86776f644e629634"
] | [
"utils/opt_utils.py"
] | [
"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport h5py\nimport scipy.io\nimport sklearn\nimport sklearn.datasets\n\ndef sigmoid(x):\n s = 1/(1+np.exp(-x))\n return s\n\ndef relu(x):\n s = np.maximum(0,x)\n return s\n\ndef load_params_and_grads(seed=1):\n np.random.seed(seed)\n W1 = np... | [
[
"numpy.dot",
"numpy.log",
"matplotlib.pyplot.contourf",
"numpy.maximum",
"numpy.sqrt",
"numpy.random.seed",
"matplotlib.pyplot.scatter",
"sklearn.datasets.make_moons",
"numpy.arange",
"numpy.int64",
"numpy.random.randn",
"numpy.mean",
"numpy.exp",
"matplotli... |
GabrielCi77/ProjetInfo2021 | [
"ec40c6ae857e895f47c7740f8745dd428b729a24"
] | [
"lib/B23_findCoeff.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split, GridSearchCV\nfrom sklearn.linear_model import Lasso, Ridge\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics import r2_score, mean_squared_error\nimport matplotlib.pyplot as plt\n\n\n\n# Fonction q... | [
[
"sklearn.model_selection.GridSearchCV",
"pandas.read_csv",
"numpy.sqrt",
"numpy.logspace",
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.Lasso",
"sklearn.linear_model.Ridge",
"numpy.argmax",
"sklearn.preprocessing.StandardScaler",
"numpy.array"
]
] |
lslll0302/Planner-Carrier | [
"7611a02118f11b06533144c5e034f7938fb90068"
] | [
"src/gentask.py"
] | [
"import pandas as pd\nimport os \nimport re\nimport planner\n#import mysql.connector\n#from mysql.connector import Error\nimport utils\n\n\nlist_benchmarks=os.listdir(utils.BENCHMARK_PATH)\nlist_benchmarks.sort()\n\ndef listdir(path, char_): \n list_ = []\n for file in os.listdir(path):\n file_path = ... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
thomas-marquis/immo-tools-lib | [
"455d726923ad723b099ee098e8ded7e28942904c"
] | [
"demo.py"
] | [
"import numpy as np\n\nones = np.ones((3, 3))\n"
] | [
[
"numpy.ones"
]
] |
qgh1223/SLRDet | [
"f63335e9626067b462ad548c98f986e0d33addf9"
] | [
"mmdet/ops/ops/rotated/rotate_roi_pool.py"
] | [
"import torch\r\nimport torch\r\nfrom torch import nn\r\nfrom torch.autograd import Function\r\nfrom torch.autograd.function import once_differentiable\r\nfrom torch.nn.modules.utils import _pair\r\n\r\nfrom mmdet import _Custom as _C\r\n\r\nfrom apex import amp\r\n\r\nclass _RROIPool(Function):\r\n @staticmetho... | [
[
"torch.nn.modules.utils._pair"
]
] |
cloudsTrafton/AwesomeSauce | [
"24d3694ebe47e59b2fbbd405f52ea5542cd3b945"
] | [
"clustering/NoSeekTime.py"
] | [
"# Keep the clustering experiments that involve outliers here\nfrom clustering.KMeansVariations import kMeans_baseline, kMeans_baseline_high_iteration, kMeans_baseline_random_init, \\\n kMeans_baseline_4_clusters, kMeans_baseline_3_clusters, kMeans_baseline_2_clusters, kMeans_baseline_2_clusters_low_iter,\\\n ... | [
[
"pandas.DataFrame"
]
] |
LingxB/atlx | [
"1230c4f845adb57edb2a91556282af500ef27880"
] | [
"src/utils/file_utils.py"
] | [
"import yaml\nfrom dotenv import load_dotenv, find_dotenv\nimport os\nimport inspect\nfrom src.utils.att_dict import AttributeDict\nfrom src.utils.data_utils import create_symbol_dict\nimport warnings\nimport pandas as pd\nfrom time import time\nfrom datetime import datetime\nimport pickle\n\ndef get_timestamp():\n... | [
[
"pandas.read_parquet",
"pandas.read_csv"
]
] |
wegenmat/python | [
"d3f73197fc5b53fe75b0a0fc6ab88d87d785549d"
] | [
"period-detection-in-power-law-noise/psresp.py"
] | [
"import numpy as np\n\n__all__ = [\n 'psresp',\n]\n\n\ndef _spectrum(x, slope):\n y = x ** slope\n\n return y\n\n\ndef _timmerlc(slope, nt='None', dt='None', mean='None', sigma='None', seed='None'):\n if dt == 'None':\n dt = 1\n if nt == 'None':\n nt = 65536\n if mean == 'None':\n ... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.max",
"numpy.mean",
"numpy.var",
"numpy.where",
"numpy.trapz",
"numpy.hstack",
"scipy.interpolate.UnivariateSpline",
"numpy.greater_equal",
"numpy.argmax",
"numpy.interp",
"numpy.min",
"numpy.fft.ifft",
"numpy.log10... |
bhubesh757/Object_Detection | [
"33e6b07a57e6cfc80d28f9c466e392138399d853"
] | [
"Object_Detection_Using_Opencv/Object_detection_removing_the_duplicates.py"
] | [
"import cv2\r\nimport numpy as np\r\n\r\n# first import the image to check the image whether its checking or not\r\n\r\n#img = cv2.imread('Lenna_(test_image).PNG')\r\n# instead of doing the image we can do the code through the webacam\r\nthres = 0.45\r\n\r\nnms_threshold = 0.2\r\ncam = cv2.VideoCapture(0)\r\ncam.se... | [
[
"numpy.array"
]
] |
Commoneffort/eos | [
"ed56850f5e7c88b32b4adc27dc8a8c8cc34d2298"
] | [
"tutorials/bios-boot-tutorial/bios-boot-tutorial.py"
] | [
"#!/usr/bin/env python3\n\nimport argparse\nimport json\nimport numpy\nimport os\nimport random\nimport re\nimport subprocess\nimport sys\nimport time\n\nargs = None\nlogFile = None\n\nunlockTimeout = 999999999\nfastUnstakeSystem = './fast.refund/eosio.system/eosio.system.wasm'\n\nsystemAccounts = [\n 'eosio.bpa... | [
[
"numpy.random.pareto"
]
] |
Mr-Elysium/wallstreet | [
"621c2dd966baf1b062ae0af197e0119ae8b6c1f8"
] | [
"wallstreet/blackandscholes.py"
] | [
"import requests\nfrom bs4 import BeautifulSoup\n\nfrom scipy.interpolate import interp1d\nfrom scipy import sqrt, log, exp\nfrom scipy.stats import norm\nfrom scipy.optimize import fsolve\n\nfrom wallstreet.constants import *\n\n\ndef riskfree():\n try:\n r = requests.get(TREASURY_URL)\n soup = Be... | [
[
"scipy.optimize.fsolve",
"scipy.log",
"scipy.stats.norm.cdf",
"scipy.stats.norm.pdf",
"scipy.sqrt",
"scipy.interpolate.interp1d",
"scipy.exp"
]
] |
deeplearninc/relaax | [
"a0cf280486dc74dca3857c85ec0e4c34e88d6b2b"
] | [
"relaax/common/rlx_message.py"
] | [
"from builtins import object\n\nimport numpy as np\nfrom PIL import Image\nfrom struct import pack, unpack_from\n\nV = True\n\n\nclass RLXMessageImage(object):\n def __init__(self, image):\n self.image = image\n\n\nclass RLXMessage(object):\n # types: https://docs.python.org/3.5/library/struct.html#str... | [
[
"numpy.asarray",
"numpy.dtype"
]
] |
MrAttoAttoAtto/CircuitSimulatorC2 | [
"4d821c86404fe3271363fd8c1438e4ca29c17a13"
] | [
"Initial Testing/RLC Test.py"
] | [
"\nimport math\nimport subprocess\nimport time\nfrom copy import deepcopy\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.linalg\n\n\n# Initial guess\ninput_vec = [3, 0, 0, 1e-3]\n\n# Resistance in Ohms\nR = 30\n\n# Capacitance in Farads\nC = 2e-6\n\n# Inductance in Henrys\nL = 20e-3\n\n# Initi... | [
[
"numpy.array",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
]
] |
gift-surg/PySiTK | [
"6bb9419b9e5ec7c20aab443172b86da69a268b9a"
] | [
"tests/simple_itk_helper_test.py"
] | [
"# \\file simple_itk_helper_test.py\n# \\brief Class containing unit tests for module SimpleITKHelper\n#\n# \\author Michael Ebner (michael.ebner.14@ucl.ac.uk)\n# \\date December 2015\n\n\n# Import libraries\nimport SimpleITK as sitk\nimport itk\nimport numpy as np\nimport unittest\nimport os\nimport sys\n\n# I... | [
[
"numpy.zeros_like",
"numpy.linalg.norm"
]
] |
kagemeka/python-algorithms | [
"dface89b8c618845cf524429aa8e97c4b2b10ceb"
] | [
"src/dsalgo_numpy/sieve_of_eratosthenes.py"
] | [
"import numpy as np\n\n\ndef least_prime_factor_np(n: int) -> np.ndarray:\n s = np.arange(n)\n s[:2] = -1\n i = 0\n while i * i < n - 1:\n i += 1\n if s[i] == i:\n np.minimum(s[i * i :: i], i, out=s[i * i :: i])\n return s\n\n\ndef sieve_of_eratosthenes_np(n: int) -> np.ndarr... | [
[
"numpy.arange",
"numpy.minimum"
]
] |
MarcCote/spatial-reasoning | [
"06c57cfafbd1c24b68d6ab634d19806964d867f3",
"06c57cfafbd1c24b68d6ab634d19806964d867f3"
] | [
"spatial_reasoning/environment/MDP.py",
"spatial_reasoning/models/uvfa_text.py"
] | [
"import numpy as np\n\nclass MDP:\n\n def __init__(self, world, rewards, terminal):\n self.world = world\n self.reward_map = rewards\n self.terminal_map = terminal\n self.shape = self.reward_map.shape\n\n self.M, self.N = self.shape\n self.states = [(i,j) for i in range(... | [
[
"numpy.random.randn",
"numpy.zeros"
],
[
"torch.autograd.Variable",
"torch.cat",
"torch.zeros"
]
] |
hthieu166/cs547-final-proj-image-ranking | [
"81c6d3ebccae77df1d2e8421927a1a2684f80c98"
] | [
"src/utils/img_ranking_evaluate.py"
] | [
"import torch \nfrom sklearn.metrics import average_precision_score\nimport ipdb\nimport numpy as np\n\ndef img_ranking_evaluate_tinyImageNet(img_embs, labels, export_result = False):\n #Pair-wise L2 distance between each pair\n c_dist = torch.cdist(img_embs, img_embs)\n #Sort the image id in ascending o... | [
[
"torch.randint",
"torch.manual_seed",
"torch.randn",
"torch.cdist",
"numpy.mean",
"sklearn.metrics.average_precision_score",
"torch.argsort"
]
] |
zeyademam/active_learning | [
"fc90eaed32ba5aeb88542fa4f6e8fa9d4fdd80ee"
] | [
"src/query_strategies/vae.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport numpy as np\n\nCROP_H = 64\nCROP_W = 64\n\nclass View(nn.Module):\n def __init__(self, size):\n super(View, self).__init__()\n self.size = size\n\n def forward(self, tensor):\n return tensor.view(self.size)\n\n\ncl... | [
[
"torch.nn.init.kaiming_normal",
"numpy.random.seed",
"torch.nn.ConvTranspose2d",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"numpy.random.randint"
]
] |
neergaard/eegbci-data | [
"d3270d500b5eba452ed6647ec42a9af404e17b0a"
] | [
"eegbci/data_containers/mixins/collatefunction_mixin.py"
] | [
"from typing import TypedDict\n\nimport torch\n\n\nclass CollateFnMixin:\n def collate_fn(self, batch) -> TypedDict:\n\n subject_id_map = [int(x[2][1:4]) - 1 for x in batch]\n\n waveforms = torch.stack([torch.as_tensor(x[0]) for x in batch])\n targets = torch.stack([torch.as_tensor(x[1]) for... | [
[
"torch.as_tensor"
]
] |
YutongWangUMich/tf_multiclass | [
"69f3cd638da87fc0fcad87b732fcb30dde51ce07"
] | [
"utils.py"
] | [
"from tensorflow.keras.utils import to_categorical\nimport tensorflow.keras.backend as K\nimport tensorflow as tf\n\ndef add_constant_column(x,val):\n# return K.concatenate([x,K.constant(val,shape=(x.shape[0],1))],axis=-1)\n# return K.concatenate([x,K.constant(val,shape=(x.shape[0],1))],axis=-1)\n return... | [
[
"tensorflow.keras.utils.to_categorical",
"tensorflow.pad"
]
] |
AgDude/Adeept_RaspTank | [
"1c22e4681233f859c638716054ac7a9dc394862b"
] | [
"server/FPVtest.py"
] | [
"#!/usr/bin/env/python3\n# File name : server.py\n# Description : for FPV video and OpenCV functions\n# Website\t : www.gewbot.com\n# Author\t : William(Based on Adrian Rosebrock's OpenCV code on pyimagesearch.com)\n# Date\t\t: 2019/08/28\n\nimport time\nimport threading\nimport cv2\nimport zmq\nimport base64\ni... | [
[
"numpy.array",
"numpy.where",
"numpy.sum"
]
] |
Jsunseri/integrate | [
"900354a1107a0e0170bf64d1560963e3bc8df1a1"
] | [
"integrate/stochastic/monte_carlo.py"
] | [
"\"\"\"\nThis module implements 1d and 2d Monte Carlo integration\n\"\"\"\n\nimport numpy as np\n\n\ndef monte_1d(x, f, trials):\n a = x[0]\n b = x[1]\n d = (b - a) * np.random.rand(1, trials) + a\n y = f(d)\n return (b - a) * np.sum(y) / float(trials)\n\n\ndef monte_2d(f, v, domain, trials):\n ar... | [
[
"numpy.sqrt",
"numpy.min",
"numpy.random.rand",
"numpy.prod",
"numpy.where",
"numpy.sum"
]
] |
tpvt99/rl-course | [
"993db19c2c25ed1c51a4f4fbfff2fa170da27562"
] | [
"hw2/pg2.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport gym\nimport logz\nimport os\nimport time\nimport inspect\nfrom multiprocessing import Process\n\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.layers import Dense\n\nclass MLP(Model):\n def __init__(self, output_size, scope, n_layers, size, activat... | [
[
"tensorflow.multiply",
"tensorflow.random.categorical",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"numpy.concatenate",
"numpy.std",
"tensorflow.keras.optimizers.Adam",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits",
"numpy.mean",
"numpy.array",
"t... |
Spring-CC/restaurant-native-app | [
"e3ec732a5d9afce1b15d77e799ccbd7e0de90244"
] | [
"recommender/machine.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom pathlib import Path\nfrom ast import literal_eval\nfrom scipy.sparse import csr_matrix\nfrom sklearn.neighbors import NearestNeighbors\nimport scipy\n\n\n# sparse matrix\nswipeddata_df = pd.read_csv(\n 'data/testuser.csv', usecols=[0, 1, 2], index_col=1)\nswipeddata... | [
[
"pandas.read_csv",
"numpy.random.choice",
"scipy.sparse.csr_matrix",
"pandas.DataFrame",
"sklearn.neighbors.NearestNeighbors"
]
] |
erihsu/vgg16_quantization | [
"677c3c2cabcef68e89149bd74d17f44c0f496749"
] | [
"freeze.py"
] | [
"import os\nimport argparse\nimport tensorflow as tf\n\n\ndef freeze_graph(model_ckpt, output_nodes, rename_nodes=None):\n meta_file = model_ckpt + '.meta'\n if not tf.gfile.Exists(meta_file):\n raise FileNotFoundError('file not found: %s' % meta_file)\n model_dir = \"/\".join(os.path.abspath(model_... | [
[
"tensorflow.gfile.Exists",
"tensorflow.gfile.GFile",
"tensorflow.train.import_meta_graph",
"tensorflow.Session",
"tensorflow.get_default_graph"
]
] |
crim-ca/thelper | [
"1415144cf70e4492c2ef00f834e2b9a988064a76"
] | [
"thelper/data/geo/ogc.py"
] | [
"\"\"\"Data parsers & utilities module for OGC-related projects.\"\"\"\n\nimport copy\nimport functools\nimport logging\n\nimport cv2 as cv\nimport numpy as np\nimport tqdm\n\nimport thelper.data\nimport thelper.data.geo as geo\nimport thelper.train.utils\n\nlogger = logging.getLogger(__name__)\n\n\nclass TB15D104:... | [
[
"numpy.asarray",
"numpy.uint8",
"numpy.stack",
"matplotlib.pyplot.show",
"numpy.where",
"matplotlib.pyplot.pause"
]
] |
Y-miura-ta/Nyanko | [
"4a6216c68fb727908fa8d296f01dbbb2cbcc2775"
] | [
"LegTrajectory.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ng = 9800 # 単位は [mm/s^2]\n\n# 5次スプラインを求めるための行列は時間軸を正規化するので固定可能\nS_RATE = 1.0\nCmat = np.array([\n [0, 0, 0, 0, 0, 1],\n [S_RATE**5, S_RATE**4, S_RATE**3, S_RATE**2, S_RATE, 1],\n [0, 0, 0, 0, 1, 0],\n [5*S_RATE**4, 4*S_RAT... | [
[
"numpy.linalg.inv",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
stidk/GAM-SSD | [
"4a74ecc6b39d7202f0ca400ec33da1cce1a8c2a0"
] | [
"ppdet/modeling/anchor_heads/yolo_head.py"
] | [
"# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.reshape",
"numpy.repeat",
"numpy.tile"
]
] |
jonaslindemann/compute-course-public | [
"b8f55595ebbd790d79b525efdff17b8517154796"
] | [
"matplotlib/ex20.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jun 7 14:19:31 2017\n\n@author: Jonas Lindemann\n\"\"\"\n\n\"\"\"\nDemo of the `streamplot` function.\n\nA streamplot, or streamline plot, is used to display 2D vector fields. This\nexample shows a few features of the stream plot function:\n\n * Varying the color... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.sqrt"
]
] |
MachineLearningBCAM/minimax-risk-classifier | [
"38eb2413de54ee804b0be81781bd65ac4a748ced"
] | [
"venv/lib/python3.6/site-packages/nlp/utils/py_utils.py"
] | [
"# coding=utf-8\n# Copyright 2020 The HuggingFace NLP Authors and the TensorFlow Datasets Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/li... | [
[
"numpy.array"
]
] |
InvokerLiu/DenseNet-Tensorflow | [
"8e171eb3f14a46cc68cdebd3d4db92b1376af698"
] | [
"nets/DenseNet56.py"
] | [
"#! /usr/bin/env python3\r\n# coding=utf-8\r\n\r\n# ================================================================\r\n#\r\n# Editor : PyCharm\r\n# File name : DenseNet56.py\r\n# Author : LiuBo\r\n# Created date: 2019-05-08 19:37\r\n# Description :\r\n#\r\n# ==================================... | [
[
"tensorflow.nn.relu",
"tensorflow.nn.softmax",
"tensorflow.layers.batch_normalization",
"tensorflow.summary.FileWriter",
"tensorflow.control_dependencies",
"tensorflow.get_collection",
"tensorflow.reshape",
"tensorflow.argmax",
"tensorflow.placeholder",
"tensorflow.cast",
... |
TomNicholas/pint-xarray | [
"6ee1bf9aff0c6bef51bde2ecf6a62660a9ed6f39"
] | [
"pint_xarray/tests/test_accessors.py"
] | [
"import numpy as np\nimport pint\nimport pytest\nimport xarray as xr\nfrom numpy.testing import assert_array_equal\nfrom pint import Unit, UnitRegistry\n\nfrom .. import accessors, conversion\nfrom .utils import (\n assert_equal,\n assert_identical,\n assert_units_equal,\n raises_regex,\n requires_bo... | [
[
"numpy.logspace",
"numpy.arange",
"numpy.testing.assert_array_equal",
"numpy.linspace"
]
] |
makutaga/vtksample | [
"4eaea97547355ea87a12f7f1a3283940cda3d2da"
] | [
"twoCharges.py"
] | [
"#!/usr/bin/env python3\n\"\"\"EVTK sample script\n\n空間に正負の電荷を置いたときの周辺の電位,電界分布を計算し,\nvtkファイルで出力する.\n\"\"\"\n\nimport numpy as np\nimport scipy.constants as const\nimport scipy\nimport pyevtk\n\n\ndef main(vtktype='vts'):\n \"\"\" メイン\n\n Args:\n vtktype : vtk ファイルの種類を指定する.(vts | vtr)\n \"\"\"\n\n ... | [
[
"numpy.meshgrid",
"numpy.zeros_like",
"numpy.sqrt",
"numpy.linspace"
]
] |
arice84/bootcamp | [
"73a5517bcf282fdb2bd8808eb2bfb839eaceadf1"
] | [
"bootcamp_utils.py"
] | [
"\"\"\"bootcamp utilities a collection of functions that are useful in bootcamp\"\"\"\nimport numpy as np\n\ndef ecdf(data):\n \"\"\"compute x, y values for an empirical distribution function\"\"\"\n x = np.sort(data)\n y = np.arange(1, 1+len(x)) / len(x)\n return x, y\n\ndef plot_ecdf(x, y):\n plt.p... | [
[
"numpy.empty",
"numpy.percentile",
"numpy.sort"
]
] |
xnox/BLAKE3-specs | [
"06c989589e21fb674606f09ee859eed43e6af75e"
] | [
"benchmarks/thread_benches/plot.py"
] | [
"#! /usr/bin/env python3\n\nimport json\nfrom matplotlib import pyplot\nfrom pathlib import Path\nimport pandas\nimport seaborn\nimport sys\n\nBENCH_NAMES = [\n (\"threads_48\", \"48 threads\"),\n (\"threads_32\", \"32 threads\"),\n (\"threads_16\", \"16 threads\"),\n (\"threads_08\", \"8 threads\"),\n ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"pandas.DataFrame"
]
] |
mintiti/efficient-rl | [
"d65e9929ebb47bd2264a49b71088e41712611ff6"
] | [
"utils/wrappers.py"
] | [
"import gym\nfrom gym.wrappers import TimeLimit\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\nclass DoneOnSuccessWrapper(gym.Wrapper):\n \"\"\"\n Reset on success and offsets the reward.\n Useful for GoalEnv.\n \"\"\"\n\n def __init__(self, env, reward_offset=1.0):\n super(DoneOnSu... | [
[
"numpy.ones_like",
"numpy.abs",
"matplotlib.pyplot.title",
"numpy.fft.fft",
"numpy.concatenate",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"numpy.zeros_like",
"numpy.fft.fftfreq",
"matplotlib.pyplot.xlabel",
"numpy.repeat",
"matplotlib.pyplot.show",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.