code: def test_default_values(
      model: type[Model], name: str, descriptor: PropertyDescriptor[Any]
  ) -> None:
      p = descriptor.property
      # In a few instances there is a default that needs to be prepared, e.g. by
      # an accepts clause. Use class_default rather than _raw_default.
      value = descriptor.class_default(model)
      if value is not Undefined:
          assert (
              p.is_valid(value) is True
          ), f"{name}.{descriptor.name} has an invalid default value {value!r}"
  
file_path: bokeh/tests/unit/bokeh/models/test_defaults.py
imports: from __future__ import annotations
  import pytest
  from typing import Any
  from bokeh.core.property.descriptors import PropertyDescriptor
  from bokeh.core.property.singletons import Undefined
  from bokeh.model import Model
  from bokeh import models
label_desc: Use image node_id 2 for calling a global function with example usage: test_default_values(model, name, descriptor) without return types