code: def _validate_image(filepath):
      actual_media_type = fom.get_media_type(filepath)
      if actual_media_type != fom.IMAGE:
          raise ValueError(
              "The requested operation requires samples whose filepaths are "
              "images, but we found a sample whose filepath '%s' has media type "
              "'%s'.\n\nIf you are working with a frames view that was created "
              "via `to_frames(..., sample_frames=False)`, then re-create the "
              "view without `sample_frames=False` so that the necessary images "
              "will be available." % (filepath, actual_media_type)
          )
  
file_path: fiftyone/fiftyone/core/validation.py
imports: import eta.core.utils
  import fiftyone.core.media
  import fiftyone.core.utils
label_desc: Use image node_id 7 for calling a global function with example usage: _validate_image(filepath) without return types