code: def evaluate_single_list(eval_results, store_all=False):
      # sum all errors up
      all_eval = []
      total_instances = 0
      total_chars = 0
      total_char_errs = 0
      confusion = {}
      total_sync_errs = 0
      for chars, char_errs, sync_errs, conf, gt_pred in eval_results:
          if store_all:
              all_eval.append(
                  SingleEvalData(
                      chars, char_errs, sync_errs, conf, gt_pred
                  )
              )
  
          total_instances += 1
          total_chars += chars
          total_char_errs += char_errs
          total_sync_errs += sync_errs
          for key, value in conf.items():
              if key not in confusion:
                  confusion[key] = value
              else:
                  confusion[key] += value
  
      # Note the sync errs can be higher than the true edit distance because
      # replacements are counted as 1
      # e.g. ed(in ewych, ierg ch) = 5
      #      sync(in ewych, ierg ch) = [{i: i}, {n: erg}, {ewy: }, {ch: ch}] = 6
  
      return {
          "single": all_eval,
          "total_instances": total_instances,
          "avg_ler": total_char_errs / total_chars,
          "total_chars": total_chars,
          "total_char_errs": total_char_errs,
          "total_sync_errs": total_sync_errs,
          "confusion": confusion,
      }
  
file_path: calamari/calamari_ocr/ocr/evaluator.py
imports: from dataclasses import dataclass, field
  from typing import Dict, TYPE_CHECKING
  import logging
  from edit_distance import edit_distance
  from collections import namedtuple
  from paiargparse import pai_dataclass, pai_meta
  from tfaip.data.databaseparams import DataPipelineParams
  from tfaip.data.pipeline.definitions import PipelineMode
  from tfaip.util.multiprocessing.parallelmap import parallel_map, tqdm_wrapper
  from calamari_ocr.ocr.dataset.datareader.base import CalamariDataGeneratorParams
  from calamari_ocr.ocr.dataset.textprocessors import synchronize
label_desc: Use image node_id 6 for calling the Evaluator obj's underlying member method code with example usage: obj.evaluate_single_list(eval_results, store_all) and returns: dict