code: def flatten(iterable):
      
      try:
          iterator, sentinel, stack = iter(iterable), object(), []
      except TypeError:
          yield iterable
          return
  
      while True:
          value = next(iterator, sentinel)
          if value is sentinel:
              if not stack:
                  break
              iterator = stack.pop()
          elif isinstance(value, str):
              yield value
          else:
              try:
                  new_iterator = iter(value)
              except TypeError:
                  yield value
              else:
                  stack.append(iterator)
                  iterator = new_iterator
docs: Non-recursive flatten.
      :param iterable:
      :return: