code: def dataframe(df, metrics_list):
      """Validates if dataframe has all the necessary fieds to plot charts.
  
      :param user_input_df: a dataframe from Aequitas
      :type user_input_df: pandas.core.frame.DataFrame
      :param metrics_list: a list of valid metrics
      :type metrics_list: list
      """
      for field in DF_FIELDS:
          try:
              df[field]
          except KeyError:
              print(
                  f'The dataframe does not contain the column "{field}"'
              )
              raise
  
      for metric in metrics_list:
          try:
              df[metric]
          except KeyError:
              print(
                  f'The dataframe does not contain the column "{metric}".'
              )
              raise
          if metric not in NON_DISPARITY_METRICS_LIST:
              try:
                  df[f"{metric}_disparity"]
              except KeyError:
                  print(
                      f'The dataframe does not contain the column "{metric}_disparity".'
                  )
                  raise
  
file_path: aequitas/src/aequitas/plot/commons/validators.py
imports: from aequitas.plot.commons.style import sizes
  from aequitas.plot.commons.helpers import calculate_chart_size_from_elements, to_list
label_desc: Use image node_id 1 for calling a global function with example usage: dataframe(df, metrics_list) without return types