nodes: 0, module; 1, function_definition; 2, function_name:get_keys; 3, parameters; 4, block; 5, identifier:data_list; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, identifier:leading_columns; 13, identifier:LEADING_COLUMNS; 14, comment:"""Gets all possible keys from a list of dicts, sorting by leading_columns first
  
      Args:
          data_list: list of dicts to pull keys from
          leading_columns: list of keys to put first in the result
  
      Returns:
          list of keys to be included as columns in excel worksheet
      """; 15, assignment; 16, assignment; 17, identifier:key; 18, identifier:leading_columns; 19, block; 20, binary_operator:leading_keys + sorted(all_keys); 21, identifier:all_keys; 22, call; 23, identifier:leading_keys; 24, list; 25, if_statement; 26, expression_statement; 27, expression_statement; 28, identifier:leading_keys; 29, call; 30, attribute; 31, argument_list; 32, comparison_operator:key not in all_keys; 33, block; 34, call; 35, call; 36, identifier:sorted; 37, argument_list; 38, call; 39, identifier:union; 40, list_splat; 41, identifier:key; 42, identifier:all_keys; 43, continue_statement; 44, attribute; 45, argument_list; 46, attribute; 47, argument_list; 48, identifier:all_keys; 49, identifier:set; 50, argument_list; 51, generator_expression; 52, identifier:leading_keys; 53, identifier:append; 54, identifier:key; 55, identifier:all_keys; 56, identifier:remove; 57, identifier:key; 58, call; 59, for_in_clause; 60, identifier:list; 61, argument_list; 62, identifier:d; 63, identifier:data_list; 64, call; 65, attribute; 66, argument_list; 67, identifier:d; 68, identifier:keys
code: def get_keys(data_list, leading_columns=LEADING_COLUMNS):
      """Gets all possible keys from a list of dicts, sorting by leading_columns first
  
      Args:
          data_list: list of dicts to pull keys from
          leading_columns: list of keys to put first in the result
  
      Returns:
          list of keys to be included as columns in excel worksheet
      """
      all_keys = set().union(*(list(d.keys()) for d in data_list))
  
      leading_keys = []
  
      for key in leading_columns:
          if key not in all_keys:
              continue
          leading_keys.append(key)
          all_keys.remove(key)
  
      return leading_keys + sorted(all_keys)