code: def _filter_index_pages(docnames, base_dir):
      
      for docname in docnames:
          parts = docname.split('/')
          if len(parts) == 3 and parts[0] == base_dir and parts[2] == 'index':
              yield docname
docs: Filter docnames to only yield paths of the form
      ``<base_dir>/<name>/index``
  
      Parameters
      ----------
      docnames : `list` of `str`
          List of document names (``env.found_docs``).
      base_dir : `str`
          Base directory of all sub-directories containing index pages.
  
      Yields
      ------
      docname : `str`
          Document name that meets the pattern.