nodes: 0, module; 1, function_definition; 2, function_name:get_substitutions_from_config; 3, parameters; 4, block; 5, identifier:config; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:"""
      Return a list of Substitution objects from the config, sorted
      alphabetically by pattern name. Returns an empty list if no Substitutions
      are specified. If there are problems parsing the values, a help message
      will be printed and an error will be thrown.
      """; 13, assignment; 14, assignment; 15, call; 16, identifier:name; 17, identifier:pattern_names; 18, block; 19, identifier:result; 20, identifier:result; 21, list; 22, identifier:pattern_names; 23, call; 24, attribute; 25, argument_list; 26, expression_statement; 27, expression_statement; 28, expression_statement; 29, expression_statement; 30, attribute; 31, argument_list; 32, identifier:pattern_names; 33, identifier:sort; 34, assignment; 35, assignment; 36, assignment; 37, call; 38, identifier:config; 39, identifier:options; 40, identifier:SUBSTITUTION_SECTION; 41, identifier:pattern_val; 42, call; 43, identifier:list_rep; 44, call; 45, identifier:substitution; 46, call; 47, attribute; 48, argument_list; 49, attribute; 50, argument_list; 51, attribute; 52, argument_list; 53, identifier:parse_substitution_from_list; 54, argument_list; 55, identifier:result; 56, identifier:append; 57, identifier:substitution; 58, identifier:config; 59, identifier:get; 60, identifier:SUBSTITUTION_SECTION; 61, identifier:name; 62, identifier:ast; 63, identifier:literal_eval; 64, identifier:pattern_val; 65, identifier:list_rep
code: def get_substitutions_from_config(config):
      """
      Return a list of Substitution objects from the config, sorted
      alphabetically by pattern name. Returns an empty list if no Substitutions
      are specified. If there are problems parsing the values, a help message
      will be printed and an error will be thrown.
      """
      result = []
      pattern_names = config.options(SUBSTITUTION_SECTION)
      pattern_names.sort()
      for name in pattern_names:
          pattern_val = config.get(SUBSTITUTION_SECTION, name)
          list_rep = ast.literal_eval(pattern_val)
          substitution = parse_substitution_from_list(list_rep)
          result.append(substitution)
      return result