def flake(self, message):
err_range = {<EOL>'<STR_LIT:start>': {'<STR_LIT>': message.lineno - <NUM_LIT:1>, '<STR_LIT>': message.col},<EOL>'<STR_LIT:end>': {'<STR_LIT>': message.lineno - <NUM_LIT:1>, '<STR_LIT>': len(self.lines[message.lineno - <NUM_LIT:1>])},<EOL>}<EOL>severity = lsp.DiagnosticSeverity.Warning<EOL>for message_type in PYFLAKES_ERROR_MESSAGES:<EOL><INDENT>if isinstance(message, message_type):<EOL><INDENT>severity = lsp.DiagnosticSeverity.Error<EOL>break<EOL><DEDENT><DEDENT>self.diagnostics.append({<EOL>'<STR_LIT:source>': '<STR_LIT>',<EOL>'<STR_LIT>': err_range,<EOL>'<STR_LIT:message>': message.message % message.message_args,<EOL>'<STR_LIT>': severity<EOL>})<EOL>
Get message like <filename>:<lineno>: <msg>