code: def write_index(self, overwrite: bool = False, mock: bool = False) -> None:
          
          write_if_allowed(self.index_filename, self.index_content(),
                           overwrite=overwrite, mock=mock)
docs: Writes the index file, if permitted.
  
          Args:
              overwrite: allow existing files to be overwritten?
              mock: pretend to write, but don't