def build_map_async(coro=None, *, mode=None, unpack: bool = False):
    """ Decorator to wrap a coroutine to return a MapAsync operator.

    :param coro: coroutine to be wrapped
    :param mode: behavior when a value is currently processed
    :param unpack: value from emits will be unpacked (*value)
    """
    _mode = mode

    def _build_map_async(coro):
        @wraps(coro)
        def _wrapper(*args, mode=None, **kwargs) -> MapAsync:
            if 'unpack' in kwargs:
                raise TypeError('"unpack" has to be defined by decorator')
            if mode is None:
                mode = MODE.CONCURRENT if _mode is None else _mode
            return MapAsync(coro, *args, mode=mode, unpack=unpack, **kwargs)
        return _wrapper

    if coro:
        return _build_map_async(coro)

    return _build_map_async
def build_map_async ( coro = None , * , mode = None , unpack : bool = False ) : _mode = mode def _build_map_async ( coro ) : @ wraps ( coro ) def _wrapper ( * args , mode = None , ** kwargs ) -> MapAsync : if 'unpack' in kwargs : raise TypeError ( '"unpack" has to be defined by decorator' ) if mode is None : mode = MODE . CONCURRENT if _mode is None else _mode return MapAsync ( coro , * args , mode = mode , unpack = unpack , ** kwargs ) return _wrapper if coro : return _build_map_async ( coro ) return _build_map_async
Decorator to wrap a coroutine to return a MapAsync operator.

    :param coro: coroutine to be wrapped
    :param mode: behavior when a value is currently processed
    :param unpack: value from emits will be unpacked (*value)