parents: no error if existing, make parent directories as needed

def mkdir(path, parents=False):
    """
    parents: no error if existing, make parent directories as needed
    """
    func = os.makedirs if parents else os.mkdir
    try:
        return func(path)
    except:
        if not parents:
            raise