code: def _get_tooltip_encoding(
      x_column: str,
      y_column: str,
      size_column: str | None,
      color_column: str | None,
      color_enc: alt.Color | alt.ColorValue | None,
  ) -> list[alt.Tooltip]:
      import altair as alt
  
      tooltip = []
  
      # If the x column name is the crazy anti-collision name we gave it, then need to set
      # up a tooltip title so we never show the crazy name to the user.
      if x_column == SEPARATED_INDEX_COLUMN_NAME:
          tooltip.append(
              alt.Tooltip(x_column, title=SEPARATED_INDEX_COLUMN_TITLE)
          )
      else:
          tooltip.append(alt.Tooltip(x_column))
  
      # If the y column name is the crazy anti-collision name we gave it, then need to set
      # up a tooltip title so we never show the crazy name to the user.
      if y_column == MELTED_Y_COLUMN_NAME:
          tooltip.append(
              alt.Tooltip(
                  y_column,
                  title=MELTED_Y_COLUMN_TITLE,
                  type="quantitative",  # Just picked something random. Doesn't really matter!
              )
          )
      else:
          tooltip.append(alt.Tooltip(y_column))
  
      # If we earlier decided that there should be no color legend, that's because the
      # user passed a color column with actual color values (like "#ff0"), so we should
      # not show the color values in the tooltip.
      if (
          color_column
          and getattr(color_enc, "legend", True) is not None
      ):
          # Use a human-readable title for the color.
          if color_column == MELTED_COLOR_COLUMN_NAME:
              tooltip.append(
                  alt.Tooltip(
                      color_column,
                      title=MELTED_COLOR_COLUMN_TITLE,
                      type="nominal",
                  )
              )
          else:
              tooltip.append(alt.Tooltip(color_column))
  
      if size_column:
          tooltip.append(alt.Tooltip(size_column))
  
      return tooltip
  
imports: from __future__ import annotations
  from contextlib import nullcontext
  from datetime import date
  from enum import Enum
  from typing import TYPE_CHECKING, Any, Collection, Dict, List, Sequence, Tuple, cast
  import pandas
  from pandas.api.types import infer_dtype, is_integer_dtype
  from typing_extensions import Literal
  import streamlit.elements.arrow_vega_lite
  from streamlit import type_util
  from streamlit.color_util import Color, is_color_like, is_color_tuple_like, is_hex_color_like, to_css_color
  from streamlit.elements.altair_utils import AddRowsMetadata
  from streamlit.elements.arrow import Data
  from streamlit.elements.utils import last_index_for_melted_dataframes
  from streamlit.errors import Error, StreamlitAPIException
  from streamlit.proto.ArrowVegaLiteChart_pb2 import ArrowVegaLiteChart
  from streamlit.runtime.metrics_util import gather_metrics
label_desc: Use image node_id 20 for calling a global function with example usage: _get_tooltip_encoding(x_column, y_column, size_column, color_column, color_enc) and returns: tooltip