def METHOD_NAME(directory: Path, target: Path) -> bool:
    abs_directory = Path(directory).absolute()
    abs_target = Path(target).absolute()
    prefix = Path(os.path.commonprefix([abs_directory, abs_target]))
    return prefix == abs_directory