Guest User

Untitled

a guest
Apr 22nd, 2019
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import itertools
  2. def flatten(seq):
  3. if isinstance(seq, list):
  4. return list(itertools.chain.from_iterable(map(flatten, seq)))
  5. else:
  6. return [seq]
RAW Paste Data