code: def assert_json_output(
      output,
      check_result,
      with_conditions_table=True,
      with_display=True,
  ):
      # NOTE: CheckResult JSON serializer returns not a json string
      # but a simple builtin python values which then can be serailized into json string.
      # We need to verify that this is actually true
      assert_that(json.loads(json.dumps(output)) == output)
  
      assert_that(
          output,
          all_of(
              instance_of(dict),
              has_entries(
                  {
                      "check": instance_of(dict),
                      "value": equal_to(check_result.value),
                      "header": equal_to(check_result.header),
                      "conditions_results": all_of(
                          instance_of(list),
                          has_length(greater_than(0))
                          if with_conditions_table is True
                          else has_length(equal_to(0)),
                      ),
                      "display": all_of(
                          instance_of(list),
                          has_length(greater_than(0))
                          if with_display is True
                          else has_length(equal_to(0)),
                      ),
                  }
              ),
          ),
      )
  
      if with_display is True:
          for index, it in enumerate(check_result.display):
              assert_that(
                  output["display"][index],
                  is_serialized_to_json_display_item(type(it)),
              )
  
imports: import json
  import typing
  import pandas
  import wandb
  from hamcrest import all_of, assert_that, calling, contains_exactly, contains_string, equal_to, greater_than, has_entries, has_item, has_length, has_property, instance_of, matches_regexp, only_contains, raises, starts_with
  from IPython.display import Image
  from ipywidgets import HTML, Tab, VBox
  from pandas.io.formats.style import Styler
  from plotly.basedatatypes import BaseFigure
  from deepchecks.core.check_result import DisplayMap
  from deepchecks.core.serialization.check_result.html import CheckResultSerializer
  from deepchecks.core.serialization.check_result.html import DisplayItemsHandler
  from deepchecks.core.serialization.check_result.ipython import CheckResultSerializer
  from deepchecks.core.serialization.check_result.ipython import DisplayItemsHandler
  from deepchecks.core.serialization.check_result.json import CheckResultSerializer
  from deepchecks.core.serialization.check_result.json import DisplayItemsHandler
  from deepchecks.core.serialization.check_result.junit import CheckResultSerializer
  from deepchecks.core.serialization.check_result.wandb import CheckResultSerializer
  from deepchecks.core.serialization.check_result.widget import CheckResultSerializer
  from deepchecks.core.serialization.check_result.widget import DisplayItemsHandler
  from deepchecks.core.serialization.common import plotlyjs_script
  from deepchecks.utils.strings import get_random_string
  from tests.common import DummyCheck, create_check_result, create_check_result_display, instance_of_ipython_formatter
label_desc: Use image node_id 25 for calling a global function with example usage: assert_json_output(output, check_result, with_conditions_table, with_display) without return types