code: def _check_all_models_are_registered(
      self,
      backend: str,
      class_prefix: str,
      classes_to_ignore: Optional[Set[str]] = None,
  ):
      registered_classes = set()
      for mappings in TasksManager._SUPPORTED_MODEL_TYPE.values():
          for class_ in mappings.get(backend, {}).values():
              registered_classes.add(class_.func.__name__)
  
      if classes_to_ignore is None:
          classes_to_ignore = set()
  
      module_name = f"optimum.exporters.{backend}.model_configs"
  
      def predicate(member):
          name = getattr(member, "__name__", "")
          module = getattr(member, "__module__", "")
          return all(
              (
                  inspect.isclass(member),
                  module == module_name,
                  name.endswith(class_prefix),
                  name not in classes_to_ignore,
              )
          )
  
      defined_classes = inspect.getmembers(
          importlib.import_module(module_name), predicate
      )
  
      # inspect.getmembers returns a list of (name, value) tuples, so we retrieve the names here.
      defined_classes = {x[0] for x in defined_classes}
  
      diff = defined_classes - registered_classes
      if diff:
          raise ValueError(
              f"Some models were defined for the {backend} backend, but never registered in the TasksManager: "
              f"{', '.join(diff)}."
          )
  
file_path: optimum/tests/exporters/common/test_tasks_manager.py
imports: import importlib
  import inspect
  from typing import Optional, Set
  from unittest import TestCase
  import pytest
  from transformers import BertConfig, Pix2StructForConditionalGeneration, VisualBertForQuestionAnswering
  from transformers.testing_utils import slow
  from optimum.exporters import TasksManager
  from optimum.exporters.onnx.model_configs import BertOnnxConfig
label_desc: Use image node_id 1 for calling the TasksManagerTestCase obj's underlying member method code with example usage: obj._check_all_models_are_registered(backend, class_prefix, classes_to_ignore) and returns: all