bitcart/utils.py
async def call_universal(func: Callable, *args: Any, **kwargs: Any) -> Any:
    """Call a function: async or sync one. All passed arguments are passed to the function too

    Args:
        func (Callable): a function to call: either sync or async one

    Returns:
        Any: function execution result
    """
    try:
        result = func(*args, **kwargs)
        if inspect.isawaitable(result):
            result = await result
        return result
    except Exception:
        logger.error(f"Error occured:\n{traceback.format_exc()}")
Call a function: async or sync one. All passed arguments are passed to the function too

    Args:
        func (Callable): a function to call: either sync or async one

    Returns:
        Any: function execution result
    
Call a function: async or sync one. All passed arguments are passed to the function too
Call a function : async or sync one . All passed arguments are passed to the function too
async def call_universal(func: Callable, *args: Any, **kwargs: Any) -> Any:
    try:
        result = func(*args, **kwargs)
        if inspect.isawaitable(result):
            result = await result
        return result
    except Exception:
        logger.error(f"Error occured:\n{traceback.format_exc()}")
async def call_universal ( func : Callable , * args : Any , ** kwargs : Any ) -> Any : try : result = func ( * args , ** kwargs ) if inspect . isawaitable ( result ) : result = await result return result except Exception : logger . error ( f"Error occured:\n{traceback.format_exc()}" )
Call a function: async or sync one.
Call a function : async or sync one .
"""Call a function: async or sync one. All passed arguments are passed to the function too

    Args:
        func (Callable): a function to call: either sync or async one

    Returns:
        Any: function execution result
    """
function execution result
function execution result
Any
func
Callable
a function to call: either sync or async one
a function to call : either sync or async one
args
Any
kwargs
Any