code: def test_widget_serialization():
      suite_result = create_suite_result()
      output = WidgetSerializer(suite_result).serialize()
  
      top_level_accordion_assertion = all_of(
          instance_of(Accordion),
          has_property("children", contains_exactly(instance_of(VBox))),
      )
      section_assertion = all_of(
          instance_of(VBox),
          has_property(
              "children",
              contains_exactly(
                  instance_of(HTML), instance_of(Accordion)
              ),
          ),
      )
      content_assertion = all_of(
          instance_of(VBox),
          has_property(
              "children",
              contains_exactly(
                  instance_of(HTML),
                  section_assertion,
                  section_assertion,
                  section_assertion,
                  section_assertion,
              ),
          ),
      )
  
      assert_that(output, top_level_accordion_assertion)
      assert_that(output.children[0], content_assertion)
  
imports: import json
  import typing
  from bs4 import BeautifulSoup
  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, Accordion, Tab, VBox
  from plotly.basedatatypes import BaseFigure
  from wandb.sdk.data_types.base_types.wb_value import WBValue
  from deepchecks.core.check_result import CheckFailure, CheckResult
  from deepchecks.core.serialization.common import form_output_anchor, plotlyjs_script
  from deepchecks.core.serialization.suite_result.html import SuiteResultSerializer
  from deepchecks.core.serialization.suite_result.ipython import SuiteResultSerializer
  from deepchecks.core.serialization.suite_result.json import SuiteResultSerializer
  from deepchecks.core.serialization.suite_result.junit import SuiteResultSerializer
  from deepchecks.core.serialization.suite_result.wandb import SuiteResultSerializer
  from deepchecks.core.serialization.suite_result.widget import SuiteResultSerializer
  from deepchecks.core.suite import SuiteResult
  from deepchecks.utils.strings import get_random_string
  from tests.common import create_suite_result, instance_of_ipython_formatter
  from tests.serialization.test_check_failure_serialization import assert_json_output
  from tests.serialization.test_check_result_serialization import assert_json_output
label_desc: Use image node_id 25 for calling a global function with example usage: test_widget_serialization() without return types