code: def replace_with_adapter_class(
      module: nn.Module, modules_with_adapters
  ) -> None:
      # Check if module is a base model class
      if module.__class__.__name__ in MODEL_MIXIN_MAPPING:
          # Create new wrapper model class
          model_class = type(
              module.__class__.__name__,
              (
                  MODEL_MIXIN_MAPPING[module.__class__.__name__],
                  module.__class__,
              ),
              {},
          )
          module.__class__ = model_class
      elif module.__class__.__module__.startswith(
          "transformers.models"
      ):
          try:
              module_class = getattribute_from_module(
                  modules_with_adapters,
                  module.__class__.__name__ + "WithAdapters",
              )
              module.__class__ = module_class
          except ValueError:
              # Silently fail and keep original module class
              pass
  
file_path: adapters/src/adapters/wrappers/model.py
imports: import importlib
  import os
  from typing import Any, Optional, Type, Union
  from torch import nn
  from transformers import PreTrainedModel
  from transformers.models.auto.auto_factory import getattribute_from_module
  from transformers.models.auto.configuration_auto import model_type_to_module_name
  from ..configuration import ModelAdaptersConfig
  from ..model_mixin import EmbeddingAdaptersWrapperMixin, ModelAdaptersMixin, ModelUsingSubmodelsAdaptersMixin, ModelWithHeadsAdaptersMixin
  from ..models import MODEL_MIXIN_MAPPING
  from .configuration import init_adapters_config
label_desc: Use image node_id 2 for calling a global function with example usage: replace_with_adapter_class(module, modules_with_adapters) without return types