code: def _is_torchvision_imagefolder(image_folder):
      with os.scandir(image_folder) as folder_iter:
          try:
              dir_entry = next(folder_iter)
              return dir_entry.is_dir()
          except StopIteration:
              raise OSError(f"Image folder {image_folder} is empty")
  
file_path: ClassyVision/classy_vision/dataset/image_path_dataset.py
imports: import os.path
  from typing import Any, Callable, Dict, List, Optional, Union
  from torchvision import datasets, transforms
  from .None import ClassyDataset, register_dataset
  from .core import ListDataset
  from .transforms import build_transforms, ClassyTransform, TupleToMapTransform
label_desc: Use image node_id 1 for calling a global function with example usage: _is_torchvision_imagefolder(image_folder) and returns: dir_entry