def concrete(seq):
 if isinstance(seq, Iterator):
  seq = list(seq)
 if isinstance(seq, (tuple, list)):
  seq = list(map(concrete, seq))
 return seq

def concrete ( seq ) : if isinstance ( seq , Iterator ) : seq = list ( seq ) if isinstance ( seq , ( tuple , list ) ) : seq = list ( map ( concrete , seq ) ) return seq
make nested iterators concrete lists .