import typing
from pathlib import Path


def check_path(*path: typing.Union[str, Path], must_exist: bool = True) -> Path:
    """
    Verifies a Path object

    :param path: path to check
    :type path: Path
    :param must_exist: set to True if Path must exist
    :type must_exist: bool
    :return: verified Path
    :rtype: Path
    :raises : FileNotFoundError if Path must exist but isn't found
    """
    _path = Path(*path).absolute()
    if must_exist and not _path.exists():
        raise FileNotFoundError(str(_path))
    return _path.absolute()