redact the value of an attribute
548701
def retract(self, e, a, v):
    
    ta = datetime.datetime.now()
    ret = u"[:db/retract %i :%s %s]" % (e, a, dump_edn_val(v))
    rs = self.tx(ret)
    tb = datetime.datetime.now() - ta
    print cl('<<< retracted %s,%s,%s in %sms' % (e,a,v, tb.microseconds/1000.0), 'cyan')
    return rs
998577
public void renameNodesWithAttributeValue(String oldName, String newName, String attributeName, String attributeValue) {
		List<Node> nodes = getNodesFromTreeByName(oldName);
		Iterator i = nodes.iterator();
		while (i.hasNext()) {
			Node n = (Node) i.next();
			n.setName(newName);
		}
	}
502779
def update_attr(self, attr):
        
        changed_attr = []
        for key, value in attr.items():
            if value is None:
                continue
            if getattr(self, "_{0}".format(key), None) != value:
                changed_attr.append(key)
                self.__setattr__("_{0}".format(key), value)
                _LOGGER.debug('%s: update %s with %s', self.name, key, value)
        return changed_attr
784
def setattrdeep(obj, attr, val):
    ''
    attrs = attr.split('.')

    for a in attrs[:-1]:
        obj = getattr(obj, a)
    setattr(obj, attrs[-1], val)
1019683
def DeleteAttribute(self, attribute):
    """"""
    if "w" not in self.mode:
      raise IOError("Deleting attribute %s from read only object." % attribute)

    # Check if this object should be locked in order to delete the attribute.
    # NOTE: We don't care about locking when doing blind writes.
    if self.mode != "w" and attribute.lock_protected and not self.transaction:
      raise IOError("Object must be locked to delete attribute %s." % attribute)

    if attribute in self.synced_attributes:
      self._to_delete.add(attribute)
      del self.synced_attributes[attribute]

    if attribute in self.new_attributes:
      del self.new_attributes[attribute]

    # Does this represent a new version?
    if attribute.versioned and attribute.creates_new_object_version:
      self._new_version = True

    self._dirty = True
81117
private void appendAttribute(Appendable buf, String attrName, String encodedValue) throws IOException {
        buf.append(' ').append(attrName).append('=').append('\"').append(encodedValue).append('\"');
    }
198774
def remove_attribute(self, attribute: str) -> None:
        
        attr_index = self.__attr_index(attribute)
        if attr_index is not None:
            self.yaml_node.value.pop(attr_index)
932608
def serialize_attribute(name,value)
    attr_value = value
    attr_type  = attr_type_for(name) 
    case attr_type
    when :bool
      attr_value = 0
      attr_value = 1 if value
    when :datetime, :datetimecombo
      begin
        attr_value = value.strftime("%Y-%m-%d %H:%M:%S")
      rescue
        attr_value = value
      end
    when :int
      attr_value = value.to_s
    end
    {:name => name, :value => attr_value}
  end
356701
def _get_template_attr(self, attr):
        '''
        '''

        attr_re = r'{0}\s+.*'.format(attr)

        attr_found = re.search(attr_re, self.template_str)
        if attr_found:
            attr_value = attr_found.group(0).replace(attr, '', 1)
            return attr_value.strip()
928951
function(attr, options) {
      if (!(attr in this.attributes)) return this;
      options || (options = {});
      var value = this.attributes[attr];

      // Run validation.
      var validObj = {};
      validObj[attr] = void 0;
      if (!options.silent && this.validate && !this._performValidation(validObj, options)) return false;

      // Remove the attribute.
      delete this.attributes[attr];
      delete this._escapedAttributes[attr];
      if (attr == this.idAttribute) delete this.id;
      this._changed = true;
      if (!options.silent) {
        this.trigger('change:' + attr, this, void 0, options);
        this.change(options);
      }
      return this;
    }
193754
function(value, attr) {
          if (!self._pending[attr] && !self._silent[attr]) {
            delete self.changed[attr];
          }
        }
1011684
def do_attr(environment, obj, name):
    
    try:
        name = str(name)
    except UnicodeError:
        pass
    else:
        try:
            value = getattr(obj, name)
        except AttributeError:
            pass
        else:
            if environment.sandboxed and not \
               environment.is_safe_attribute(obj, name, value):
                return environment.unsafe_undefined(obj, name)
            return value
    return environment.undefined(obj=obj, name=name)
154086
def _unparse_attr(self, attr_type, attr_value):
        """"""
        if self._needs_base64_encoding(attr_type, attr_value):
            if not isinstance(attr_value, bytes):
                attr_value = attr_value.encode(self._encoding)
            encoded = base64.encodestring(attr_value)\
                .replace(b'\n', b'')\
                .decode('ascii')
            line = ':: '.join([attr_type, encoded])
        else:
            line = ': '.join([attr_type, attr_value])
        self._fold_line(line.encode('ascii'))
1261970
def safeEncodeAttribute(self, encValue):
		""""""
		encValue = encValue.replace(u'&', u'&amp;')
		encValue = encValue.replace(u'<', u'&lt;')
		encValue = encValue.replace(u'>', u'&gt;')
		encValue = encValue.replace(u'"', u'&quot;')
		encValue = encValue.replace(u'{', u'&#123;')
		encValue = encValue.replace(u'[', u'&#91;')
		encValue = encValue.replace(u"''", u'&#39;&#39;')
		encValue = encValue.replace(u'ISBN', u'&#73;SBN')
		encValue = encValue.replace(u'RFC', u'&#82;FC')
		encValue = encValue.replace(u'PMID', u'&#80;MID')
		encValue = encValue.replace(u'|', u'&#124;')
		encValue = encValue.replace(u'__', u'&#95;_')
		encValue = encValue.replace(u'\n', u'&#10;')
		encValue = encValue.replace(u'\r', u'&#13;')
		encValue = encValue.replace(u'\t', u'&#9;')
		return encValue
292868
def reset_attribute!(name)
      value = attribute_was(name)
      if value
        @attributes[name] = value
        modifications.delete(name)
      end
    end
698027
function condenseDataAttrs(attrs) {
		var out = [], data = null;
		var reData = /^data-/i;
		attrs.forEach(function(attr) {
			if (reData.test(attr.name)) {
				if (!data) {
					data = [];
					out.push({
						name: 'data',
						value: data
					});
				}

				data.push(utils.extend({}, attr, {name: attr.name.replace(reData, '')}));
			} else {
				out.push(attr);
			}
		});

		return out;
	}
30898
def value_attr(attr_name):
    

    def value_attr(value, context, **_params):
        value = getattr(value, attr_name)
        return _attr(value)

    return value_attr