<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def insert(self, document):
 """ Insert a new document into the table. :param document: the document to insert :returns: the inserted document's ID """


        doc_id = self._get_doc_id(document)
        data = self._read()
        data[doc_id] = dict(document)
        self._write(data)

        return doc_id