mirror of
https://github.com/bcomsugi/Quickbooks-API.git
synced 2026-01-10 02:02:38 +07:00
27 lines
832 B
Python
27 lines
832 B
Python
|
|
from time import time
|
|
|
|
|
|
def timing(f):
|
|
# @wraps(f)
|
|
def wrap(*args, **kw):
|
|
ts = time()
|
|
result = f(*args, **kw)
|
|
te = time()
|
|
print('func:%r args:[%r, %r] took: %2.6f sec' % \
|
|
(f.__name__, args, kw, te-ts))
|
|
return result
|
|
return wrap
|
|
|
|
|
|
def cleanIncludeRetElements(includeRetElements_allowed:list, includeRetElements:list):
|
|
iREs = []
|
|
# print(f'{includeRetElements_allowed = }\n{includeRetElements = }')
|
|
if isinstance(includeRetElements, str): #if user put 1 str argument in IncludeRetElements, change it to list
|
|
includeRetElements = [includeRetElements]
|
|
for iRE in includeRetElements:
|
|
for iRE_a in includeRetElements_allowed:
|
|
if iRE.lower() == iRE_a.lower():
|
|
iREs.append(iRE_a)
|
|
break
|
|
return iREs |