nodes: 0, module; 1, function_definition; 2, function_name:natural_sort_key; 3, parameters; 4, block; 5, identifier:s; 6, expression_statement; 7, return_statement; 8, comment:"""
      returns a key that can be used in sort functions.
  
      Example:
  
      >>> items = ['A99', 'a1', 'a2', 'a10', 'a24', 'a12', 'a100']
  
      The normal sort function will ignore the natural order of the
      integers in the string:
  
      >>> print sorted(items)
      ['A99', 'a1', 'a10', 'a100', 'a12', 'a2', 'a24']
  
      When we use this function as a key to the sort function,
      the natural order of the integer is considered.
  
      >>> print sorted(items, key=natural_sort_key)
      ['A99', 'a1', 'a2', 'a10', 'a12', 'a24', 'a100']
      """; 9, list_comprehension; 10, conditional_expression:int(text) if text.isdigit() else text; 11, for_in_clause; 12, call; 13, call; 14, identifier:text; 15, identifier:text; 16, call; 17, identifier:int; 18, argument_list; 19, attribute; 20, argument_list; 21, attribute; 22, argument_list; 23, identifier:text; 24, identifier:text; 25, identifier:isdigit; 26, identifier:re; 27, identifier:split; 28, identifier:INTEGER_RE; 29, call; 30, identifier:str; 31, argument_list; 32, identifier:s
code: def natural_sort_key(s):
      """
      returns a key that can be used in sort functions.
  
      Example:
  
      >>> items = ['A99', 'a1', 'a2', 'a10', 'a24', 'a12', 'a100']
  
      The normal sort function will ignore the natural order of the
      integers in the string:
  
      >>> print sorted(items)
      ['A99', 'a1', 'a10', 'a100', 'a12', 'a2', 'a24']
  
      When we use this function as a key to the sort function,
      the natural order of the integer is considered.
  
      >>> print sorted(items, key=natural_sort_key)
      ['A99', 'a1', 'a2', 'a10', 'a12', 'a24', 'a100']
      """
      return [int(text) if text.isdigit() else text
              for text in re.split(INTEGER_RE, str(s))]