code: def flatten(l):
      ''' Flatten an iterable. '''
      for el in l:
          if isinstance(el, collections.Iterable) and not isinstance(el, string_types):
              for sub in flatten(el):
                  yield sub
          else:
              yield ef flatten(l):
      ''' Flatten an iterable. '''
      for el in l:
          if isinstance(el, collections.Iterable) and not isinstance(el, string_types):
              for sub in flatten(el):
                  yield sub
          else:
              yield el
docs: Flatten an iterable.