code: def get_detection_classes(sample_data_path):
      """
      The all class names for given data.
  
      Parameters
      ----------
      sample_data_path
          If it is a file, it is the path to COCO format json annotation file. Could be any split, e.g. train/val/test/....
          If it is a directory, it is path to the root directory of VOC data.
  
      Returns
      -------
          All the class names.
      """
      if isinstance(sample_data_path, str):
          if os.path.isdir(sample_data_path):
              return get_voc_format_classes(sample_data_path)
          else:
              return get_coco_format_classes(sample_data_path)
      elif isinstance(sample_data_path, pd.DataFrame):
          return get_df_unique_classes(sample_data_path)
  
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 29 for calling a global function with example usage: get_detection_classes(sample_data_path) and returns: get_voc_format_classes, get_coco_format_classes, get_df_unique_classes