code: def parse_optional_config(config, quant_type, target):
      def get_config(config, quant_type, target):
          if not config.get(target):
              return None
  
          if isinstance(config[target], dict):
              return config[target].get(quant_type)
          else:
              return config[target]
  
      default_val = quant_default_settings[quant_type].get(target, None)
      config_val = get_config(config, quant_type, target)
      val = config_val if config_val else default_val
      return val
  
file_path: nni/nni/compression/utils/quantization/settings.py
imports: from typing import Any, Optional
  from .literal import QuantDtype, QuantType, QuantScheme
  from .utils import calculate_qmin_qmax, get_bits_length
label_desc: Use image node_id 4 for calling the LayerQuantSetting obj's underlying member method code with example usage: obj.parse_optional_config(config, quant_type, target) and returns: val, None, config, config