code: def prepare_df(df: pd.DataFrame) -> pd.DataFrame:
      """
      Prepare DataFrame for data balance analysis.
  
      :param df: The DataFrame to prepare.
      :type df: pd.DataFrame
      :return: The prepared DataFrame.
      :rtype: pd.DataFrame
      """
      try:
          # Deepcopy the df otherwise the original df will mutate
          df = df.copy(deep=True)
      except Exception as e:
          raise ValueError(f"Failed to prepare df due to {e!r}")
  
      return df
  
file_path: responsible-ai-toolbox/responsibleai/responsibleai/databalanceanalysis/data_balance_utils.py
imports: import warnings
  from typing import Any, Dict, List
  import pandas
  from responsibleai.databalanceanalysis.constants import Constants
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_df(df) and returns: df