nodes: 0, module; 1, function_definition; 2, function_name:collect_results; 3, parameters; 4, block; 5, identifier:working_folder; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:"""
      Collect results in a working_folder.
  
      The output is nested dict[rec_name][sorter_name] of SortingExtrator.
  
      """; 13, assignment; 14, assignment; 15, assignment; 16, identifier:rec_name; 17, call; 18, block; 19, identifier:results; 20, identifier:results; 21, dictionary; 22, identifier:working_folder; 23, call; 24, identifier:output_folders; 25, binary_operator:working_folder/'output_folders'; 26, attribute; 27, argument_list; 28, if_statement; 29, comment:# print(rec_name); 30, expression_statement; 31, for_statement; 32, identifier:Path; 33, argument_list; 34, identifier:working_folder; 35, string; 36, identifier:os; 37, identifier:listdir; 38, identifier:output_folders; 39, not_operator; 40, block; 41, assignment; 42, identifier:sorter_name; 43, call; 44, comment:# print('  ', sorter_name); 45, block; 46, identifier:working_folder; 47, string_content:output_folders; 48, call; 49, continue_statement; 50, subscript; 51, dictionary; 52, attribute; 53, argument_list; 54, expression_statement; 55, comment:#~ print(output_folder); 56, if_statement; 57, expression_statement; 58, expression_statement; 59, attribute; 60, argument_list; 61, identifier:results; 62, identifier:rec_name; 63, identifier:os; 64, identifier:listdir; 65, binary_operator:output_folders / rec_name; 66, assignment; 67, not_operator; 68, block; 69, assignment; 70, assignment; 71, attribute; 72, identifier:isdir; 73, binary_operator:output_folders / rec_name; 74, identifier:output_folders; 75, identifier:rec_name; 76, identifier:output_folder; 77, binary_operator:output_folders / rec_name / sorter_name; 78, call; 79, continue_statement; 80, identifier:SorterClass; 81, subscript; 82, subscript; 83, call; 84, identifier:os; 85, identifier:path; 86, identifier:output_folders; 87, identifier:rec_name; 88, binary_operator:output_folders / rec_name; 89, identifier:sorter_name; 90, attribute; 91, argument_list; 92, identifier:sorter_dict; 93, identifier:sorter_name; 94, subscript; 95, identifier:sorter_name; 96, attribute; 97, argument_list; 98, identifier:output_folders; 99, identifier:rec_name; 100, attribute; 101, identifier:isdir; 102, identifier:output_folder; 103, identifier:results; 104, identifier:rec_name; 105, identifier:SorterClass; 106, identifier:get_result_from_folder; 107, identifier:output_folder; 108, identifier:os; 109, identifier:path
code: def collect_results(working_folder):
      """
      Collect results in a working_folder.
  
      The output is nested dict[rec_name][sorter_name] of SortingExtrator.
  
      """
      results = {} 
      working_folder = Path(working_folder)
      output_folders = working_folder/'output_folders'
  
      for rec_name in os.listdir(output_folders):
          if not os.path.isdir(output_folders / rec_name):
              continue
          # print(rec_name)
          results[rec_name] = {}
          for sorter_name in os.listdir(output_folders / rec_name):
              # print('  ', sorter_name)
              output_folder = output_folders / rec_name / sorter_name
              #~ print(output_folder)
              if not os.path.isdir(output_folder):
                  continue
              SorterClass = sorter_dict[sorter_name]
              results[rec_name][sorter_name] = SorterClass.get_result_from_folder(output_folder)
  
      return results