Output active class attribute.

e.g.: <li class="active">...</li>
421422
public function activeAttr(string $className = ''): string
    {
        if (! $className) {
            $className = config('menus.active_class_name');
        }

        return $this->isActive() ? 'class="' . $className . '"' : '';
    }
72091
def _make_attr_tuple_class(cls_name, attr_names):
    
    attr_class_name = "{}Attributes".format(cls_name)
    attr_class_template = [
        "class {}(tuple):".format(attr_class_name),
        "    __slots__ = ()",
    ]
    if attr_names:
        for i, attr_name in enumerate(attr_names):
            attr_class_template.append(
                _tuple_property_pat.format(index=i, attr_name=attr_name)
            )
    else:
        attr_class_template.append("    pass")
    globs = {"_attrs_itemgetter": itemgetter, "_attrs_property": property}
    eval(compile("\n".join(attr_class_template), "", "exec"), globs)

    return globs[attr_class_name]
801075
def active(self):
        """"""
        # TODO avoid direct usage of transport object.
        marks = tuple(int(x) for x in transport.ask('MACT').split(','))
        return marks[1:]
1270087
function attrsToString(attrs) {
  return Object.keys(attrs)
    .map(key => `${key}="${attrs[key]}"`)
    .join(' ');
}
1203662
def _text_attr(self, attr):
        
        attr = text[attr]
        if attr == "reset":
            self.cursor_attributes = self.default_attributes
        elif attr == "underline-off":
            self.cursor_attributes = self._remove_text_attr("underline")
        elif attr == "blink-off":
            self.cursor_attributes = self._remove_text_attr("blink")
        elif attr == "reverse-off":
            self.cursor_attributes = self._remove_text_attr("reverse")
        else:
            self.cursor_attributes = self._add_text_attr(attr)
31057
def dump(cls):
        
        d = OrderedDict(cls.Items())
        d["__classname__"] = cls.__name__
        for attr, klass in cls.Subclasses():
            d[attr] = klass.dump()
        return OrderedDict([(cls.__name__, d)])
1296703
def attribute_value(attribute_name)
      attribute_name = attribute_name.to_s.tr('_', '-') if attribute_name.is_a?(::Symbol)
      element_call { @element.attribute attribute_name }
    end
334973
def attribute_present?(name)
      attribute = read_raw_attribute(name)
      !attribute.blank? || attribute == false
    rescue ActiveModel::MissingAttributeError
      false
    end
475274
def get_widget_css_class(self, attrs):
        """"""
        size_class = 'size-{0}'.format(self.num_inputs)

        if 'class' in attrs:
            attrs['class'] += ' {0}'.format(size_class)
        else:
            attrs['class'] = size_class
1103674
function (content, index, classes) {
				return '<li' +
				(typeof classes !== 'undefined' ? ' class="' + classes + '"' : '') +
				(typeof index !== 'undefined' | null === index ? ' data-original-index="' + index + '"' : '') +
				'>' + content + '</li>';
			}
882456
def attr(cls, iterable, attr_name):
    

    return cls(getattr(x, attr_name) for x in iterable)
565853
function() {

		var classes = this._renderClasses(),
			style = this._renderStyles(),
			properties_string = '',
			name;

		// see informInDOM_Normal
		// this._element = null;

		for (name in this._static_properties) {

			properties_string += this._renderAttribute(name, this._static_properties[name]);

		}

		for (name in this._property_bindings) {

			properties_string += this._renderAttribute(name, this._property_bindings[name].getValue());

		}

		if (classes) {

			properties_string += ' class="' + classes + '"';

		}

		if (style) {

			properties_string += ' style="' + style + '"';

		}

		return "<" + this._tag_name + " id=\"" + this._id + "\" "
			// + this._writeEvents()
			+ properties_string; //+ ">"

	}
800165
def attributes_source
      @attributes_source ||=
        begin
          _explicit_tag, static_attrs, rest =
            source_code.scan(/\A\s*(%[-:\w]+)?([-:\w\.\#]*)(.*)/m)[0]

          attr_types = {
            '{' => [:hash, %w[{ }]],
            '(' => [:html, %w[( )]],
            '[' => [:object_ref, %w[[ ]]],
          }

          attr_source = { static: static_attrs }
          while rest
            type, chars = attr_types[rest[0]]
            break unless type # Not an attribute opening character, so we're done

            # Can't define multiple of the same attribute type (e.g. two {...})
            break if attr_source[type]

            attr_source[type], rest = Haml::Util.balance(rest, *chars)
          end

          attr_source
        end
    end
1201363
def attributes(attrs):
    
    attrs = attrs or {}
    ident = attrs.get("id", "")
    classes = attrs.get("classes", [])
    keyvals = [[x, attrs[x]] for x in attrs if (x != "classes" and x != "id")]
    return [ident, classes, keyvals]
1295682
function getAttributeType (name, isDirective) {
  if (isDirective) {
    if (name === 'for') {
      return 'LIST_RENDERING'
    } else if (name === 'if' || name === 'else-if' || name === 'else' || name === 'show' || name === 'cloak') {
      return 'CONDITIONALS'
    } else if (name === 'pre' || name === 'once') {
      return 'RENDER_MODIFIERS'
    } else if (name === 'model') {
      return 'TWO_WAY_BINDING'
    } else if (name === 'on') {
      return 'EVENTS'
    } else if (name === 'html' || name === 'text') {
      return 'CONTENT'
    } else {
      return 'OTHER_ATTR'
    }
  } else {
    if (name === 'is') {
      return 'DEFINITION'
    } else if (name === 'id') {
      return 'GLOBAL'
    } else if (name === 'ref' || name === 'key' || name === 'slot') {
      return 'UNIQUE'
    } else {
      return 'OTHER_ATTR'
    }
  }
}
821035
def get_input_column_attributes(self, extra_classes=None):
        
        all_classes = []
        css_class = self.input_column_class
        if css_class:
            all_classes.append(css_class)
        if extra_classes:
            all_classes.append(extra_classes)

        style = self.input_column_style
        parts = []

        if all_classes:
            parts.append('class="{}"'.format(' '.join(all_classes)))

        if style:
            parts.append('style="{}"'.format(style))

        return Markup(' '.join(parts))
742825
def attr_name(model, attr, suffix: nil)
      klass = model.is_a?(Class) ? model : model.class
      klass.human_attribute_name(attr) + String(suffix)
    end