nodes: 0, module; 1, function_definition; 2, function_name:check_message; 3, parameters; 4, block; 5, identifier:message; 6, dictionary_splat_pattern; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, function_definition; 15, return_statement; 16, identifier:kwargs; 17, comment:"""Check the message format.
  
      Rules:
  
      - the first line must start by a component name
      - and a short description (52 chars),
      - then bullet points are expected
      - and finally signatures.
  
      :param components: compontents, e.g. ``('auth', 'utils', 'misc')``
      :type components: `list`
      :param signatures: signatures, e.g. ``('Signed-off-by', 'Reviewed-by')``
      :type signatures: `list`
      :param alt_signatures: alternative signatures, e.g. ``('Tested-by',)``
      :type alt_signatures: `list`
      :param trusted: optional list of reviewers, e.g. ``('john.doe@foo.org',)``
      :type trusted: `list`
      :param max_length: optional maximum line length (by default: 72)
      :type max_length: int
      :param max_first_line: optional maximum first line length (by default: 50)
      :type max_first_line: int
      :param allow_empty: optional way to allow empty message (by default: False)
      :type allow_empty: bool
      :return: errors sorted by line number
      :rtype: `list`
      """; 18, call; 19, block; 20, assignment; 21, assignment; 22, assignment; 23, augmented_assignment; 24, augmented_assignment; 25, function_name:_format; 26, parameters; 27, block; 28, call; 29, attribute; 30, argument_list; 31, if_statement; 32, identifier:lines; 33, call; 34, identifier:errors; 35, call; 36, pattern_list; 37, call; 38, identifier:errors; 39, identifier:err; 40, identifier:errors; 41, call; 42, identifier:code; 43, identifier:lineno; 44, identifier:args; 45, return_statement; 46, identifier:list; 47, argument_list; 48, identifier:kwargs; 49, identifier:pop; 50, string:"allow_empty"; 51, False; 52, boolean_operator; 53, block; 54, attribute; 55, argument_list; 56, identifier:_check_1st_line; 57, argument_list; 58, identifier:err; 59, identifier:signature_lines; 60, identifier:_check_bullets; 61, argument_list; 62, identifier:_check_signatures; 63, argument_list; 64, call; 65, call; 66, not_operator; 67, call; 68, return_statement; 69, identifier:re; 70, identifier:split; 71, string:r"\r\n|\r|\n"; 72, identifier:message; 73, subscript; 74, dictionary_splat; 75, identifier:lines; 76, dictionary_splat; 77, identifier:signature_lines; 78, dictionary_splat; 79, attribute; 80, argument_list; 81, identifier:map; 82, argument_list; 83, identifier:message; 84, attribute; 85, argument_list; 86, list; 87, identifier:lines; 88, integer:0; 89, identifier:kwargs; 90, identifier:kwargs; 91, identifier:kwargs; 92, string:"{0}: {1} {2}"; 93, identifier:format; 94, identifier:lineno; 95, identifier:code; 96, call; 97, lambda; 98, call; 99, identifier:message; 100, identifier:isspace; 101, attribute; 102, argument_list; 103, lambda_parameters; 104, call; 105, identifier:sorted; 106, argument_list; 107, subscript; 108, identifier:format; 109, list_splat; 110, identifier:x; 111, identifier:_format; 112, argument_list; 113, identifier:errors; 114, keyword_argument; 115, identifier:_messages_codes; 116, identifier:code; 117, identifier:args; 118, subscript; 119, subscript; 120, subscript; 121, identifier:key; 122, lambda; 123, identifier:x; 124, integer:0; 125, identifier:x; 126, integer:1; 127, identifier:x; 128, slice; 129, lambda_parameters; 130, subscript; 131, integer:2; 132, identifier:x; 133, identifier:x; 134, integer:0
code: def check_message(message, **kwargs):
      """Check the message format.
  
      Rules:
  
      - the first line must start by a component name
      - and a short description (52 chars),
      - then bullet points are expected
      - and finally signatures.
  
      :param components: compontents, e.g. ``('auth', 'utils', 'misc')``
      :type components: `list`
      :param signatures: signatures, e.g. ``('Signed-off-by', 'Reviewed-by')``
      :type signatures: `list`
      :param alt_signatures: alternative signatures, e.g. ``('Tested-by',)``
      :type alt_signatures: `list`
      :param trusted: optional list of reviewers, e.g. ``('john.doe@foo.org',)``
      :type trusted: `list`
      :param max_length: optional maximum line length (by default: 72)
      :type max_length: int
      :param max_first_line: optional maximum first line length (by default: 50)
      :type max_first_line: int
      :param allow_empty: optional way to allow empty message (by default: False)
      :type allow_empty: bool
      :return: errors sorted by line number
      :rtype: `list`
      """
      if kwargs.pop("allow_empty", False):
          if not message or message.isspace():
              return []
  
      lines = re.split(r"\r\n|\r|\n", message)
      errors = _check_1st_line(lines[0], **kwargs)
      err, signature_lines = _check_bullets(lines, **kwargs)
      errors += err
      errors += _check_signatures(signature_lines, **kwargs)
  
      def _format(code, lineno, args):
          return "{0}: {1} {2}".format(lineno,
                                       code,
                                       _messages_codes[code].format(*args))
  
      return list(map(lambda x: _format(x[0], x[1], x[2:]),
                      sorted(errors, key=lambda x: x[0])))