code: def auto_set_dir(action=None, name=None):
      """
      Use :func:`logger.set_logger_dir` to set log directory to
      "./train_log/{scriptname}:{name}". "scriptname" is the name of the main python file currently running
      """
      mod = sys.modules["__main__"]
      basename = os.path.basename(mod.__file__)
      auto_dirname = os.path.join(
          "train_log", basename[: basename.rfind(".")]
      )
      if name:
          auto_dirname += (
              "_%s" % name if os.name == "nt" else ":%s" % name
          )
      set_logger_dir(auto_dirname, action=action)
  
file_path: tensorpack/tensorpack/utils/logger.py
imports: import logging
  import os
  import os.path
  import shutil
  import sys
  from datetime import datetime
  from six.moves import input
  from termcolor import colored
label_desc: Use image node_id 5 for calling a global function with example usage: auto_set_dir(action, name) without return types