def _flatten(n):
if isinstance(n, collections.Sequence):<EOL><INDENT>for x in n:<EOL><INDENT>for y in _flatten(x):<EOL><INDENT>yield y<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>yield n<EOL><DEDENT>
Recursively flatten a mixed sequence of sub-sequences and items