class_docstr: This is a mixin used to provide saving/loading functionality for all processor classes.
class_docstr_tok: ["This","is","a","mixin","used","to","provide","saving\/loading","functionality","for","all","processor","classes","."]
code: def __init__(self, *args, **kwargs):
      # Sanitize args and kwargs
      for key in kwargs:
          if key not in self.attributes:
              raise TypeError(f"Unexepcted keyword argument {key}.")
      for arg, attribute_name in zip(args, self.attributes):
          if attribute_name in kwargs:
              raise TypeError(
                  f"Got multiple values for argument {attribute_name}."
              )
          else:
              kwargs[attribute_name] = arg
  
      if len(kwargs) != len(self.attributes):
          raise ValueError(
              f"This processor requires {len(self.attributes)} arguments: {', '.join(self.attributes)}. Got "
              f"{len(args)} arguments instead."
          )
  
      # Check each arg is of the proper class (this will also catch a user initializing in the wrong order)
      for attribute_name, arg in kwargs.items():
          class_name = getattr(self, f"{attribute_name}_class")
          # Nothing is ever going to be an instance of "AutoXxx", in that case we check the base class.
          class_name = AUTO_TO_BASE_CLASS_MAPPING.get(
              class_name, class_name
          )
          if isinstance(class_name, tuple):
              proper_class = tuple(
                  getattr(transformers_module, n)
                  for n in class_name
                  if n is not None
              )
          else:
              proper_class = getattr(transformers_module, class_name)
  
          if not isinstance(arg, proper_class):
              raise ValueError(
                  f"Received a {type(arg).__name__} for argument {attribute_name}, but a {class_name} was expected."
              )
  
          setattr(self, attribute_name, arg)
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/processing_utils.py
imports: import importlib.util
  import os
  from pathlib import Path
  from .dynamic_module_utils import custom_object_save
  from .tokenization_utils_base import PreTrainedTokenizerBase
  from .utils import PushToHubMixin, copy_func, logging
label_desc: Use image node_id 1 to create a new ProcessorMixin object from inherited base classes: PushToHubMixin with example: obj = ProcessorMixin()