code: def runner_creator(cfg):
      model = cfg["model"]
      optimizer = cfg["optimizer"]
      batch_processor_fn = cfg["batch_processor"]
      logger = get_logger("mmcv")
      runner = EpochBasedRunner(
          model,
          optimizer=optimizer,
          batch_processor=batch_processor_fn,
          work_dir=TEMP_WORK_DIR,
          logger=logger,
          max_epochs=MAX_EPOCH,
      )
  
      # learning rate scheduler config
      lr_config = cfg["lr_config"]
      # configuration of saving checkpoints periodically
      checkpoint_config = cfg["checkpoint_config"]
      # configuration of optimizer
      optimizer_config = cfg["optimizer_config"]
      # save log periodically and multiple hooks can be used simultaneously
      log_config = cfg["log_config"]
      # register hooks to runner and those hooks will be invoked automatically
      runner.register_training_hooks(
          lr_config=lr_config,
          optimizer_config=optimizer_config,
          checkpoint_config=checkpoint_config,
          log_config=log_config,
      )
  
      if cfg.get("add_eval_hook"):
          val_set = LinearDataset(size=NUM_SAMPLES)
          val_loader = DataLoader(
              val_set, batch_size=64, shuffle=True, num_workers=2
          )
          eval_hook = DistEvalHook(val_loader)
          runner.register_hook(eval_hook, priority="LOW")
  
      return runner
  
imports: import pytest
  import unittest
  import os
  import tempfile
  import shutil
  import torch
  import torch.nn
  import torch.optim
  from torch.utils.data import DataLoader
  from mmcv.runner import EpochBasedRunner
  from mmcv.runner import DistEvalHook
  from mmcv.utils import get_logger
  from bigdl.orca.learn.pytorch import Estimator
label_desc: Use image node_id 2 for calling a global function with example usage: runner_creator(cfg) and returns: runner