from typing import Union
from pathlib import Path


def does_dir_exist(file_path: Union[str, Path]) -> bool:
    """
    Check if a directory exists.
    Implemented here to avoid repetition of logic

    Args:
        file_path (str or Path): The directory path to check

    Returns:
        bool: False if the directory does not exist, True otherwise
    """
    my_file = Path(file_path)
    return my_file.is_dir()