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