code: def marshall(
      vega_lite_chart: ArrowVegaLiteChartProto,
      altair_chart: alt.Chart,
      use_container_width: bool = False,
      theme: None | Literal["streamlit"] = "streamlit",
      **kwargs: Any,
  ) -> None:
      """Marshall chart's data into proto."""
      import altair as alt
  
      # Normally altair_chart.to_dict() would transform the dataframe used by the
      # chart into an array of dictionaries. To avoid that, we install a
      # transformer that replaces datasets with a reference by the object id of
      # the dataframe. We then fill in the dataset manually later on.
  
      datasets = {}
  
      def id_transform(data) -> Dict[str, str]:
          """Altair data transformer that returns a fake named dataset with the
          object id.
          """
          name = str(id(data))
          datasets[name] = data
          return {"name": name}
  
      alt.data_transformers.register("id", id_transform)  # type: ignore[attr-defined,unused-ignore]
  
      # The default altair theme has some width/height defaults defined
      # which are not useful for Streamlit. Therefore, we change the theme to
      # "none" to avoid those defaults.
      with alt.themes.enable("none") if alt.themes.active == "default" else nullcontext():  # type: ignore[attr-defined,unused-ignore]
          with alt.data_transformers.enable("id"):  # type: ignore[attr-defined,unused-ignore]
              chart_dict = altair_chart.to_dict()
  
              # Put datasets back into the chart dict but note how they weren't
              # transformed.
              chart_dict["datasets"] = datasets
  
              arrow_vega_lite.marshall(
                  vega_lite_chart,
                  chart_dict,
                  use_container_width=use_container_width,
                  theme=theme,
                  **kwargs,
              )
  
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 23 for calling a global function with example usage: marshall(vega_lite_chart, altair_chart, use_container_width, theme) and returns: dict