<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def flatten_multidict(multidict):
 """Return flattened dictionary from ``MultiDict``."""

    return dict([(key, value if len(value) > 1 else value[0])
                 for (key, value) in multidict.iterlists()])