class_docstr: Accept values that are instances of any class.
  
  .. note::
      This is primarily useful for validation purpose. Non-serializable
      objects will fail regardless during the serialization process.
class_docstr_tok: ["Accept","values","that","are","instances","of","any","class",".","..","note",":",":","This","is","primarily","useful","for","validation","purpose",".","Non-serializable","objects","will","fail","regardless","during","the","serialization","process","."]
code: def validate(self, value: Any, detail: bool = True) -> None:
      super().validate(value, detail)
  
      if isinstance(value, self.instance_type):
          return
  
      instance_type = self.instance_type.__name__
      value_type = type(value).__name__
      msg = (
          ""
          if not detail
          else f"expected an instance of type {instance_type}, got {value} of type {value_type}"
      )
      raise ValueError(msg)
  
imports: from __future__ import annotations
  import logging
  import types
  from importlib import import_module
  from typing import Any, Callable, Generic, TypeVar
  from ..has_props import HasProps
  from ..serialization import Serializable
  from ._sphinx import model_link, property_link, register_type_link
  from .bases import Init, Property
  from .singletons import Undefined
label_desc: Use image node_id 6 for calling the Object obj's underlying member method code with example usage: obj.validate(value, detail) without return types