def _contains_videos(root: str, extensions: tuple[str, ...]) -> bool:
    """Checks whether the directory or any subdirectory contains video files.

    Args:
        root: Root directory path.
        extensions: Tuple of valid video file extensions.

    Returns:
        True if the root directory or any subdirectory contains video files, False otherwise.
    """
    for subdir, _, _ in os.walk(root):
        if _dir_contains_videos(subdir, extensions):
            return True
    return False
Checks whether the directory or any subdirectory contains video files.

    Args:
        root: Root directory path.
        extensions: Tuple of valid video file extensions.

    Returns:
        True if the root directory or any subdirectory contains video files, False otherwise.
    
lightly/data/_helpers.py