docs: def insert_one(self, doc, *args, **kwargs):
          """
          Inserts one document into the collection
          If contains '_id' key it is used, else it is generated.
          :param doc: the document
          :return: InsertOneResult
          """
          if self.table is None:
              self.build_table()
  
          if not isinstance(doc, dict):
              raise ValueError(u'"doc" must be a dict')
  
          _id = doc[u'_id'] = doc.get('_id') or generate_id()
  
          bypass_document_validation = kwargs.get('bypass_document_validation')
          if bypass_document_validation is True:
              # insert doc without validation of duplicated `_id`
              eid = self.table.insert(doc)
          else:
              existing = self.find_one({'_id': _id})
              if existing is None:
                  eid = self.table.insert(doc)
              else:
                  raise DuplicateKeyError(
                      u'_id:{0} already exists in collection:{1}'.format(
                          _id, self.tablename
                      )
                  )
  
          return InsertOneResult(eid=eid, inserted_id=_id)