code: def create_module_wrapper(
      model: nn.Module,
      module: nn.Module,
      module_name: str,
      mode: Literal["pruning", "quantization", "distillation"],
      config: Dict[str, Any],
      wrapper: ModuleWrapper | None = None,
      fused_modules_pair: List[str] | None = None,
  ):
      fused_modules_pair = (
          fused_modules_pair if fused_modules_pair is not None else []
      )
      if mode != "quantization" and len(fused_modules_pair) > 0:
          raise ValueError(
              f"Only quantization supports model fusion, but got {mode} and {fused_modules_pair}"
          )
      if isinstance(wrapper, IdentityModuleWrapper):
          raise ValueError(
              "Using other compression methods on the fused module with IdentityWrapper is not supportted"
          )
  
      fused_modules = (
          [
              get_nested_attr(model, f_module_name)
              for f_module_name in fused_modules_pair
          ]
          if len(fused_modules_pair) > 0
          else []
      )
  
      if wrapper is not None:
          if (
              len(wrapper.fused_modules) > 0
              and len(fused_modules_pair) > 0
          ):
              raise ValueError(
                  f"Using two fused_modules_pair for {module_name} is not supported"
              )
          wrapper.unfreeze()
          target_spaces = wrapper.extend_target_spaces(config, mode)
          wrapper.configs = update_config(
              wrapper.configs, {mode: config}
          )
  
          if len(fused_modules_pair) > 0:
              wrapper.fused_modules = fused_modules
      else:
          wrapper = ModuleWrapper(
              module, module_name, {mode: config}, fused_modules
          )
          if mode == "pruning":
              target_spaces = dict(
                  wrapper.pruning_target_spaces.items()
              )
          elif mode == "quantization":
              target_spaces = dict(
                  wrapper.quantization_target_spaces.items()
              )
          else:
              target_spaces = dict(
                  wrapper.distillation_target_spaces.items()
              )
  
      return wrapper, target_spaces
  
imports: from __future__ import annotations
  from collections import defaultdict
  import logging
  import inspect
  import functools
  from typing import Any, Callable, Dict, List, Tuple, Type, Union, Literal
  import torch
  import torch.nn
  from torch import Tensor
  from .apply_method import pruning_apply_methods, quant_apply_methods
  from .config import select_modules_by_config
  from .setting import INPUT_PREFIX, OUTPUT_PREFIX, canonicalize_settings
  from .target_space import TargetSpace, TargetType, PruningTargetSpace, QuantizationTargetSpace, DistillationTargetSpace
  from .fuse_modules import fuse_modules
  from ..utils import check_bias, update_config, validate_fused_modules_config, get_fused_module_list, get_nested_attr
label_desc: Use image node_id 3 for calling a global function with example usage: create_module_wrapper(model, module, module_name, mode, config, wrapper, fused_modules_pair) and returns: wrapper,  target_spaces