def SetAttributes(self, urn, attributes, to_delete, add_child_index=True,
                    mutation_pool=None, sync=False, token=None):
    """Sets the attributes in the data store and update the cache."""
    # Force a data_store lookup next.
    try:
      # Expire all entries in the cache for this urn (for all tokens, and
      # timestamps)
      self.cache.ExpirePrefix(utils.SmartStr(urn) + ":")
    except __HOLE__:
      pass

    attributes[AFF4Object.SchemaCls.LAST] = [
        rdfvalue.RDFDatetime().Now().SerializeToDataStore()]
    to_delete.add(AFF4Object.SchemaCls.LAST)
    if mutation_pool:
      mutation_pool.MultiSet(urn, attributes, replace=False,
                             to_delete=to_delete)
    else:
      data_store.DB.MultiSet(urn, attributes, token=token,
                             replace=False, sync=sync, to_delete=to_delete)

    if add_child_index:
      self._UpdateChildIndex(urn, token, mutation_pool=mutation_pool)
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/Factory.SetAttributes