Get the appropriate supervisor to use and pre-apply the function.

    Args:
        func: A function.

def get_supervisor(func: types.AnyFunction) -> types.Supervisor:
    """Get the appropriate supervisor to use and pre-apply the function.

    Args:
        func: A function.
    """
    if not callable(func):
        raise TypeError("func is not callable")
    if asyncio.iscoroutinefunction(func):
        supervisor = _async_supervisor
    else:
        supervisor = _sync_supervisor
    return functools.partial(supervisor, func)