code: def get_processor_types_from_config_class(
      config_class, allowed_mappings=None
  ):
      """Return a tuple of processors for `config_class`.
  
      We use `tuple` here to include (potentially) both slow & fast tokenizers.
      """
  
      # To make a uniform return type
      def _to_tuple(x):
          if not isinstance(x, collections.abc.Sequence):
              x = (x,)
          else:
              x = tuple(x)
          return x
  
      if allowed_mappings is None:
          allowed_mappings = [
              "processor",
              "tokenizer",
              "image_processor",
              "feature_extractor",
          ]
  
      processor_types = ()
  
      # Check first if a model has `ProcessorMixin`. Otherwise, check if it has tokenizers, and/or an image processor or
      # a feature extractor
      if (
          config_class in PROCESSOR_MAPPING
          and "processor" in allowed_mappings
      ):
          processor_types = _to_tuple(PROCESSOR_MAPPING[config_class])
      else:
          if (
              config_class in TOKENIZER_MAPPING
              and "tokenizer" in allowed_mappings
          ):
              processor_types = TOKENIZER_MAPPING[config_class]
  
          if (
              config_class in IMAGE_PROCESSOR_MAPPING
              and "image_processor" in allowed_mappings
          ):
              processor_types += _to_tuple(
                  IMAGE_PROCESSOR_MAPPING[config_class]
              )
          elif (
              config_class in FEATURE_EXTRACTOR_MAPPING
              and "feature_extractor" in allowed_mappings
          ):
              processor_types += _to_tuple(
                  FEATURE_EXTRACTOR_MAPPING[config_class]
              )
  
      # Remark: some configurations have no processor at all. For example, generic composite models like
      # `EncoderDecoderModel` is used for any (compatible) text models. Also, `DecisionTransformer` doesn't
      # require any processor.
  
      # We might get `None` for some tokenizers - remove them here.
      processor_types = tuple(
          p for p in processor_types if p is not None
      )
  
      return processor_types
  
imports: import argparse
  import collections.abc
  import copy
  import inspect
  import json
  import multiprocessing
  import os
  import shutil
  import tempfile
  import traceback
  from pathlib import Path
  from check_config_docstrings import get_checkpoint_from_config_class
  from datasets import load_dataset
  from get_test_info import get_model_to_tester_mapping, get_tester_classes_for_model
  from huggingface_hub import Repository, create_repo, hf_api, upload_folder
  from transformers import CONFIG_MAPPING, FEATURE_EXTRACTOR_MAPPING, IMAGE_PROCESSOR_MAPPING, PROCESSOR_MAPPING, TOKENIZER_MAPPING, AutoTokenizer, LayoutLMv3TokenizerFast, PreTrainedTokenizer, PreTrainedTokenizerFast, logging
  from transformers.feature_extraction_utils import FeatureExtractionMixin
  from transformers.file_utils import is_tf_available, is_torch_available
  from transformers.image_processing_utils import BaseImageProcessor
  from transformers.models.auto.configuration_auto import AutoConfig, model_type_to_module_name
  from transformers.models.fsmt import configuration_fsmt
  from transformers.processing_utils import ProcessorMixin, transformers_module
  from transformers.tokenization_utils_base import PreTrainedTokenizerBase
label_desc: Use image node_id 1 for calling a global function with example usage: get_processor_types_from_config_class(config_class, allowed_mappings) and returns: processor_types, x