code: def zip_list_to_dict(self, X, Y=None, context=None):
      assert context is None
      if Y is not None:
          Y = list(Y)
          if len(X) != len(Y):
              raise FinetuneError(
                  "the length of your labels does not match the length of your text"
              )
  
      out = []
      for i, x in enumerate(X):
          text, context = _single_convert_to_finetune(
              document=x, config=self.config
          )
          joined_text = "".join(text)
          sample = {
              "X": text,
              "raw_text": joined_text,
              # This is done to allow chunk long sequences to rejoin labels for us.
          }
          if self.config.default_context:
              for cii in context:
                  assert (
                      cii["text"]
                      == joined_text[cii["start"] : cii["end"]]
                  )
              sample["context"] = context
  
          if Y is not None:
              for yii in Y[i]:
                  if "text" in yii:
                      assert (
                          yii["text"]
                          == joined_text[yii["start"] : yii["end"]]
                      )
              sample["Y"] = Y[i]
          out.append(sample)
      return out
  
file_path: finetune/finetune/target_models/document_labeling.py
imports: import warnings
  from finetune.target_models.sequence_labeling import SequenceLabeler, SequencePipeline
  from finetune.encoding.input_encoder import EncodedOutput
  from finetune.errors import FinetuneError
  from finetune.base_models import DocRep, LayoutLM, XDocBase
  from finetune.util.context_utils import get_context_doc_rep
label_desc: Use image node_id 3 for calling the DocumentPipeline obj's underlying member method code with example usage: obj.zip_list_to_dict(X, Y, context) and returns: out