code: def assert_outputs_are_printed(
      expected_outputs: dict[str, str], stderr: str
  ):
      escaped_stderr = escape_ansi_colors(stderr)
      received_output_as_dict = dict(
          line.split("=", 1)
          for line in escaped_stderr.splitlines()
          if "=" in line
      )
      for expected_key, expected_value in expected_outputs.items():
          if expected_value is None:
              if expected_key in received_output_as_dict:
                  print_in_color(
                      f"\n[red]ERROR: The '{expected_key}' should not be present in:[/]"
                  )
                  print_in_color(received_output_as_dict)
                  print_in_color("\n")
                  assert expected_key is not None
  
          else:
              received_value = received_output_as_dict.get(expected_key)
              if received_value != expected_value:
                  if received_value is not None:
                      print_in_color(
                          f"\n[red]ERROR: The key '{expected_key}' has unexpected value:"
                      )
                      print(received_value)
                      print_in_color("Expected value:\n")
                      print(expected_value)
                      print_in_color("\nOutput received:")
                      print_in_color(received_output_as_dict)
                      print_in_color()
                      assert received_value == expected_value
                  else:
                      print(
                          f"\n[red]ERROR: The key '{expected_key}' missing but "
                          f"it is expected. Expected value:"
                      )
                      print_in_color(expected_value)
                      print_in_color("\nOutput received:")
                      print(received_output_as_dict)
                      print_in_color()
                      print(received_output_as_dict)
                      print_in_color()
                      assert received_value is not None
  
imports: from __future__ import annotations
  import json
  import re
  from functools import lru_cache
  from typing import Any
  import pytest
  from rich.console import Console
  from airflow_breeze.global_constants import BASE_PROVIDERS_COMPATIBILITY_CHECKS, COMMITTERS, DEFAULT_PYTHON_MAJOR_MINOR_VERSION, GithubEvents
  from airflow_breeze.utils.selective_checks import ALL_CI_SELECTIVE_TEST_TYPES, SelectiveChecks
label_desc: Use image node_id 4 for calling a global function with example usage: assert_outputs_are_printed(expected_outputs, stderr) without return types