<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(l, types=(list, float)):
 """ Flat nested list of lists into a single list. """

    l = [item if isinstance(item, types) else [item] for item in l]
    return [item for sublist in l for item in sublist]