class_docstr: 使用例子
  with Capturing() as output:
      do_something
  
  assert 'xxx' in output[0]
code: def __enter__(self):
      self._stdout = sys.stdout
      self._stderr = sys.stderr
      sys.stdout = self._stringio = StringIO()
      sys.stderr = self._stringioerr = StringIO()
      return self
  
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 2 for calling the Capturing obj's underlying member method code with example usage: obj.__enter__() and returns: self