def format(self, name: bool=False, formatter: (Callable | None)=None, na_rep: str='NaT', date_format: (str | None)=None) -> list[str]:
    '\n        Render a string representation of the Index.\n        '
    header = []
    if name:
        header.append((ibase.pprint_thing(self.name, escape_chars=('\t', '\r', '\n')) if (self.name is not None) else ''))
    if (formatter is not None):
        return (header + list(self.map(formatter)))
    return self._format_with_header(header, na_rep=na_rep, date_format=date_format)
Render a string representation of the Index.
def format(self, name: bool=False, formatter: (Callable | None)=None, na_rep: str='NaT', date_format: (str | None)=None) -> list[str]:
    '\n        \n        '
    header = []
    if name:
        header.append((ibase.pprint_thing(self.name, escape_chars=('\t', '\r', '\n')) if (self.name is not None) else ))
    if (formatter is not None):
        return (header + list(self.map(formatter)))
    return self._format_with_header(header, na_rep=na_rep, date_format=date_format)