from pathlib import Path
from typing import Tuple


def check_for_file_overwrite(file: Path, default_yes: bool = True) -> Tuple[bool, bool]:
    """
    Check if a file exists and prompt the user for overwrite
    """
    exists = False
    abort = False
    if file.exists() is True:
        abort = True
        exists = True
        resp: str
        if default_yes is True:
            resp = input(f"The file {file} already exists. Overwrite? [Y/n)")
            if resp in ["", "Y", "y", "yes"]:
                abort = False
        else:
            resp = input(f"The file {file} already exists. Overwrite? [y/N)")
            if resp in ["Y", "y", "yes"]:
                abort = False
    return abort, exists