code: def _index_template(args):
      if not args.index_template:
          return None
      index_template = os.path.join(config.cwd(), args.index_template)
      if not os.path.exists(index_template):
          cli.error(f"index template '{index_template}' does not exist")
      if os.path.isdir(index_template):
          return _index_template_readme(index_template)
      return index_template
  
file_path: guildai/guild/commands/publish_impl.py
imports: import os
  from guild import batch_util
  from guild import cli
  from guild import config
  from guild import publish
  from guild import util
  from .None import runs_impl
label_desc: Use image node_id 5 for calling a global function with example usage: _index_template(args) and returns: index_template, None, _index_template_readme