def _summary(self, name=None):
formatter = self._formatter_func<EOL>if len(self) > <NUM_LIT:0>:<EOL><INDENT>index_summary = '<STR_LIT>' % (formatter(self[<NUM_LIT:0>]),<EOL>formatter(self[-<NUM_LIT:1>]))<EOL><DEDENT>else:<EOL><INDENT>index_summary = '<STR_LIT>'<EOL><DEDENT>if name is None:<EOL><INDENT>name = type(self).__name__<EOL><DEDENT>result = '<STR_LIT>' % (printing.pprint_thing(name),<EOL>len(self), index_summary)<EOL>if self.freq:<EOL><INDENT>result += '<STR_LIT>' % self.freqstr<EOL><DEDENT>result = result.replace("<STR_LIT:'>", "<STR_LIT>")<EOL>return result<EOL>
Return a summarized representation.

Parameters
----------
name : str
    name to use in the summary representation

Returns
-------
String with a summarized representation of the index