def METHOD_NAME(self, obj):
    r"""
    Pretty print ``obj``
    This is the only method that outside code should invoke.
    INPUT:
    - ``obj`` -- anything.
    OUTPUT:
    String representation for object.
    EXAMPLES::
        sage: from sage.repl.display.pretty_print import SagePrettyPrinter
        sage: from io import StringIO
        sage: stream = StringIO()
        sage: SagePrettyPrinter(stream, 78, '\n').pretty([type, 123, 'foo'])
        sage: stream.getvalue()
        "[<... 'type'>,"
    """
    obj_id = id(obj)
    cycle = obj_id in self.stack
    self.stack.append(obj_id)
    self.begin_group()
    try:
        ok = False
        for representation in self.pretty_repr:
            if self.DEBUG:
                print('Trying {0}'.format(representation))
            ok = representation(obj, self, cycle)
            if self.DEBUG:
                print('ok = {0}'.format(ok))
            if ok not in [True, False]:
                raise RuntimeError('printer failed to return boolean')
            if ok:
                break
        if not ok:
            raise RuntimeError('no printer registered for object')
    finally:
        self.end_group()
        self.stack.pop()