nodes: 0, module; 1, function_definition; 2, function_name:_get_last_child_with_lineno; 3, parameters; 4, block; 5, identifier:node; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, comment:# The fields of ast.Call are in the wrong order.; 10, if_statement; 11, for_statement; 12, return_statement; 13, comment:"""
      Return the last direct child of `node` that has a lineno attribute,
      or None if `node` has no such children.
  
      Almost all node._field lists are sorted by the order in which they
      appear in source code. For some nodes however, we have to skip some
      fields that either don't have line numbers (e.g., "ctx" and "names")
      or that are in the wrong position (e.g., "decorator_list" and
      "returns"). Then we choose the first field (i.e., the field with the
      highest line number) that actually contains a node. If it contains a
      list of nodes, we return the last one.
  
      """; 14, assignment; 15, assignment; 16, call; 17, block; 18, identifier:name; 19, call; 20, block; 21, None; 22, identifier:ignored_fields; 23, call; 24, identifier:fields; 25, attribute; 26, identifier:isinstance; 27, argument_list; 28, expression_statement; 29, identifier:reversed; 30, argument_list; 31, if_statement; 32, try_statement; 33, comment:# Ignore non-AST objects like "is_async", "level" and "nl".; 34, if_statement; 35, identifier:set; 36, argument_list; 37, identifier:node; 38, identifier:_fields; 39, identifier:node; 40, attribute; 41, assignment; 42, identifier:fields; 43, comparison_operator:name in ignored_fields; 44, block; 45, block; 46, except_clause; 47, call; 48, block; 49, elif_clause; 50, list; 51, identifier:ast; 52, identifier:Call; 53, identifier:fields; 54, tuple; 55, identifier:name; 56, identifier:ignored_fields; 57, continue_statement; 58, expression_statement; 59, identifier:AttributeError; 60, block; 61, identifier:isinstance; 62, argument_list; 63, return_statement; 64, boolean_operator; 65, block; 66, string; 67, string; 68, string; 69, string; 70, string; 71, string; 72, string; 73, string; 74, string; 75, assignment; 76, continue_statement; 77, identifier:last_field; 78, attribute; 79, identifier:last_field; 80, call; 81, identifier:last_field; 82, return_statement; 83, string_content:ctx; 84, string_content:decorator_list; 85, string_content:names; 86, string_content:returns; 87, string_content:func; 88, string_content:args; 89, string_content:starargs; 90, string_content:keywords; 91, string_content:kwargs; 92, identifier:last_field; 93, call; 94, identifier:ast; 95, identifier:AST; 96, identifier:isinstance; 97, argument_list; 98, subscript; 99, identifier:getattr; 100, argument_list; 101, identifier:last_field; 102, identifier:list; 103, identifier:last_field; 104, unary_operator; 105, identifier:node; 106, identifier:name; 107, integer:1
code: def _get_last_child_with_lineno(node):
      """
      Return the last direct child of `node` that has a lineno attribute,
      or None if `node` has no such children.
  
      Almost all node._field lists are sorted by the order in which they
      appear in source code. For some nodes however, we have to skip some
      fields that either don't have line numbers (e.g., "ctx" and "names")
      or that are in the wrong position (e.g., "decorator_list" and
      "returns"). Then we choose the first field (i.e., the field with the
      highest line number) that actually contains a node. If it contains a
      list of nodes, we return the last one.
  
      """
      ignored_fields = set(['ctx', 'decorator_list', 'names', 'returns'])
      fields = node._fields
      # The fields of ast.Call are in the wrong order.
      if isinstance(node, ast.Call):
          fields = ('func', 'args', 'starargs', 'keywords', 'kwargs')
      for name in reversed(fields):
          if name in ignored_fields:
              continue
  
          try:
              last_field = getattr(node, name)
          except AttributeError:
              continue
  
          # Ignore non-AST objects like "is_async", "level" and "nl".
          if isinstance(last_field, ast.AST):
              return last_field
          elif isinstance(last_field, list) and last_field:
              return last_field[-1]
      return None