def ensure_dir(path):
    """Create all parent directories of path if they don't exist.

    Args:
        path. Path-like object. Create parent dirs to this path.

    Return:
        None.

    """
    os.makedirs(os.path.abspath(os.path.dirname(path)), exist_ok=True)
Create all parent directories of path if they don't exist.

    Args:
        path. Path-like object. Create parent dirs to this path.

    Return:
        None.