code: def _flatten(container):
      
      if isinstance(container, string_types):
          container = [container]
      for elem in container:
          if isinstance(elem, string_types) or is_filter_tuple(elem):
              yield elem
          else:
              for elem2 in _flatten(elem):
                  yield elem2
docs: Flatten arbitrary nested list of filters into a 1-D list