def _mkdir_p(path):
    """Creates all non-existing directories encountered in the passed in path

    Args:
        path (str):
            Path containing directories to create

    Raises:
        OSError:
            If some underlying error occurs when calling :func:`os.makedirs`,
            that is not errno.EEXIST.
    """
    try:
        os.makedirs(path)
    except __HOLE__ as exc:
        if exc.errno == errno.EEXIST and os.path.isdir(path):
            pass
        else:
            raise
dataset/ETHPy150Open jmagnusson/Flask-Resize/flask_resize/__init__.py/_mkdir_p