code: def recover_logger(fn):
      @wraps(fn)
      def wrapper(*args, **kwargs):
          # 保存logger的状态
          handlers = [handler for handler in logger.handlers]
          level = logger.level
          res = fn(*args, **kwargs)
          logger.handlers = handlers
          logger.setLevel(level)
          return res
  
      return wrapper
  
imports: import os
  import sys
  import __main__
  from functools import wraps, partial
  from inspect import ismethod
  from copy import deepcopy
  from io import StringIO
  import time
  import signal
  import pytest
  import numpy
  from fastNLP.core.utils.utils import get_class_that_defined_method
  from fastNLP.envs.env import FASTNLP_GLOBAL_RANK
  from fastNLP.core.drivers.utils import distributed_open_proc
  from fastNLP.core.log import logger
label_desc: Use image node_id 1 for calling a global function with example usage: recover_logger(fn) and returns: wrapper, res