human
I wrote the below code

    (flattened_example, unflatten) = flatten(example)
    def flattened_func(flattened_params, *args, **kwargs):
        output = func(unflatten(flattened_params), *args, **kwargs)
        (flattened_output, _) = flatten(output)
        return flattened_output
    return (flattened_func, unflatten, flattened_example)

What's a good function header?
assistant
#Here's a good function header.

def flatten_func(func, example):