from typing import Iterable


def _is_dir(prefix: str, keys: Iterable[str]) -> bool:
    """determine whether the prefix refers to a directory"""
    if prefix.endswith("/"):
        return True
    return all(key.startswith(f"{prefix}/") for key in keys)