code: def stage_histogram(d: pd.DataFrame, title: str = "") -> alt.Chart:
      """Plots a histogram of runtimes stacked by stage.
  
      Args:
        d: A dataframe of runtimes, either by region or by task.
        title: A title for the plot.
  
      Returns:
        An altair chart.
      """
      columns_used = RUNTIME_COLUMNS
      d = d[columns_used]
      return (
          alt.Chart(d)
          .transform_fold(
              RUNTIME_COLUMNS, as_=["Stage", "runtime_by_stage"]
          )
          .mark_bar(opacity=0.3)
          .encode(
              x=alt.X(
                  "runtime_by_stage:Q",
                  bin=alt.Bin(maxbins=100),
                  title="Runtime (seconds)",
              ),
              y=alt.Y("count()", title="Count of regions", stack=None),
              color=alt.Color("Stage:N", sort=None),
          )
          .properties(title=title)
      )
  
imports: from typing import Dict, Sequence, List, Tuple, Text, Union
  from absl import app
  from absl import flags
  import altair
  import pandas
  import tensorflow
  from third_party.nucleus.io import sharded_file_utils
  from deepvariant import dashboard_utils
label_desc: Use image node_id 5 for calling a global function with example usage: stage_histogram(d, title) and returns: alt