def mkdir_p(path):
    """Create potentially nested directories as required.

    Does nothing if the path already exists and is a directory.
    """
    try:
        os.makedirs(path)
    except __HOLE__ as e:
        if e.errno == errno.EEXIST and os.path.isdir(path):
            pass
        else:
            raise
dataset/ETHPy150Open radhermit/vimball/vimball/base.py/mkdir_p