def path_from_file_uri(uri: str) -> str:
    """Convert a file URI to a local path. Idempotent on regular paths.
    Raises if presented with a scheme besides file://
    """
    if uri.startswith("file://"):
        return uri.replace("file://", "")

    if "://" in uri:
        raise ValueError(f"Cannot convert URI to path: {uri}")
    return uri