code: def _WriteAttributeContainer(self, attribute_container):
      
      if attribute_container.CONTAINER_TYPE == self._CONTAINER_TYPE_EVENT:
        timestamp, serialized_data = self._serialized_event_heap.PopEvent()
      else:
        serialized_data = self._SerializeAttributeContainer(attribute_container)
  
      if self.compression_format == definitions.COMPRESSION_FORMAT_ZLIB:
        compressed_data = zlib.compress(serialized_data)
        serialized_data = sqlite3.Binary(compressed_data)
      else:
        compressed_data = ''
  
      if self._storage_profiler:
        self._storage_profiler.Sample(
            'write', attribute_container.CONTAINER_TYPE, len(serialized_data),
            len(compressed_data))
  
      if attribute_container.CONTAINER_TYPE == self._CONTAINER_TYPE_EVENT:
        query = 'INSERT INTO event (_timestamp, _data) VALUES (?, ?)'
        self._cursor.execute(query, (timestamp, serialized_data))
      else:
        query = 'INSERT INTO {0:s} (_data) VALUES (?)'.format(
            attribute_container.CONTAINER_TYPE)
        self._cursor.execute(query, (serialized_data, ))
  
      identifier = identifiers.SQLTableIdentifier(
          attribute_container.CONTAINER_TYPE, self._cursor.lastrowid)
      attribute_container.SetIdentifier(identifier)
docs: Writes an attribute container.
  
      The table for the container type must exist.
  
      Args:
        attribute_container (AttributeContainer): attribute container.