def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def normalizerootdir(dir, funcname):
    if dir == ".":
        util.nouideprecwarn(
            "match.%s() no longer accepts '.', use '' instead." % funcname, "20190805"
        )
        return ""
    return dir