code: def _get_size_encoding(
      chart_type: ChartType,
      size_column: str | None,
      size_value: str | float | None,
  ) -> alt.Size | alt.SizeValue | None:
      import altair as alt
  
      if chart_type == ChartType.SCATTER:
          if size_column is not None:
              return alt.Size(
                  size_column,
                  legend=SIZE_LEGEND_SETTINGS,
              )
  
          elif isinstance(size_value, (float, int)):
              return alt.SizeValue(size_value)
          elif size_value is None:
              return alt.SizeValue(100)
          else:
              raise StreamlitAPIException(
                  f"This does not look like a valid size: {repr(size_value)}"
              )
  
      elif size_column is not None or size_value is not None:
          raise Error(
              f"Chart type {chart_type.name} does not support size argument. "
              "This should never happen!"
          )
  
      return None
  
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 19 for calling a global function with example usage: _get_size_encoding(chart_type, size_column, size_value) and returns: None, alt, alt, alt