code: def to_utf8_optional_iterator(x):
      
      if isinstance(x, STRING_TYPES):
          return to_utf8(x)
  
      try:
          l = list(x)
      except TypeError as e:
          assert 'is not iterable' in str(e)
          return x
      else:
          return [ to_utf8_if_string(e) for e in l ]
docs: Raise TypeError if x is a str or if x is an iterable which
      contains a str.