from pathlib import Path


def ensure_path(base_path, *args):
    """Checks whethe given path exists and creates if not"""
    p = Path(base_path).joinpath(*args)
    if not p.exists(): p.mkdir(parents = True)
    return str(p)