Render a I{multiple} attribute on the given tag if the wrapped
        L{ChoiceParameter} instance allows multiple selection.
963838
def multiple(self, request, tag):
        
        if self.parameter.multiple:
            tag(multiple='multiple')
        return tag
651197
def render_open_tag options
      out = '<' + tag_name
      unless attributes.empty?
        attributes.each do |name,value|
          name = name.to_s.gsub('_', '-') if name.is_a? Symbol
          value = value.to_s.gsub('_', '-') if value.is_a? Symbol

          case value
          when false
            next
          when true
            if options[:format] == Rxhp::XHTML_FORMAT
              out += ' ' + name + '="' + name + '"'
            else
              out += ' ' + name
            end
          else
            out += ' ' + name.to_s + '="' + html_escape(value.to_s) + '"'
          end
        end
      end

      if options[:format] == Rxhp::XHTML_FORMAT && !children?
        out + ' />'
      else
        out + '>'
      end
    end
1044200
def render(self, name, value, attrs=None, renderer=None):
        
        output = [super(TagAutoComplete, self).render(name, value, attrs)]
        output.append('<script type="text/javascript">')
        output.append('(function($) {')
        output.append('  $(document).ready(function() {')
        output.append('    $("#id_%s").select2({' % name)
        output.append('       width: "element",')
        output.append('       maximumInputLength: 50,')
        output.append('       tokenSeparators: [",", " "],')
        output.append('       tags: %s' % json.dumps(self.get_tags()))
        output.append('     });')
        output.append('    });')
        output.append('}(django.jQuery));')
        output.append('</script>')
        return mark_safe('\n'.join(output))
432634
def render( self, tag, single, between, kwargs ):
        """"""

        out = "<%s" % tag
        for key, value in list( kwargs.items( ) ):
            if value is not None:               # when value is None that means stuff like <... checked>
                key = key.strip('_')            # strip this so class_ will mean class, etc.
                if key == 'http_equiv':         # special cases, maybe change _ to - overall?
                    key = 'http-equiv'
                elif key == 'accept_charset':
                    key = 'accept-charset'
                out = "%s %s=\"%s\"" % ( out, key, escape( value ) )
            else:
                out = "%s %s" % ( out, key )
        if between is not None:
            out = "%s>%s</%s>" % ( out, between, tag )
        else:
            if single:
                out = "%s />" % out
            else:
                out = "%s>" % out
        if self.parent is not None:
            self.parent.content.append( out )
        else:
            return out
1145713
private void paintSelectionDetails(final WTable table, final XmlStringBuilder xml) {
		boolean multiple = table.getSelectMode() == SelectMode.MULTIPLE;
		xml.appendTagOpen("ui:rowselection");
		xml.appendOptionalAttribute("multiple", multiple, "true");

		boolean toggleSubRows = multiple && table.isToggleSubRowSelection()
				&& WTable.ExpandMode.NONE != table.getExpandMode();
		xml.appendOptionalAttribute("toggle", toggleSubRows, "true");
		if (multiple) {
			switch (table.getSelectAllMode()) {
				case CONTROL:
					xml.appendAttribute("selectAll", "control");
					break;
				case TEXT:
					xml.appendAttribute("selectAll", "text");
					break;
				case NONE:
					break;
				default:
					throw new SystemException("Unknown select-all mode: " + table.
							getSelectAllMode());
			}
		}
		xml.appendEnd();
	}
39665
function select(bind, el, param, value) {
  var node = element('select', {name: param.signal});

  param.options.forEach(function(option) {
    var attr = {value: option};
    if (valuesEqual(option, value)) attr.selected = true;
    node.appendChild(element('option', attr, option+''));
  });

  el.appendChild(node);

  node.addEventListener('change', function() {
    bind.update(param.options[node.selectedIndex]);
  });

  bind.elements = [node];
  bind.set = function(value) {
    for (var i=0, n=param.options.length; i<n; ++i) {
      if (valuesEqual(param.options[i], value)) {
        node.selectedIndex = i; return;
      }
    }
  };
}
1021967
def select(select, tag, namespaces=None, limit=0, flags=0, **kwargs):
    """"""

    return compile(select, namespaces, flags, **kwargs).select(tag, limit)
174028
def inclusion_tag(self, name, context_class=Context, takes_context=False):
        
        def tag_decorator(tag_func):

            @wraps(tag_func)
            def tag_wrapper(parser, token):

                class InclusionTagNode(template.Node):

                    def render(self, context):
                        if not getattr(self, "nodelist", False):
                            try:
                                request = context["request"]
                            except KeyError:
                                t = get_template(name)
                            else:
                                ts = templates_for_device(request, name)
                                t = select_template(ts)

                            self.template = t
                        parts = [template.Variable(part).resolve(context)
                                 for part in token.split_contents()[1:]]
                        if takes_context:
                            parts.insert(0, context)
                        result = tag_func(*parts)
                        autoescape = context.autoescape
                        context = context_class(result, autoescape=autoescape)
                        return self.template.render(context)

                return InclusionTagNode()
            return self.tag(tag_wrapper)
        return tag_decorator
46275
function elem(tagName) {
    if (!utils.isString(tagName)) {
        return null;
    }

    // element at the very least has name and fn to render itself
    var e = {
        tag: tagName
    };

    // add other values to the element based on the input argument
    if (arguments.length > 1) {
        for (var i = 1, len = arguments.length; i < len; ++i) {
            var arg = arguments[i];

            if (utils.isArray(arg)) {
                if (e.children && e.children.length) {
                    e.children = e.children.concat(arg);
                }
                else {
                    e.children = arg;
                }
            }
            else if (utils.isObject(arg) && arg.hasOwnProperty('tag')) {
                e.children = e.children || [];
                e.children.push(arg);
            }
            else if (utils.isObject(arg) && arg.tag && arg.toString) {
                e.children = [arg];
            }
            else if (utils.isObject(arg)) {
                e.attributes = arg;
            }
            else if (utils.isString(arg)) {
                e.text = arg;
            }
        }
    }

    return e;
}
671655
def html_attribute_value(self, tag: str = None,
                             attribute: str = None) -> str:
        
        if not tag:
            tag = self.random.choice(
                list(HTML_CONTAINER_TAGS.keys()),
            )
        if not attribute:
            attribute = self.random.choice(
                list(HTML_CONTAINER_TAGS[tag]),  # type: ignore
            )

        try:
            value = HTML_CONTAINER_TAGS[tag][attribute]  # type: ignore
        except KeyError:
            raise NotImplementedError(
                'Tag {} or attribute {} is not supported'.format(
                    tag, attribute))

        if isinstance(value, list):
            value = self.random.choice(value)
        elif value == 'css':
            value = self.css_property()
        elif value == 'word':
            value = self.__text.word()
        elif value == 'url':
            value = self.__inet.home_page()
        else:
            raise NotImplementedError(
                'Attribute type {} is not implemented'.format(value))
        return value
1023465
function TagsInput(element, options) {
    this.isInit = true;
    this.itemsArray = [];

    this.$element = $(element);
    this.$element.hide();

    this.isSelect = (element.tagName === 'SELECT');
    this.multiple = (this.isSelect && element.hasAttribute('multiple'));
    this.objectItems = options && options.itemValue;
    this.placeholderText = element.hasAttribute('placeholder') ? this.$element.attr('placeholder') : '';
    this.inputSize = Math.max(1, this.placeholderText.length);

    this.$container = $('<div class="bootstrap-tagsinput"></div>');
    this.$input = $('<input type="text" placeholder="' + this.placeholderText + '"/>').appendTo(this.$container);

    this.$element.before(this.$container);

    this.build(options);
    this.isInit = false;
  }
289215
def value
      case tag_name
      when "select"
        if self[:multiple]
          selected_options.map { |option| option.value }
        else
          selected_option = @_node.selected_options.first
          selected_option ? Node.new(selected_option).value : nil
        end
      when "option"
        self[:value] || text
      when "textarea"
        @_node.getText
      else
        self[:value]
      end
    end
769874
function render(element, opts) {
    opts = opts || {};

    var prepend = opts.prepend;
    var model = opts.model || {};
    var indentLevel = opts.indentLevel || 0;
    var isPretty = opts.isPretty;
    var jtPrintIndent = isPretty ? '\t' : '';
    var jtPrintNewline = isPretty ? '\n' : '';
    var indent = '', i, len, prop;
    var p = [];  // p is going to be our concatenator for the HTML string

    // if no element, then no HTML so return empty string
    if (!element) { return ''; }

    // if already a string, just return it
    if (utils.isString(element)) { return element; }

    // if an array, wrap it
    if (utils.isArray(element)) { element = naked(element, null); }

    // set the indentation level to the current indent
    if (isPretty && indentLevel) {
        for (i = 0; i < indentLevel; i++) {
            indent += jtPrintIndent;
        }
    }

    // if we are prepending some string, add it first
    if (prepend) {
        p.push(indent, prepend, jtPrintNewline);
    }

    // starting tag open
    if (element.tag) {
        p.push(indent, '<', element.tag);
    }

    // all tag attributes
    if (element.attributes) {
        for (prop in element.attributes) {
            if (element.attributes.hasOwnProperty(prop)) {

                if (element.attributes[prop] === null) {
                    p.push(' ', prop);
                }
                else {
                    p.push(' ', prop, '="', element.attributes[prop], '"');
                }
            }
        }
    }

    // if no children or text, then close the tag
    if (element.tag && !element.children && (element.text === undefined || element.text === null)) {

        // for self closing we just close it, else we add the end tag
        if (selfClosing.indexOf(element.tag) > -1) {
            p.push('/>', jtPrintNewline);
        }
        else {
            p.push('></', element.tag, '>', jtPrintNewline);
        }
    }
    // else we need to add children or the inner text
    else {

        // if a tag (i.e. not just a string literal) put end bracket
        if (element.tag) { p.push('>'); }

        // if children, we will need to recurse
        if (element.children) {
            if (element.tag) { p.push(jtPrintNewline); }

            // recurse down for each child
            for (i = 0, len = element.children.length; i < len; ++i) {
                p.push(render(element.children[i], {
                    indentLevel:    element.tag ? indentLevel + 1 : indentLevel,
                    isPretty:       isPretty,
                    model:          model
                }));
            }

            if (element.tag) { p.push(indent); }
        }

        // if text, simply add it
        if (element.text !== null && element.text !== undefined) { p.push(element.text); }

        // finally if a tag, add close tag
        if (element.tag) {
            p.push('</', element.tag, '>', jtPrintNewline);
        }
    }

    return p.join('');
}
608800
function getElAttributes(tag,attr) {
        var obj, knownBooleans, attrs, attrName, attrVal;

        obj = {};

        // known boolean attributes
        // we can check for matching boolean properties, but older browsers
        // won't know about HTML5 boolean attributes that we still read from
        knownBooleans = ',' + 'autoplay,controls,loop,muted,default' + ',';

        if (tag && tag.attributes && tag.attributes.length > 0) {
            attrs = tag.attributes;

            for (var i = attrs.length - 1; i >= 0; i--) {
                attrName = attrs[i].name;
                attrVal = attrs[i].value;

                // check for known booleans
                // the matching element property will return a value for typeof
                if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) {
                    // the value of an included boolean attribute is typically an empty
                    // string ('') which would equal false if we just check for a false value.
                    // we also don't want support bad code like autoplay='false'
                    attrVal = (attrVal !== null) ? true : false;
                }

                if(attr && attrName == attr){
                    return attrVal;
                }

                obj[attrName] = attrVal;
            }
        }
        if(attr && typeof attr == 'string'){
            return tag[attr];
        }
        return obj;
    }
221453
protected void renderOptions(FacesContext context, ResponseWriter rw, String[] selectedOption, SelectMultiMenu menu)
			throws IOException {
		Converter converter = menu.getConverter();
		List<SelectItemAndComponent> items = SelectItemUtils.collectOptions(context, menu, converter);

		for (int index = 0; index < items.size(); index++) {
			Object option = items.get(index).getSelectItem();
			if (option instanceof SelectItem) {
				renderOption(rw, (SelectItem) option, selectedOption, index);
			} else {
				renderOption(rw, (UISelectItem) option, selectedOption, index);
			}
		}
	}
279228
function (tagName, tagAttributes) {
    if (this._done) {
      return;
    }

    this._openElementStack.push(tagName);

    try {
      this._errorIfUnexpectedTag(tagName);

      for (var attributeName in tagAttributes) {
        var attributeValue = tagAttributes[attributeName];

        this._errorIfUnexpectedAttribute(tagName, attributeName);
        this._errorIfUnexpectedAttributeValue(tagName, attributeName, attributeValue);
      }
    } catch (err) {
      this._finish(err);
    }
  }
185627
def render_js_code(self, id_, *args, **kwargs):
        """"""
        if id_:
            options = self.render_select2_options_code(
                    dict(self.get_options()), id_)
            return mark_safe(self.html.format(id=id_, options=options))
        return u''