from pathlib import Path


def ensure_dir(directory):
    """ creates directory if it doesn't exist """
    directory = Path(directory)
    if not directory.is_dir():
        directory.mkdir(parents=True, exist_ok=False)
        return False
    return True