#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------------------------------------------- ''' Provide a base class for all objects (called Bokeh Models) that can go in a Bokeh |Document|. ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- from __future__ import annotations import logging # isort:skip log = logging.getLogger(__name__) #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Standard library imports from operator import itemgetter from typing import TYPE_CHECKING, Any, Type # Bokeh imports from ..util.serialization import make_id from ..util.string import append_docstring if TYPE_CHECKING: from .model import Model #----------------------------------------------------------------------------- # Globals and constants #----------------------------------------------------------------------------- __all__ = ( 'html_repr', 'process_example' ) #----------------------------------------------------------------------------- # General API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Dev API #----------------------------------------------------------------------------- def html_repr(obj: Model): module = obj.__class__.__module__ name = obj.__class__.__name__ _id = getattr(obj, "_id", None) cls_name = make_id() def row(c: str): return f'