def regen(it):
 if isinstance(it, (list, tuple)):
  return it
 return _regen(it)

def regen ( it ) : if isinstance ( it , ( list , tuple ) ) : return it return _regen ( it )
convert iterator to an object that can be consumed multiple times .