code: def create_file_after_first_call(func_name):
      def call(*args, **kwargs):
          global _writer
          if _writer is None:
              logdir = logger.get_dir()
              if logdir is None:
                  logdir = logger.auto_set_dir(action="d")
                  logger.warning(
                      "[VisualDL] logdir is None, will save VisualDL files to {}\nView the data using: visualdl --logdir={} --host={}".format(
                          logdir, logdir, get_ip_address()
                      )
                  )
              _writer = LogWriter(logdir=logger.get_dir())
          func = getattr(_writer, func_name)
          func(*args, **kwargs)
          _writer.flush()
  
      return call
  
imports: from visualdl import LogWriter
  from parl.utils import logger
  from parl.utils.machine_info import get_ip_address
label_desc: Use image node_id 1 for calling a global function with example usage: create_file_after_first_call(func_name) and returns: call