code: def apply_data_specific_configs(
      columns_config: ColumnConfigMapping,
      data_df: pd.DataFrame,
      data_format: DataFormat,
      check_arrow_compatibility: bool = False,
  ) -> None:
      """Apply data specific configurations to the provided dataframe.
  
      This will apply inplace changes to the dataframe and the column configurations
      depending on the data format.
  
      Parameters
      ----------
      columns_config : ColumnConfigMapping
          A mapping of column names/ids to column configurations.
  
      data_df : pd.DataFrame
          The dataframe to apply the configurations to.
  
      data_format : DataFormat
          The format of the data.
  
      check_arrow_compatibility : bool
          Whether to check if the data is compatible with arrow.
      """
      # Deactivate editing for columns that are not compatible with arrow
      if check_arrow_compatibility:
          for column_name, column_data in data_df.items():
              if is_colum_type_arrow_incompatible(column_data):
                  update_column_config(
                      columns_config, column_name, {"disabled": True}
                  )
                  # Convert incompatible type to string
                  data_df[column_name] = column_data.astype("string")
  
      # Pandas adds a range index as default to all datastructures
      # but for most of the non-pandas data objects it is unnecessary
      # to show this index to the user. Therefore, we will hide it as default.
      if data_format in [
          DataFormat.SET_OF_VALUES,
          DataFormat.TUPLE_OF_VALUES,
          DataFormat.LIST_OF_VALUES,
          DataFormat.NUMPY_LIST,
          DataFormat.NUMPY_MATRIX,
          DataFormat.LIST_OF_RECORDS,
          DataFormat.LIST_OF_ROWS,
          DataFormat.COLUMN_VALUE_MAPPING,
      ]:
          update_column_config(
              columns_config, INDEX_IDENTIFIER, {"hidden": True}
          )
  
      # Rename the first column to "value" for some of the data formats
      if data_format in [
          DataFormat.SET_OF_VALUES,
          DataFormat.TUPLE_OF_VALUES,
          DataFormat.LIST_OF_VALUES,
          DataFormat.NUMPY_LIST,
          DataFormat.KEY_VALUE_DICT,
      ]:
          # Pandas automatically names the first column "0"
          # We rename it to "value" in selected cases to make it more descriptive
          data_df.rename(columns={0: "value"}, inplace=True)
  
      if not isinstance(data_df.index, pd.RangeIndex):
          # If the index is not a range index, we will configure it as required
          # since the user is required to provide a (unique) value for editing.
          update_column_config(
              columns_config, INDEX_IDENTIFIER, {"required": True}
          )
  
imports: from __future__ import annotations
  import json
  from enum import Enum
  from typing import Dict, List, Mapping, Optional, Union
  import pandas
  import pyarrow
  from typing_extensions import Final, Literal, TypeAlias
  from streamlit.elements.lib.column_types import ColumnConfig, ColumnType
  from streamlit.elements.lib.dicttools import remove_none_values
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto.Arrow_pb2 import Arrow
  from streamlit.type_util import DataFormat, is_colum_type_arrow_incompatible
label_desc: Use image node_id 9 for calling a global function with example usage: apply_data_specific_configs(columns_config, data_df, data_format, check_arrow_compatibility) without return types