code: def default(self, obj: Any) -> Any:
      if isinstance(obj, Buffer):
          if (
              obj.id in self._buffers
          ):  # TODO: and len(obj.data) > self._threshold:
              return obj.ref
          else:
              return obj.to_base64()
      else:
          return super().default(obj)
  
file_path: bokeh/src/bokeh/core/json_encoder.py
imports: from __future__ import annotations
  import logging
  from json import JSONEncoder
  from typing import Any
  from ..settings import settings
  from .serialization import Buffer, Serialized
label_desc: Use image node_id 2 for calling the PayloadEncoder obj's underlying member method code with example usage: obj.default(obj) and returns: super, obj, obj