from typing import Iterable
from pathlib import Path


def find_common_parent(paths: Iterable[Path]) -> Path:
    """Find common parent amongst several file paths."""
    if not paths:
        raise ValueError(f"Expected non-empty `paths`, got {paths}.")
    return max(set.intersection(*[set(p.resolve().parents) for p in paths]))