code: def progress(state, progress=0.0):
      if len(state_file_name):
          global last_state_datetime
          if (
              last_state_datetime
              < datetime.now() + timedelta(milliseconds=-1000)
              or state is None
          ):
              last_state_datetime = datetime.now()
              retry = 1
              while True:
                  try:
                      with open(state_file_name, "w") as f:
                          if state is not None:
                              f.write(
                                  state
                                  + " ({0:3.2f}%)".format(
                                      progress * 100
                                  )
                              )
                      break
                  except:
                      retry += 1
                      if retry > 100:
                          logger.critical(
                              "Failed to write to {}.".format(
                                  state_file_name
                              )
                          )
                          raise
                      time.sleep(0.1)
      callback.update_progress(
          "{0} ({1:3.2f}%)".format(state, progress * 100)
      )
      if cpu_load_backend_ok:
          callback.update_status()
      if state_callback is not None:
          state_callback(state, progress)
  
imports: import time
  from datetime import datetime, timedelta
  import nnabla.utils.callback
  from nnabla import logger
  from nnabla.utils.cli.utility import cpu_load_backend_ok
label_desc: Use image node_id 2 for calling a global function with example usage: progress(state, progress) without return types