def format(self, exclude_class=False):
if exclude_class:<EOL><INDENT>msg = self.msg<EOL><DEDENT>else:<EOL><INDENT>msg = "<STR_LIT>" % (self.__class__.__name__, self.msg)<EOL><DEDENT>if len(self.params) != <NUM_LIT:0>:<EOL><INDENT>paramstring = "<STR_LIT:\n>".join([str(key) + "<STR_LIT>" + str(val) for key, val in self.params.items()])<EOL>msg += "<STR_LIT>" + paramstring<EOL><DEDENT>return msg<EOL>
Format this exception as a string including class name.

        Args:
            exclude_class (bool): Whether to exclude the exception class
                name when formatting this exception

        Returns:
            string: a multiline string with the message, class name and
                key value parameters passed to create the exception.