def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def _resetExpect(self):
        self.previousExpectLine = ""
        if self._connection is not None and isinstance(self._connection.buffer, str):
            self.previousExpectLine = self._connection.buffer 
            self._connection.buffer = ""