code: def capture_stderr():
      import io
      import sys
  
      stderr = sys.stderr
      stream = io.StringIO()
      sys.stderr = stream
      try:
          yield stream
      finally:
          sys.stderr = stderr
  
file_path: mpi4py/test/mpiunittest.py
imports: from collections import namedtuple
  import contextlib
  import unittest
label_desc: Use image node_id 7 for calling a global function with example usage: capture_stderr() without return types