from pathlib import Path


def dir_path(path):
    """Wrapper around Path that ensures this directory is created."""
    if not isinstance(path, Path):
        path = Path(path)
    path.mkdir(exist_ok=True, parents=True)
    return path