Returns an attribute list, constructed from the dictionary attrs.
@param  {Object} attrs Attribute dictionary
@return {Array}        Attribute list
322499
function attributes(attrs) {
  attrs = attrs || {};
  var ident = attrs.id || '';
  var classes = attrs.classes || [];
  var keyvals = [];
  Object.keys(attrs).forEach(function (k) {
    if (k !== 'classes' && k !== 'id') keyvals.push([k,attrs[k]]);
  });
  return [ident, classes, keyvals];
}
781192
function (attributes) {
            var self = this;
            var retVal = {};
            var ctxMappings = {};
             _.each(attributes, function (attribute, k) {
                var isCtxMapping = _.isString(attribute) && !attribute.indexOf('$');
                if (isCtxMapping) {
                    ctxMappings[k] = attribute;
                } else {
                    retVal[k] = attribute;
                }

                return isCtxMapping;
            });

            _.each(ctxMappings, function (val, k) {
                self._resolveCtxVal(retVal, val, k);
            });

            return retVal;
        }
911019
def _attribute_definition(self, attrid):
        
        attrs = self._schema["attributes"]

        try:
            # Make a new dict to avoid side effects
            return dict(attrs[attrid])
        except KeyError:
            attr_names = self._schema["attribute_names"]
            attrdef = attrs.get(attr_names.get(str(attrid).lower()))

            if not attrdef:
                return None
            else:
                return dict(attrdef)
303549
def attr_names(cls) -> List[str]:
        
        return [k for k, v in cls.attr_types().items()]
127608
def attributes(*attributes)
      attributes.each do |attr|
        raise ArgumentError.new("You cannot use #{attr} as an attribute name since it is a reserved method name of Xapian::Document") if reserved_method_name?(attr)
        @attributes_hash[attr] = {}
        @type_map[attr] = :string
        self.index attr
      end
    end
1250869
def get_complex_attrs(self):
        ''''''
        return [getattr(self, attr_name) for attr_name in self._attributes if
                isinstance(getattr(self, attr_name), ComplexSchemaItem)]
1283268
function extractAttributes(attrSet) {
		var reAttrName = /^[\w\-:\$@]+\.?$/;
		return splitAttributes(attrSet).map(function(attr) {
			// attribute name: [attr]
			if (reAttrName.test(attr)) {
				var value = '';
				if (attr.charAt(attr.length - 1) == '.') {
					// a boolean attribute
					attr = attr.substr(0, attr.length - 1);
					value = attr;
				}
				return {
					name: attr,
					value: value
				};
			}

			// attribute with value: [name=val], [name="val"]
			if (~attr.indexOf('=')) {
				var parts = attr.split('=');
				return {
					name: parts.shift(),
					value: unquote(parts.join('='))
				};
			}

			// looks like it’s implied attribute
			return {
				name: DEFAULT_ATTR_NAME,
				value: unquote(attr)
			};
		});
	}
150513
def _transform_attrs(cls, these, auto_attribs, kw_only):
    
    cd = cls.__dict__
    anns = _get_annotations(cls)

    if these is not None:
        ca_list = [(name, ca) for name, ca in iteritems(these)]

        if not isinstance(these, ordered_dict):
            ca_list.sort(key=_counter_getter)
    elif auto_attribs is True:
        ca_names = {
            name
            for name, attr in cd.items()
            if isinstance(attr, _CountingAttr)
        }
        ca_list = []
        annot_names = set()
        for attr_name, type in anns.items():
            if _is_class_var(type):
                continue
            annot_names.add(attr_name)
            a = cd.get(attr_name, NOTHING)
            if not isinstance(a, _CountingAttr):
                if a is NOTHING:
                    a = attrib()
                else:
                    a = attrib(default=a)
            ca_list.append((attr_name, a))

        unannotated = ca_names - annot_names
        if len(unannotated) > 0:
            raise UnannotatedAttributeError(
                "The following `attr.ib`s lack a type annotation: "
                + ", ".join(
                    sorted(unannotated, key=lambda n: cd.get(n).counter)
                )
                + "."
            )
    else:
        ca_list = sorted(
            (
                (name, attr)
                for name, attr in cd.items()
                if isinstance(attr, _CountingAttr)
            ),
            key=lambda e: e[1].counter,
        )

    own_attrs = [
        Attribute.from_counting_attr(
            name=attr_name, ca=ca, type=anns.get(attr_name)
        )
        for attr_name, ca in ca_list
    ]

    base_attrs = []
    base_attr_map = {}  # A dictionary of base attrs to their classes.
    taken_attr_names = {a.name: a for a in own_attrs}

    # Traverse the MRO and collect attributes.
    for base_cls in cls.__mro__[1:-1]:
        sub_attrs = getattr(base_cls, "__attrs_attrs__", None)
        if sub_attrs is not None:
            for a in sub_attrs:
                prev_a = taken_attr_names.get(a.name)
                # Only add an attribute if it hasn't been defined before.  This
                # allows for overwriting attribute definitions by subclassing.
                if prev_a is None:
                    base_attrs.append(a)
                    taken_attr_names[a.name] = a
                    base_attr_map[a.name] = base_cls

    attr_names = [a.name for a in base_attrs + own_attrs]

    AttrsClass = _make_attr_tuple_class(cls.__name__, attr_names)

    if kw_only:
        own_attrs = [a._assoc(kw_only=True) for a in own_attrs]
        base_attrs = [a._assoc(kw_only=True) for a in base_attrs]

    attrs = AttrsClass(base_attrs + own_attrs)

    had_default = False
    was_kw_only = False
    for a in attrs:
        if (
            was_kw_only is False
            and had_default is True
            and a.default is NOTHING
            and a.init is True
            and a.kw_only is False
        ):
            raise ValueError(
                "No mandatory attributes allowed after an attribute with a "
                "default value or factory.  Attribute in question: %r" % (a,)
            )
        elif (
            had_default is False
            and a.default is not NOTHING
            and a.init is not False
            and
            # Keyword-only attributes without defaults can be specified
            # after keyword-only attributes with defaults.
            a.kw_only is False
        ):
            had_default = True
        if was_kw_only is True and a.kw_only is False and a.init is True:
            raise ValueError(
                "Non keyword-only attributes are not allowed after a "
                "keyword-only attribute (unless they are init=False).  "
                "Attribute in question: {a!r}".format(a=a)
            )
        if was_kw_only is False and a.init is True and a.kw_only is True:
            was_kw_only = True

    return _Attributes((attrs, base_attrs, base_attr_map))
58572
def _filter_attrs(attrs, ignored_attrs):
    
    return dict((k, v) for k, v in attrs.items() if k not in ignored_attrs)
179336
def _get_attrs(self, names):
        
        assert isinstance(names, str)
        names = names.replace(",", " ").split(" ")
        res = []
        for n in names:
            if n == "":
                continue
            if n not in self.__dict__:
                raise KeyError("Unknown name for Container attribute: '{}'".format(n))
            res.append(getattr(self, n))
        return res
81597
function getAttribs(node) {
          var attribs = {};

          each(dom.getAttribs(node), function (attr) {
            var name = attr.nodeName.toLowerCase();

            // Don't compare internal attributes or style
            if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
              attribs[name] = dom.getAttrib(node, name);
            }
          });

          return attribs;
        }
94112
function removeAttrsValues(attrs, ignoreAttributes) {
    _.forEach(ignoreAttributes, function (attr) {
        var attrIndexes = _getIndexesInArray(attrs, attr);

        _.forEach(attrIndexes, function (index) {
            attrs[index].value = '';
        });
    });

    return attrs;
}
1270087
function attrsToString(attrs) {
  return Object.keys(attrs)
    .map(key => `${key}="${attrs[key]}"`)
    .join(' ');
}
921682
function() {
    var attrs = {};
    for(var key in this) {
      if (key.charAt(0) === '_') continue;
      if (typeof this[key] === 'function') continue;
      if (!this.hasOwnProperty(key)) continue;
      attrs[key] = this.get(key);
    }
    return attrs;
  }
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)
626189
function defaultAttrs(attrs) {
  let defaults = Object.create(null)
  for (let attrName in attrs) {
    let attr = attrs[attrName]
    if (!attr.hasDefault) return null
    defaults[attrName] = attr.default
  }
  return defaults
}
322111
def get_attr(attr_list, global_attrs):
    
    local_attr = [], {}
    for kv in attr_list:
        keyword = kv[0]
        if len(kv) == 1:
            local_attr[0].append(keyword)
            continue
        elif len(kv) == 2:
            value = kv[1]
        elif len(kv) > 2:
            value = kv[1:]

        if keyword == 'tag':
            local_attr[1].setdefault(keyword, set()).add(value)
        else:
            local_attr[1][keyword] = value

    attr0 = copy.copy(global_attrs[0])
    attr1 = copy.copy(global_attrs[1])

    if local_attr[0]:
        attr0.extend(local_attr[0])

    if local_attr[1]:
        attr1.update(local_attr[1])

    return attr0, attr1