Overwrite attrKV
424089
function (key, value) {
        // FIXME
        if (key === 'shape') {
            this.setShape(value);
            this.__dirtyPath = true;
            this._rect = null;
        }
        else {
            Displayable.prototype.attrKV.call(this, key, value);
        }
    }
20219
def update_attributes(atts)
      atts.delete('_type')
      atts.each { |att, val| send(:"#{att}=", val) }
    end
1241868
def attr(key, value=None):
    '''
    
    '''
    key = target(key)

    if key is False:
        return False
    elif os.path.isdir(key):
        return key
    elif value is not None:
        return write(key, value)
    else:
        return read(key)
81117
private void appendAttribute(Appendable buf, String attrName, String encodedValue) throws IOException {
        buf.append(' ').append(attrName).append('=').append('\"').append(encodedValue).append('\"');
    }
406186
def inject_from!( dependencies, overwrite = false )
        injected_attributes.each do |attr|
          next unless dependencies.key? attr.name
          val = dependencies.delete( attr.name )

          if overwrite || !send( "#{ attr.name }?" )
            send( "#{ attr.name }=", val )
          end
        end

        dependencies
      end
213891
function(attr) {
      var startIndex, newAttr,
        i = 0,
        hasEndBracket = true;
      startIndex = attr.indexOf('[', i);
      if (startIndex < 0) {
        return attr;
      }
      newAttr = attr.substring(0, startIndex + 1);
      while (startIndex > 0 && hasEndBracket) {
         i = attr.indexOf(']', i) + 1;
         hasEndBracket = i > 0;
         startIndex = attr.indexOf('[', i);
         if (startIndex > 0) {
           newAttr = newAttr + attr.substring(i - 1, startIndex + 1);
         }
      }
      newAttr = newAttr + attr.substring(i - 1);
      return newAttr;
    }
1257046
def add_attrs(self, *args, _order=[], **kwargs):
        
        for arg in args:
            if isinstance(arg, (tuple, list)):
                key, color = arg
                self.attrs[key] = (None, color)
            else:
                self.attrs[arg] = (None, None)
        if not _order:
            for key, value in kwargs.items():
                self.attrs[key] = (value, None)
        else:
            for key in _order:
                self.attrs[key] = (kwargs[key], None)
710523
function (attrName, attrVal) {
            if (!attrName) {
                delete this.attrs;
                return;
            }
            if(!this.attrs){
                this.attrs = {};
            }
            if (utils.isObject(attrName)) {
                for (var a in attrName) {
                    if (!attrName[a]) {
                        delete this.attrs[a]
                    } else {
                        this.attrs[a.toLowerCase()] = attrName[a];
                    }
                }
            } else {
                if (!attrVal) {
                    delete this.attrs[attrName]
                } else {
                    this.attrs[attrName.toLowerCase()] = attrVal;
                }

            }
        }
705069
def set_attrs(self, **attrs):
        """"""
        self.attrs.update(attrs)
        self._backend.set_attrs(**attrs)
742348
def update_config! attr, val
      Execute.task_popen3(*override_a, "config #{attr} #{val}") do |i, o, e, t|
        return t.value
      end
    end
323743
def set_attr(self, **kwargs):
        
        for key, value in kwargs.items():
            if value is not None:
                if not isinstance(value, STRING_TYPES):
                    raise ValueError("Set Attr only accepts string values")
                value = c_str(str(value))
            _check_call(_LIB.XGBoosterSetAttr(
                self.handle, c_str(key), value))
884523
def restore_attr(self, attr_name):
        
        original_attr = self._original_attr(attr_name)
        if self._original_attr(attr_name):
            setattr(self.obj.__class__, attr_name, original_attr)
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
884285
def update_attributes(self, **original_kwargs):
        
        def update_attrs(layout_object):
            kwargs = original_kwargs.copy()
            if hasattr(layout_object, 'attrs'):
                if 'css_class' in kwargs:
                    if 'class' in layout_object.attrs:
                        layout_object.attrs['class'] += " %s" % kwargs.pop('css_class')
                    else:
                        layout_object.attrs['class'] = kwargs.pop('css_class')
                layout_object.attrs.update(kwargs)

        self.map(update_attrs)
373923
def overwrite(self, mesh):
        
        self.DeepCopy(mesh)
        if is_vtki_obj(mesh):
            self.copy_meta_from(mesh)
466948
def to_attrs(args, nocreate_if_none=['id', 'for', 'class']):
    
    if not args:
        return ''
    s = ['']
    for k, v in sorted(args.items()):
        k = u_str(k)
        v = u_str(v)
        if k.startswith('_'):
            k = k[1:]
        if v is None:
            if k not in nocreate_if_none:
                s.append(k)
        else:
            if k.lower() in __noescape_attrs__:
                t = u_str(v)
            else:
                t = cgi.escape(u_str(v))
            t = '"%s"' % t.replace('"', '&quot;')
            s.append('%s=%s' % (k, t))
    return ' '.join(s)
983822
def update(self, attrs):
        """"""
        ########################################################################
        def convertStrToDict(strVal):
            if isinstance(strVal, dict): return strVal
            strVal = re.sub("[\{\}]+", "", str(strVal))
            regexCol = re.compile(":")
            terms = re.split("[,\s]+", strVal)
            keyvals = [re.split(regexCol, t) for t in terms]
            x = re.compile("['\"]")
            ret = {}
            boolTrue  = re.compile("true" , flags=re.IGNORECASE)
            boolFalse = re.compile("false", flags=re.IGNORECASE)
            for k, v in keyvals:
                k = re.sub(x, "", k)
                v = re.sub(x, "", v)
                if   re.search(boolTrue, v):    v = True
                elif re.search(boolFalse, v):   v = False
                else:
                    if '.' in v:
                        try:                    v = float(v)
                        except:                 pass
                    else:
                        try:                    v = int(v)
                        except:                 pass
                ret[k] = v
            return ret
        ########################################################################
        self._validateAttrs(attrs)
        for k,v in iteritems(attrs):
            typecast = type( getattr(self, k) )
            if typecast==bool and v=="False":   newval = False # "False" evalued as boolean is True because its length > 0
            elif issubclass(typecast, c.RestrictedType): # let the RestrictedType handle the type setting, value matching
                                                newval = typecast(v)
            elif "<" in str(v) or v==None:      newval = typecast(v)
            elif k == "initCmd":                newval = str(v) # specifically don't mangle the command as specified
            elif k == "initOptions":            newval = convertStrToDict(v)
            else:                               newval = typecast(str(v).lower())
            setattr(self, k, newval)
        if self.isComputer: pass
        elif "difficulty" in attrs and attrs["difficulty"]!=None: # the final state of this PlayerRecord cannot be a non-computer and specify a difficulty
            raise ValueError("%s type %s=%s does not have a difficulty"%(
                self.__class__.__name__, self.type.__class__.__name__, self.type.type))
        else: self.difficulty = c.ComputerDifficulties(None)