def summary(obj, indent=<NUM_LIT:0>):
if hasattr(obj, '<STR_LIT>'):<EOL><INDENT>rep = obj.__summary__()<EOL><DEDENT>elif isinstance(obj, SortedKeyList):<EOL><INDENT>rep = '<STR_LIT>'.format(len(obj))<EOL><DEDENT>else:<EOL><INDENT>rep = repr(obj)<EOL><DEDENT>return rep.replace('<STR_LIT:\n>', '<STR_LIT:\n>' + '<STR_LIT:U+0020>' * indent)<EOL>
Helper function to format repr strings for JObjects and friends.

    Parameters
    ----------
    obj
        The object to repr

    indent : int >= 0
        indent each new line by `indent` spaces

    Returns
    -------
    r : str
        If `obj` has a `__summary__` method, it is used.

        If `obj` is a `SortedKeyList`, then it returns a description
        of the length of the list.

        Otherwise, `repr(obj)`.