def METHOD_NAME(self, expr, *args, **kwargs):
    """Internal dispatcher
    Tries the following concepts to print an expression:
        1. Let the object print itself if it knows how.
        2. Take the best fitting method defined in the printer.
        3. As fall-back use the emptyPrinter method for the printer.
    """
    self._print_level += 1
    try:
        # If the printer defines a name for a printing method
        # (Printer.printmethod) and the object knows for itself how it
        # should be printed, use that method.
        if (self.printmethod and hasattr(expr, self.printmethod)
                and not isinstance(expr, type)):
            return getattr(expr, self.printmethod)(self, *args, **kwargs)
        # See if the class of expr is known, or if one of its super
        # classes is known, and use that print function
        for cls in type(expr).__mro__:
            printmethod = '_print_' + cls.__name__
            if hasattr(self, printmethod):
                if cls.__class__.__name__ == 'UndefinedFunction':
                    # XXX a hack for sympy/sympy#6853
                    continue
                return getattr(self, printmethod)(expr, *args, **kwargs)
        # Unknown object, fall back to the emptyPrinter.
        return self.emptyPrinter(expr)
    finally:
        self._print_level -= 1