code: def capture(capsys):
      """Extended `capsys` with context manager and custom equality operators"""
      return Capture(capsys)
  
imports: import contextlib
  import difflib
  import gc
  import multiprocessing
  import os
  import re
  import textwrap
  import traceback
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: capture(capsys) and returns: Capture