<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(cls, errors):
 """ Unwind `MultipleErrors` to have a plain list of `Invalid` :type errors: list[Invalid|MultipleInvalid] :rtype: list[Invalid] """

        ers = []
        for e in errors:
            if isinstance(e, MultipleInvalid):
                ers.extend(cls.flatten(e.errors))
            else:
                ers.append(e)
        return ers