code: def sanity_check_dataframe(data: pd.DataFrame):
      """
      Checking if the dataframe contains valid headers and values
      Parameters
      ----------
      data
          dataframe holding the data for object detection
      Returns
      -------
  
      """
      if "image" not in data:
          raise ValueError(
              f"column 'image' not found in data column names: {data.columns.to_list()}"
          )
      if "rois" not in data and "label" not in data:
          raise ValueError(
              f"Both column 'rois' and 'label' not found in data column names: {data.columns.to_list()}"
          )
      else:
          if "rois" not in data:
              warnings.warn(
                  f"column 'rois' not found in data column names: {data.columns.to_list()}. Copying from 'label' column..."
              )
              data["rois"] = data["label"]
          if "label" not in data:
              warnings.warn(
                  f"column 'label' not found in data column names: {data.columns.to_list()}. Copying from 'rois' column..."
              )
              data["label"] = data["rois"]
      assert data.shape[0] > 0, "data frame is empty"
  
imports: import json
  import logging
  import os
  import warnings
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Union
  import defusedxml.ElementTree
  import numpy
  import pandas
  import PIL
  from torchmetrics.detection.mean_ap import MeanAveragePrecision
  from ..constants import BBOX, LABEL, MAP, MAP_50, MAP_75, MAP_LARGE, MAP_MEDIUM, MAP_SMALL, MAR_1, MAR_10, MAR_100, MAR_LARGE, MAR_MEDIUM, MAR_SMALL, MEAN_AVERAGE_PRECISION
  from .download import download, is_url
label_desc: Use image node_id 5 for calling a global function with example usage: sanity_check_dataframe(data) without return types