docstr: checkpoint name is in the format of 'epoch={epoch}.ckpt'
docstr_tok: ["checkpoint","name","is","in","the","format","of","'epoch=","{","epoch","}",".ckpt","'"]
code: def _format_checkpoint_name(cls, dirname, filename, stats=None):
      """
      checkpoint name is in the format of 'epoch={epoch}.ckpt'
      """
      # check and parse user passed keys in the string
      groups = re.findall(r"(\{.*?)[:\}]", filename)
      if len(groups) >= 0:
          stats = dict() if stats is None else stats
          for group in groups:
              name = group[1:]
  
              if "epoch" not in name and "iter" not in name:
                  warnings.warn(
                      "We only support filepath with {epoch} or {iter} for now."
                  )
  
              filename = filename.replace(group, name + "={" + name)
  
              if name not in stats:
                  stats[name] = 0
          filename = filename.format(**stats)
      ckpt_name = f"{filename}{cls.FILE_EXTENSION}"
      ckpt_path = os.path.join(dirname, ckpt_name)
      return ckpt_path
  
file_path: BigDL/python/orca/src/bigdl/orca/learn/pytorch/callbacks/model_checkpoint.py
imports: from bigdl.orca.learn.pytorch.callbacks import Callback
  import os
  import re
  import warnings
  from bigdl.dllib.utils.log4Error import invalidInputError
label_desc: Use image node_id 7 for calling the ModelCheckpoint obj's underlying member method code with example usage: obj._format_checkpoint_name(cls, dirname, filename, stats) and returns: ckpt_path