code: def canonicalize_settings(
      module: torch.nn.Module | Type[torch.nn.Module] | str,
      config: Dict[str, Any],
      mode: Literal["pruning", "quantization", "distillation"],
  ) -> Dict[str, Dict[str, Any]]:
      if mode == "pruning":
          return PruningSetting.get(module, config)
      if mode == "quantization":
          return QuantizationSetting.get(module, config)
      if mode == "distillation":
          return DistillatoinSetting.get(module, config)
  
file_path: nni/nni/compression/base/setting.py
imports: from __future__ import annotations
  from copy import deepcopy
  from typing import Any, Dict, Literal, Type
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: canonicalize_settings(module, config, mode) and returns: PruningSetting, QuantizationSetting, DistillatoinSetting