'Set multiple attributes for a given subject at once.'

@RPCWrapper
def MultiSet(self, request, unused_response):

    values = {}
    to_delete = set()
    for value in request.values:
        if (value.option == rdf_data_store.DataStoreValue.Option.REPLACE):
            to_delete.add(value.attribute)
        timestamp = self.FromTimestampSpec(request.timestamp)
        if value.HasField('value'):
            if value.HasField('timestamp'):
                timestamp = self.FromTimestampSpec(value.timestamp)
            values.setdefault(value.attribute, []).append((value.value.GetValue(), timestamp))
    self.db.MultiSet(request.subject[0], values, to_delete=to_delete, sync=request.sync, replace=False, token=request.token)
