Set multiple attributes' values for this subject in one operation.
160693
def MultiSet(self,
               subject,
               values,
               timestamp=None,
               replace=True,
               sync=True,
               to_delete=None):
    """"""
    to_delete = set(to_delete or [])

    # Prepare a bulk insert operation.
    subject = utils.SmartUnicode(subject)
    to_insert = []
    to_replace = []
    transaction = []

    # Build a document for each unique timestamp.
    for attribute, sequence in iteritems(values):
      for value in sequence:
        if isinstance(value, tuple):
          value, entry_timestamp = value
        else:
          entry_timestamp = timestamp

        if entry_timestamp is None:
          entry_timestamp = timestamp

        if entry_timestamp is not None:
          entry_timestamp = int(entry_timestamp)
        else:
          entry_timestamp = time.time() * 1e6

        attribute = utils.SmartUnicode(attribute)
        data = self._Encode(value)

        # Replacing means to delete all versions of the attribute first.
        if replace or attribute in to_delete:
          existing = self._CountExistingRows(subject, attribute)
          if existing:
            to_replace.append([subject, attribute, data, entry_timestamp])
          else:
            to_insert.append([subject, attribute, data, entry_timestamp])
          if attribute in to_delete:
            to_delete.remove(attribute)

        else:
          to_insert.append([subject, attribute, data, entry_timestamp])

    if to_delete:
      self.DeleteAttributes(subject, to_delete)

    if sync:
      if to_replace:
        transaction.extend(self._BuildReplaces(to_replace))
      if to_insert:
        transaction.extend(self._BuildInserts(to_insert))
      if transaction:
        self._ExecuteTransaction(transaction)
    else:
      if to_replace:
        with self.buffer_lock:
          self.to_replace.extend(to_replace)
      if to_insert:
        with self.buffer_lock:
          self.to_insert.extend(to_insert)
1308631
def set(attributes = {})
      attributes.each_pair do |key, value|
        send("#{key}=", value) if respond_to?(key)
      end

      self
    end
323996
public void setAttributes (Attributes atts)
    {
        clear();
        length = atts.getLength();
        if (length > 0) {
            data = new String[length*5];
            for (int i = 0; i < length; i++) {
                data[i*5] = atts.getURI(i);
                data[i*5+1] = atts.getLocalName(i);
                data[i*5+2] = atts.getQName(i);
                data[i*5+3] = atts.getType(i);
                data[i*5+4] = atts.getValue(i);
            }
    }
    }
1094272
def set_value(self, value):
        
        self._value = value
        setattr(self.target, self._name, value)
423436
def set_values(self, values):
        """"""
        self.values = values
        self.height = len(self.values) * 14
        self._max = max(rec[1] for rec in values) if values else dt.timedelta(0)
1060116
def _set_feature(self, name, status):
        """"""
        setattr(self, self._feature_attrname(name), status)
1371146
def set_attrs(self, **attrs):
        """"""
        commands = tuple(self.values())
        for name, value in attrs.items():
            for command in commands:
                setattr(command, name, value)
1247716
def update_attributes(self, **kwargs):
        """"""
        attrs = self.attributes.values() + self.lists.values() \
                + self.references.values()
        for att in attrs:
            if att.name in kwargs:
                att.__set__(self, kwargs[att.name])
762255
public void init(final String name, final short[] values, final int dim_x,
	    final int dim_y) {
		buildAttributeValueObject(name);
		insert(values, dim_x, dim_y);
    }
494650
def set_attributes(values)
      import_indices([values.length - 1, @max_elements - 1].min).each_with_index do |indices, i|
        param = nil
        if indices
          param = values.values_at(*indices)
          param = param[0] if param.length == 1
        end
        self.send("#{@attributes[i]}=", param)
      end
      @crc = values[-1]
    end
480629
def set_attributes(self, **attributes_dict):
        
        for attr_name, attr_value in attributes_dict.items():
            self.set_attr(attr_name, attr_value)
        return self
967508
def set_attributes(node, overwrite=True, **attributes):
    
    aset = node.attrs
    for k, v in attributes.items():
        if not overwrite and k in aset:
            pass
        elif v is None:
            if k in aset:
                del aset[k]
        else:
            aset[k] = v
444227
public void set(String name, Object obj) throws IOException {
        if (name.equalsIgnoreCase(SKIP_CERTS)) {
            if (!(obj instanceof Integer))
                throw new IOException("Attribute value should be of type Integer.");
            int skipCertsValue = ((Integer)obj).intValue();
            if (skipCertsValue < -1)
                throw new IOException("Invalid value for skipCerts");
            if (skipCertsValue == -1) {
                skipCerts = Integer.MAX_VALUE;
            } else {
                skipCerts = skipCertsValue;
            }
        } else
            throw new IOException("Attribute name not recognized by " +
                                  "CertAttrSet:InhibitAnyPolicy.");
        encodeThis();
    }
1156435
private Chunk setAttribute(String name, Object obj) {
		if (attributes == null)
			attributes = new HashMap();
		attributes.put(name, obj);
		return this;
	}
152689
def assign(A, attr, B, lock=False):
    '''
    '''
    class NoAttr(object): pass

    context = threading.Lock if lock else null_context
    with context():
        if not hasattr(A, attr):
            tmp = NoAttr
        else:
            tmp = getattr(A, attr)

        setattr(A, attr, B)

        try:
            yield B

        finally:
            if tmp is NoAttr:
                delattr(A, attr)
            else:
                setattr(A, attr, tmp)
983796
def assign_attributes(attrs, initial_setup = false, skip_changes = false)
      attrs = wrap_values(attrs)

      if attrs
        # When doing a mass-assign, we don't validate or save until the end.
        if initial_setup || skip_changes
          Model.no_change_tracking do
            assign_all_attributes(attrs, skip_changes)
          end
        else
          assign_all_attributes(attrs)
        end
      else
        # Assign to empty
        @attributes = {}
      end

      # Trigger and change all
      @deps.changed_all!
      @deps = HashDependency.new

      run_initial_setup(initial_setup)
    end
1161769
public void setAttribute(String attrname, String value) {
        if (attributes == null)
            attributes = new ArrayList<Attribute>();
        Attribute.setAttribute(attributes, attrname, value);
    }