def METHOD_NAME(self, message: str, delim=None, format=None, replace=False): # pylint: disable=redefined-builtin
    """
    Add extra text to self.message about the reason why permission
    was denied. Uses lazy object so the message string is evaluated
    only when rendered.
    If optional argument `format` is given, then it's used with format_lazy
    to format the message with the dictionary arguments from `format` arg.
    Optional argument `delim` can be used to change the string used to join
    self.message and `message`.
    If optional argument `replace` is true, then self.message is replaced with
    the `message`.
    """
    if delim is None:
        delim = ': '
    if format:
        message = format_lazy(message, **format)
    if replace:
        self.message = message
    else:
        assert 'message' not in self.__dict__, (
            "You are calling error_msg without replace=True "
            "after calling it with it first. Fix your code by removing "
            "the first method call and add replace=True to the second method call too."
        )
        msg_without_end_punctuation = (
            self.message[0:-1] if self.message[-1] in string.punctuation
            else self.message
        )
        self.message = format_lazy(
            '{}{}{}',
            msg_without_end_punctuation,
            delim,
            message,
        )