def fn_outputs_to_keyed_map(serialize_fn_out_keys, fn_output) -> Dict[str, Any]:
    """Convert outputs of a function to a dict of `{result_name: values}`

    accepts function outputs which are sequence, dict, or object.

    """
    if len(serialize_fn_out_keys) == 1:
        if not isinstance(fn_output, dict):
            fn_output = dict(zip(serialize_fn_out_keys, [fn_output]))
    elif not isinstance(fn_output, dict):
        fn_output = dict(zip(serialize_fn_out_keys, fn_output))
    return fn_output
Convert outputs of a function to a dict of `{result_name: values}`

    accepts function outputs which are sequence, dict, or object.

    
src/flash/core/serve/utils.py