code: def capture_logs_with_contextvars():
      cap = structlog.testing.LogCapture()
      old_processors = structlog.get_config()["processors"]
      try:
          structlog.configure(
              processors=[structlog.contextvars.merge_contextvars, cap]
          )
          yield cap.entries
      finally:
          structlog.configure(processors=old_processors)
  
imports: import contextlib
  import os
  import structlog
  from structlog.testing import capture_logs
  from modelkit.utils.logging import ContextualizedLogging
label_desc: Use image node_id 2 for calling a global function with example usage: capture_logs_with_contextvars() without return types