def _update_nncf_config(config: DictConfig | ListConfig) -> DictConfig | ListConfig:
    """Update NNCF configuration with input size settings.

    This function updates the Neural Network Compression Framework (NNCF)
    configuration by setting default input size parameters if they are not already
    specified. It also handles merging any NNCF-specific configuration updates.

    The function checks if NNCF optimization settings exist in the config and adds
    default input shape information of ``[1, 3, 10, 10]`` if not present. If NNCF
    is enabled and contains update configuration, it merges those updates.

    Args:
        config: Configuration object containing NNCF settings. Must be either a
            ``DictConfig`` or ``ListConfig`` instance.

    Returns:
        ``DictConfig`` or ``ListConfig`` with updated NNCF configuration settings.

    Example:
        >>> from omegaconf import DictConfig
        >>> config = DictConfig({
        ...     "optimization": {
        ...         "nncf": {
        ...             "apply": True,
        ...             "input_info": {"sample_size": [1, 3, 224, 224]}
        ...         }
        ...     }
        ... })
        >>> updated = _update_nncf_config(config)

    Note:
        The default input size of ``[1, 3, 10, 10]`` represents:
        - Batch size of 1
        - 3 input channels (RGB)
        - Height and width of 10 pixels
    """
    if "optimization" in config and "nncf" in config.optimization:
        if "input_info" not in config.optimization.nncf:
            config.optimization.nncf["input_info"] = {"sample_size": None}
        config.optimization.nncf.input_info.sample_size = [1, 3, 10, 10]
        if config.optimization.nncf.apply and "update_config" in config.optimization.nncf:
            return OmegaConf.merge(config, config.optimization.nncf.update_config)
    return config
Update NNCF configuration with input size settings.

    This function updates the Neural Network Compression Framework (NNCF)
    configuration by setting default input size parameters if they are not already
    specified. It also handles merging any NNCF-specific configuration updates.

    The function checks if NNCF optimization settings exist in the config and adds
    default input shape information of ``[1, 3, 10, 10]`` if not present. If NNCF
    is enabled and contains update configuration, it merges those updates.

    Args:
        config: Configuration object containing NNCF settings. Must be either a
            ``DictConfig`` or ``ListConfig`` instance.

    Returns:
        ``DictConfig`` or ``ListConfig`` with updated NNCF configuration settings.

    Example:
        >>> from omegaconf import DictConfig
        >>> config = DictConfig({
        ...     "optimization": {
        ...         "nncf": {
        ...             "apply": True,
        ...             "input_info": {"sample_size": [1, 3, 224, 224]}
        ...         }
        ...     }
        ... })
        >>> updated = _update_nncf_config(config)

    Note:
        The default input size of ``[1, 3, 10, 10]`` represents:
        - Batch size of 1
        - 3 input channels (RGB)
        - Height and width of 10 pixels
    
src/anomalib/utils/config.py