class_docstr: Base class for Bokeh property instances, which can be added to Bokeh
  Models.
  
  Args:
      default (obj, optional) :
          A default value for attributes created from this property to have.
  
      help (str or None, optional) :
          A documentation string for this property. It will be automatically
          used by the :ref:`bokeh.sphinxext.bokeh_prop` extension when
          generating Spinx documentation. (default: None)
class_docstr_tok: ["Base","class","for","Bokeh","property","instances",",","which","can","be","added","to","Bokeh","Models",".","Args",":","default","(","obj",",","optional",")",":","A","default","value","for","attributes","created","from","this","property","to","have",".","help","(","str","or","None",",","optional",")",":","A","documentation","string","for","this","property",".","It","will","be","automatically","used","by","the",":","ref",":","`","bokeh.sphinxext.bokeh_prop","`","extension","when","generating","Spinx","documentation",".","(","default",":","None",")"]
code: def prepare_value(
      self,
      owner: HasProps | type[HasProps],
      name: str,
      value: Any,
      *,
      hint: DocumentPatchedEvent | None = None,
  ) -> T:
      if value is Intrinsic:
          value = self._raw_default()
      if value is Undefined:
          return value
  
      error = None
      try:
          if validation_on():
              hinted_value = self._hinted_value(value, hint)
              self.validate(hinted_value)
      except ValueError as e:
          for tp, converter in self.alternatives:
              if tp.is_valid(value):
                  value = converter(value)
                  break
          else:
              error = e
  
      if error is None:
          value = self.transform(value)
      else:
          obj_repr = (
              owner if isinstance(owner, HasProps) else owner.__name__
          )
          raise ValueError(
              f"failed to validate {obj_repr}.{name}: {error}"
          )
  
      if isinstance(owner, HasProps):
          obj = owner
  
          for fn, msg_or_fn in self.assertions:
              if isinstance(fn, bool):
                  result = fn
              else:
                  result = fn(obj, value)
  
              assert isinstance(result, bool)
  
              if not result:
                  if isinstance(msg_or_fn, str):
                      raise ValueError(msg_or_fn)
                  else:
                      msg_or_fn(obj, name, value)
  
      return self.wrap(value)
  
imports: from __future__ import annotations
  import logging
  from copy import copy
  from typing import TYPE_CHECKING, Any, Callable, ClassVar, TypeVar, Union
  from ...util.dependencies import uses_pandas
  from ...util.strings import nice_join
  from ..has_props import HasProps
  from ._sphinx import property_link, register_type_link, type_link
  from .descriptor_factory import PropertyDescriptorFactory
  from .descriptors import PropertyDescriptor
  from .singletons import Intrinsic, IntrinsicType, Undefined, UndefinedType
label_desc: Use image node_id 21 for calling the Property obj's underlying member method code with example usage: obj.prepare_value(owner, name, value) and returns: self, value