def METHOD_NAME(path):
    """
    Convenience function to get the immediate subfolders under a path for unauthenticated
    users.
    """
    qs = get_unauthenticated_user_path_file_queryset(path)
    path_username = path.split('/', 1)[0]
    if path_username == path and path_username != 'PIPELINES':
            shared_feeds_qs = Feed.objects.filter(owner__username=path).filter(public=True)
            subfolders = sorted([f'feed_{feed.id}' for feed in shared_feeds_qs])
    else:
        hash_set = set()
        existing_path = False
        for obj in qs:
            name = obj.fname.name
            if name.startswith(path + '/'):
                existing_path = True
                folder = name.replace(path + '/', '', 1)
                try:
                    first_slash_ix = folder.index('/')
                except ValueError:
                    pass  # no folders under this path (only files)
                else:
                    folder = folder[:first_slash_ix]
                    hash_set.add(folder)
        if len(qs) and not existing_path:
            raise ValueError('Path not found.')
        subfolders = sorted(hash_set)
    return subfolders