37 lines
938 B
Python
37 lines
938 B
Python
###################################################################
|
|
# Copyright (c) 2023 by TAOS Technologies, Inc.
|
|
# All rights reserved.
|
|
#
|
|
# This file is proprietary and confidential to TAOS Technologies.
|
|
# No part of this file may be reproduced, stored, transmitted,
|
|
# disclosed or used in any form or by any means other than as
|
|
# expressly provided by the written permission from Jianhui Tao
|
|
#
|
|
###################################################################
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
# about tools funciton extension
|
|
#
|
|
|
|
import sys
|
|
import os
|
|
import time
|
|
import datetime
|
|
import psutil
|
|
|
|
|
|
# cpu frequent as random
|
|
def cpuRand(max):
|
|
decimal = int(str(psutil.cpu_freq().current).split(".")[1])
|
|
return decimal % max
|
|
|
|
# remove single and doulbe quotation
|
|
def removeQuota(origin):
|
|
value = ""
|
|
for c in origin:
|
|
if c != '\'' and c != '"':
|
|
value += c
|
|
|
|
return value |