code: def _get_pydeck_tooltip(
      pydeck_obj: Optional["Deck"],
  ) -> Optional[Dict[str, str]]:
      if pydeck_obj is None:
          return None
  
      # For pydeck <0.8.1 or pydeck>=0.8.1 when jupyter extra is installed.
      desk_widget = getattr(pydeck_obj, "deck_widget", None)
      if desk_widget is not None and isinstance(
          desk_widget.tooltip, dict
      ):
          return desk_widget.tooltip
  
      # For pydeck >=0.8.1 when jupyter extra is not installed.
      # For details, see: https://github.com/visgl/deck.gl/pull/7125/files
      tooltip = getattr(pydeck_obj, "_tooltip", None)
      if tooltip is not None and isinstance(tooltip, dict):
          return tooltip
  
      return None
  
file_path: streamlit/lib/streamlit/elements/deck_gl_json_chart.py
imports: import hashlib
  import json
  from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, cast
  from typing_extensions import Final
  from streamlit import config
  from streamlit.proto.DeckGlJsonChart_pb2 import DeckGlJsonChart
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.util import HASHLIB_KWARGS
label_desc: Use image node_id 1 for calling a global function with example usage: _get_pydeck_tooltip(pydeck_obj) and returns: None, None, desk_widget, tooltip