code: def compat_runner_args(cfg):
      if "runner" not in cfg:
          cfg.runner = ConfigDict(
              {
                  "type": "EpochBasedRunner",
                  "max_epochs": cfg.total_epochs,
              }
          )
          warnings.warn(
              "config is now expected to have a `runner` section, "
              "please set `runner` in your config.",
              UserWarning,
          )
      else:
          if "total_epochs" in cfg:
              assert cfg.total_epochs == cfg.runner.max_epochs
      return cfg
  
imports: import copy
  import warnings
  from mmengine.config import ConfigDict
label_desc: Use image node_id 2 for calling a global function with example usage: compat_runner_args(cfg) and returns: cfg