code: def apply(self, cfg, allow_update):
      if not allow_update:
          cfg = copy.deepcopy(cfg)
      self.check_and_correct(cfg)
  
imports: import copy
  from paddleseg.utils import logger
  from paddleseg.utils import utils
label_desc: Use image node_id 2 for calling the Rule obj's underlying member method code with example usage: obj.apply(cfg, allow_update) without return types