code: def get_context(document, dpi_norm, base_model):
      """
      Gets the context as formatted for the DocRep base model from
      the output of indico's PDFExtraction api.
      """
      if base_model.get_context_fn is not None:
          return base_model.get_context_fn(document, dpi_norm)
      warnings.warn(
          "Running DocumentLabeler with a base model that doesn't utilize position info."
      )
      return get_context_doc_rep(document, dpi_norm)
  
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 1 for calling a global function with example usage: get_context(document, dpi_norm, base_model) and returns: get_context_doc_rep, base_model