class_docstr: Constructs a Donut processor which wraps a Donut image processor and an XLMRoBERTa tokenizer into a single
  processor.
  
  [`DonutProcessor`] offers all the functionalities of [`DonutImageProcessor`] and
  [`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]. See the [`~DonutProcessor.__call__`] and
  [`~DonutProcessor.decode`] for more information.
  
  Args:
      image_processor ([`DonutImageProcessor`], *optional*):
          An instance of [`DonutImageProcessor`]. The image processor is a required input.
      tokenizer ([`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`], *optional*):
          An instance of [`XLMRobertaTokenizer`/`XLMRobertaTokenizerFast`]. The tokenizer is a required input.
class_docstr_tok: ["Constructs","a","Donut","processor","which","wraps","a","Donut","image","processor","and","an","XLMRoBERTa","tokenizer","into","a","single","processor",".","[","`","DonutProcessor","`","]","offers","all","the","functionalities","of","[","`","DonutImageProcessor","`","]","and","[","`","XLMRobertaTokenizer","`","\/","`","XLMRobertaTokenizerFast","`","]",".","See","the","[","`","~DonutProcessor.__call__","`","]","and","[","`","~DonutProcessor.decode","`","]","for","more","information",".","Args",":","image_processor","(","[","`","DonutImageProcessor","`","]",",","*","optional","*",")",":","An","instance","of","[","`","DonutImageProcessor","`","]",".","The","image","processor","is","a","required","input",".","tokenizer","(","[","`","XLMRobertaTokenizer","`","\/","`","XLMRobertaTokenizerFast","`","]",",","*","optional","*",")",":","An","instance","of","[","`","XLMRobertaTokenizer","`","\/","`","XLMRobertaTokenizerFast","`","]",".","The","tokenizer","is","a","required","input","."]
code: def __init__(self, image_processor=None, tokenizer=None, **kwargs):
      feature_extractor = None
      if "feature_extractor" in kwargs:
          warnings.warn(
              "The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"
              " instead.",
              FutureWarning,
          )
          feature_extractor = kwargs.pop("feature_extractor")
  
      image_processor = (
          image_processor
          if image_processor is not None
          else feature_extractor
      )
      if image_processor is None:
          raise ValueError("You need to specify an `image_processor`.")
      if tokenizer is None:
          raise ValueError("You need to specify a `tokenizer`.")
  
      super().__init__(image_processor, tokenizer)
      self.current_processor = self.image_processor
      self._in_target_context_manager = False
  
file_path: transformers/src/transformers/models/donut/processing_donut.py
imports: import re
  import warnings
  from contextlib import contextmanager
  from ...processing_utils import ProcessorMixin
label_desc: Use image node_id 1 to create a new DonutProcessor object from inherited base classes: ProcessorMixin with example: obj = DonutProcessor(image_processor, tokenizer)