code: def capture_sys_output():
      caputure_out, capture_err = StringIO(), StringIO()
      current_out, current_err = sys.stdout, sys.stderr
      try:
          sys.stdout, sys.stderr = caputure_out, capture_err
          yield caputure_out, capture_err
      finally:
          sys.stdout, sys.stderr = current_out, current_err
  
file_path: nipype/nipype/utils/tests/test_cmd.py
imports: import pytest
  import sys
  from contextlib import contextmanager
  from io import StringIO
  from ...utils import nipype_cmd
label_desc: Use image node_id 1 for calling a global function with example usage: capture_sys_output() without return types