code: def check_integrity(models: Iterable[Model]) -> ValidationIssues:
      """Collect all warnings associated with a collection of Bokeh models.
  
      Args:
          models (seq[Model]) : a collection of Models to test
  
      Returns:
          ValidationIssues: A collection of all warning and error messages
  
      This function will return an object containing all errors and/or
      warning conditions that are detected. For example, layouts without
      any children will add a warning to the collection:
  
      .. code-block:: python
  
          >>> empty_row = Row()
  
          >>> check_integrity([empty_row])
          ValidationIssues(
              error=[],
              warning=[
                  ValidationIssue(
                      code=1002,
                      name="EMPTY_LAYOUT",
                      text="Layout has no children",
                      extra="Row(id='1001', ...)",
                  ),
              ],
          )
  
      """
      issues = ValidationIssues(error=[], warning=[])
  
      for model in models:
          validators: list[Validator] = []
          for name in dir(model):
              if not name.startswith("_check"):
                  continue
              obj = getattr(model, name)
              if getattr(obj, "validator_type", None):
                  validators.append(obj)
          for func in validators:
              if func.validator_type == "error":
                  issues.error.extend(func())
              else:
                  issues.warning.extend(func())
  
      return issues
  
file_path: bokeh/src/bokeh/core/validation/check.py
imports: from __future__ import annotations
  import logging
  import contextlib
  from typing import Iterable, Iterator, Literal, Protocol
  from ...model import Model
  from ...settings import settings
  from ...util.dataclasses import dataclass
  from .issue import Warning
label_desc: Use image node_id 4 for calling a global function with example usage: check_integrity(models) and returns: issues