code: def _load_sample(self, sample, text_only):
      gt_txt_path = sample["pred_path"]
      if gt_txt_path is None:
          return None, None
  
      if gt_txt_path.endswith(".json"):
          with codecs.open(gt_txt_path, "r", "utf-8") as f:
              p = Predictions.from_json(f.read())
      elif gt_txt_path.endswith(".pred"):
          with open(gt_txt_path, "rb") as f:
              p = Predictions.from_json(
                  zlib.decompress(f.read()).decode("utf-8")
              )
  
      if len(p.predictions) == 0:
          return None, None
  
      voted_p = p.predictions[0]
      for vp in p.predictions:
          if vp.id == "voted":
              voted_p = vp
  
      sample["best_prediction"] = voted_p
      sample["predictions"] = p
  
      return None, voted_p.sentence
  
file_path: calamari/calamari_ocr/ocr/dataset/datareader/extended_prediction.py
imports: import codecs
  import zlib
  from dataclasses import dataclass, field
  from typing import List, Type
  from paiargparse import pai_dataclass
  from calamari_ocr.ocr.dataset.datareader.base import CalamariDataGenerator, CalamariDataGeneratorParams
  from calamari_ocr.ocr.predict.params import Predictions
  from calamari_ocr.utils import split_all_ext, glob_all
label_desc: Use image node_id 3 for calling the ExtendedPredictionDataSet obj's underlying member method code with example usage: obj._load_sample(sample, text_only) and returns: None,  voted_p, None,  None, None,  None