code: def _use_display_values(
      df: pd.DataFrame, styles: Mapping[str, Any]
  ) -> pd.DataFrame:
      """Create a new pandas.DataFrame where display values are used instead of original ones.
  
      Parameters
      ----------
      df : pandas.DataFrame
          A dataframe with original values.
  
      styles : dict
          pandas.Styler translated styles.
  
      """
      import re
  
      # If values in a column are not of the same type, Arrow
      # serialization would fail. Thus, we need to cast all values
      # of the dataframe to strings before assigning them display values.
      new_df = df.astype(str)
  
      cell_selector_regex = re.compile(r"row(\d+)_col(\d+)")
      if "body" in styles:
          rows = styles["body"]
          for row in rows:
              for cell in row:
                  if "id" in cell:
                      if match := cell_selector_regex.match(cell["id"]):
                          r, c = map(int, match.groups())
                          new_df.iat[r, c] = str(cell["display_value"])
  
      return new_df
  
file_path: streamlit/lib/streamlit/elements/lib/pandas_styler_utils.py
imports: from typing import TYPE_CHECKING, Any, List, Mapping, TypeVar
  import pandas
  from streamlit import type_util
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto.Arrow_pb2 import Arrow
label_desc: Use image node_id 8 for calling a global function with example usage: _use_display_values(df, styles) and returns: new_df