import inspect


async def asyncfn_executor_wrapper(fn, *args, **kwargs):

    """
        Checks if fn is a coroutine function, and if so
        awaits it. Else function is computed normally.

        Return:
            Function result
    """

    return await fn(*args, **kwargs) if inspect.iscoroutinefunction(fn) else fn(*args, **kwargs)