code: def _map_promise(map_fn, all_inputs):
    
    all_promises = utils.map_nested(map_fn, all_inputs)  # Apply the function
    res = utils.map_nested(_wait_on_promise, all_promises)
    return res
docs: Map the function into each element and resolve the promise.