code: def _save_model(args, rank=0):
      if args.model_prefix is None:
          return None
      dst_dir = os.path.dirname(args.model_prefix)
      if not os.path.isdir(dst_dir):
          os.mkdir(dst_dir)
      return mx.callback.do_checkpoint(
          args.model_prefix
          if rank == 0
          else "%s-%d" % (args.model_prefix, rank)
      )
  
file_path: DALI/docs/examples/frameworks/mxnet/demo/common/fit.py
imports: import logging
  import os
  import time
  import re
  import math
  import mxnet
label_desc: Use image node_id 3 for calling a global function with example usage: _save_model(args, rank) and returns: mx, None