(HTML) formatted item for display in the dropdown
9907
def format_match(self, obj):
        
        result = [escape(obj.name)]

        if obj.description:
            result.append(escape(obj.description))

        return " ".join(result)
871581
private function formatItem( $item ) {

		$is_link  = isset( $item['url'] );
		$attr     = [];
		$esc_attr = '';

		// Add the anchor/span class attribute.
		$attr['class'] = sprintf(
			$this->args['anchor_class'],
			$is_link ? 'link' : $item['type']
		);

		// If this is a link, add the URL.
		if ( $is_link ) {
			$attr['href'] = $item['url'];
		}

		// If this is the current item, add the `aria-current` attribute.
		if ( 'current' === $item['type'] ) {
			$attr['aria-current'] = $this->args['aria_current'];
		}

		// Loop through the attributes and format them into a string.
		foreach ( $attr as $name => $value ) {

			$esc_attr .= sprintf(
				' %s="%s"',
				esc_html( $name ),
				'href' === $name ? esc_url( $value ) : esc_attr( $value )
			);
		}

		// Builds and formats the list item.
		return sprintf(
			'<%1$s class="%2$s"><%3$s %4$s>%5$s</%3$s></%1$s>',
			tag_escape( $this->args['item_tag'] ),
			esc_attr( sprintf( $this->args['item_class'], $item['type'] ) ),
			$is_link ? 'a' : 'span',
			trim( $esc_attr ),
			$item['content']
		);
	}
67886
function(options) {
        var thead = $('<thead><tr></tr></thead><tbody></tbody>'),
            column = options.column,
            columnCount = column.length;

        this.rowSpan = 1;

        for (var i = 0; i < columnCount; i++) {
            var col = column[i];

            if (typeof col.visible !== 'undefined' && !col.visible) {
                continue;
            }

            if (!$.isArray(col.content)) {
                col.content = [col.content];
            }
            if (col.content.length > this.rowSpan) {
                this.rowSpan = col.content.length;
            }

            var th = $('<th nowrap></th>').attr({
                width: col.width,
                field: col.field
            });
            if (options.flexible) {
                th.removeAttr('nowrap width');
            }

            var title = (col.escapeTitle === false) ? col.title : escapeHTML(col.title);
            if (col.sortable) {
                var wrap = $('<div class="sortable"></div>').html(title);
                if (col.currentSort) {
                    wrap.attr(col.currentSort, '');
                }
                title = wrap.prop('outerHTML');
            }

            thead.find('tr').append(th.html(title).prop('outerHTML'));
        }

        return thead.prop('outerHTML');
    }
1321330
function humanizeValueHtml(value) {
        var formattedValue = "";
        if (value === true) {
            formattedValue = '<i class="icon-check"></i>';
        }
        else if (value === false) {
            formattedValue = '<i class="icon-check-empty"></i>';
        }
        else {
            formattedValue = Core.humanizeValue(value);
        }
        return formattedValue;
    }
1273823
public function displayTidy()
    {
        $breaking_tags = '@</?(div|p|table|tr|td|ul|li|ol|dl|option)[^<>]*>@ui';

        ob_start();
        $this->display();
        $buffer = ob_get_clean();
        $tidy = preg_replace($breaking_tags, "\n\\0\n", $buffer);
        $tidy = str_replace("\n\n", "\n", $tidy);
        echo $tidy;
    }
714487
def format(value, name = nil, style = nil)
      name  ||= self.name
      style ||= self.style

      value = fixed if fixed
      value ||= default if default

      unless value
        if required?
          raise ArgumentError, %Q{No value provided for required param "#{name}"!}
        else
          return '' # No value provided and none required.
        end
      end

      if value.respond_to?(:each) && !value.respond_to?(:to_str)
        if repeating?
          values = value
        else
          raise ArgumentError, %Q{Multiple values provided for single-value param "#{name}"}
        end
      else
        values = [value]
      end

      # If the param lists acceptable values in option tags, make sure that
      # all values are found in those tags.
      if options && !options.empty?
        values.each { |_value|
          unless find_option(_value)
            acceptable = options.map { |o| o.value }.join('", "')
            raise ArgumentError, %Q{"#{_value}" is not among the acceptable parameter values ("#{acceptable}")}
          end
        }
      end

      if style == 'query' || parent.is_a?(RequestFormat) || (
        parent.respond_to?(:is_form_representation?) && parent.is_form_representation?
      )
        values.map { |v| "#{uri_escape(name)}=#{uri_escape(v.to_s)}" }.join('&')
      elsif style == 'matrix'
        if type == 'xsd:boolean'
          values.map { |v| ";#{name}" if v =~ BOOLEAN_RE }.compact.join
        else
          values.map { |v| ";#{uri_escape(name)}=#{uri_escape(v.to_s)}" if v }.compact.join
        end
      elsif style == 'header'
        values.join(',')
      else
        # All other cases: plain text representation.
        values.map { |v| uri_escape(v.to_s) }.join(',')
      end
    end
1228027
function(options) {
        var tbody = $('<tbody></tbody>'),
            column = options.column,
            columnCount = column.length,
            data = options.data,
            rowCount = data.length;

        for (var i = 0; i < rowCount; i++) {
            var tr = $('<tr></tr>'),
                item = data[i],
                index = i + 1;

            for (var j = 0; j < columnCount; j++) {
                var col = column[j];

                if (typeof col.visible !== 'undefined' && !col.visible) {
                    continue;
                }

                if (!$.isArray(col.content)) {
                    col.content = [col.content];
                }

                var td = $('<td></td>').attr({
                    align: col.align,
                    width: col.width,
                    class: col.customClass
                });
                if (col.editable && col.content.length === 1) {
                    td.attr('editable', '');
                }
                if (this.rowSpan > 1 && col.content.length === 1) {
                    td.attr('rowspan', this.rowSpan);
                }

                var content = col.content[0].apply(this, [item, index, col.field]).toString();
                td.html((col.escapeContent === false) ? content : escapeHTML(content)).appendTo(tr);

                if (options.flexible) {
                    td.removeAttr('width');
                }
            }

            tbody.append(tr);

            if (this.rowSpan > 1) {
                for (var m = 1; m < this.rowSpan; m++) {
                    var _tr = $('<tr></tr>');
                    for (var n = 0; n < columnCount; n++) {
                        var _col = column[n];

                        if (!$.isArray(_col.content)) {
                            _col.content = [_col.content];
                        }

                        if ((typeof _col.visible !== 'undefined' && !_col.visible) || _col.content.length === 1) {
                            continue;
                        }

                        var _td = $('<td></td>').attr({
                            align: _col.align,
                            class: _col.customClass
                        });
                        var _content = _col.content[m].apply(this, [item, index, _col.field]).toString();
                        _td.html((_col.escapeContent === false) ? _content : escapeHTML(_content)).appendTo(_tr);

                        if (options.flexible) {
                            _td.removeAttr('width');
                        }
                    }
                    tbody.append(_tr);
                }
            }
        }

        return tbody.prop('outerHTML');
    }
586741
function(item) {
            if(!item || !item.element)
                return;

            var pixelsRegex = /[0-9]+px$/;
            // Following wrapper are only used in horizontal mode, in order to correctly display bigItems (with table display)
            var itemWrapper = $('<div class="timeline-me-item-wrapper">');
            var labelWrapper = $('<div class="timeline-me-label-wrapper">');
            var contentWrapper = $('<div class="timeline-me-content-wrapper">');

            var labelElm = $('<div class="timeline-me-label">');
            item.labelElement = labelElm;
            if(this.settings.orientation == 'horizontal' && this.settings.labelDimensionValue && pixelsRegex.test(this.settings.labelDimensionValue)) {
                labelElm.css('width', this.settings.labelDimensionValue);
            }
            var pictoElm = $('<div class="timeline-me-picto">');
            item.pictoElement = pictoElm;

            labelWrapper.append(labelElm);
            itemWrapper.append(labelWrapper);

            if(item.type == 'smallItem' || item.type == 'bigItem') {
                var contentContainer = $('<div class="timeline-me-content-container">');
                var contentElm = $('<div class="timeline-me-content"></div>');
                contentContainer.append(contentElm);
                if(this.settings.orientation == 'horizontal' && this.settings.contentDimensionValue && pixelsRegex.test(this.settings.contentDimensionValue)) {
                    contentElm.css('width', this.settings.contentDimensionValue);
                }

                var shortContentElm = $('<div class="timeline-me-shortcontent">');
                contentElm.append(shortContentElm);
                item.shortContentElement = shortContentElm;

                var fullContentElm = $('<div class="timeline-me-fullcontent">');
                contentElm.append(fullContentElm);
                item.fullContentElement = fullContentElm;

                var showMoreElm = $('<div class="timeline-me-showmore">');
                item.showMoreElement = showMoreElm;

                var showLessElm = $('<div class="timeline-me-showless">');
                item.showLessElement = showLessElm;

                contentWrapper.append(contentContainer);
                itemWrapper.append(contentWrapper);
            }

            item.element.append(itemWrapper);

            item.itemWrapperElement = itemWrapper;
            item.labelWrapperElement = labelWrapper;
            item.contentWrapperElement = contentWrapper;
        }
921701
def format_options(options):
    ''''''
    # split on one of the following tokens: ' -' or '[[' or ']]'
    lines = ['']
    for token in re.split(r'( -|\[\[|\]\])', options):
        if token in ['[[',']]']:
            lines.append(token)
            lines.append('')
        elif token == ' -':
            lines.append(token)
        else:
            lines[-1] += token
    # join all non-empty lines and wrap them into 'span'-tags
    return '<span style="display:block">' + '</span><span style="display:block">'.join(line for line in lines if line.strip()) + '</span>'
647876
function() {
		
			var html = $('<ul class="'+this.classes.flip+' '+(this.factory.running ? this.factory.classes.play : '')+'" />');
			
			for(var x = 0; x < 10; x++) {
				var item = $([
				'<li data-digit="'+x+'">',
					'<a href="#">',
						'<div class="up">',
							'<div class="shadow"></div>',
							'<div class="inn">'+x+'</div>',
						'</div>',
						'<div class="down">',
							'<div class="shadow"></div>',
							'<div class="inn">'+x+'</div>',
						'</div>',
					'</a>',
				'</li>'].join(''));
				
				this.items.push(item);
				
				html.append(item);
			}
						
			return html;
		}
25303
function(item) {
        var a = $('<a/>', {
            href: 'javascript:;',
            role: 'option',
            'aria-selected': 'false'
        });

        a.append( this.render(this.options.titleTemplate).html(this.highlight(item.title)) );

        if (item.description) {
            a.append( this.render(this.options.descTemplate).html(item.description) );
        }

        return a;
    }
839172
function formatLabelView(str)
			{
				var formatLabel = formatbar.closest("."+vars.css+"_tool").find("."+vars.css+"_tool_label").find("."+vars.css+"_tool_text");
				
				if(str.length > 10)
						str = str.substr(0,7) + "...";
				
				//  of button
				formatLabel.html(str);
			}
235666
def htmlFormat(output, pathParts = (), statDict = None, query = None):
  """"""
  statDict = statDict or scales.getStats()
  if query:
    statDict = runQuery(statDict, query)
  _htmlRenderDict(pathParts, statDict, output)
861686
function format (form) {
        return formToMarkup(form)
        // Split lines.
        .split('\n')
        .map(function (line, index) {
          return EMPTY_LINE.test(line)
          // If the line is empty, leave it empty.
          ? line
          : index === 0
              ? line
              // On subsequent lines with indentation, add spaces
              // to existing indentation.
              : ' '.repeat(token.position.column - 1) + line
        })
        .join('\n')
      }
273455
def formatDropEvent(event):
    
    text = []
    
    text.append('#------------------------------------------------------')
    text.append('#                      Drop Data                     ')
    text.append('#------------------------------------------------------')
    
    text.append('\taction: {0}'.format(event.dropAction()))
    text.append('\tmodifiers: {0}'.format(event.keyboardModifiers()))
    text.append('\tbuttons: {0}'.format(event.mouseButtons()))
    text.append('\tpos: {0}'.format(event.pos()))
    text.append('\tpossibleActions: {0}'.format(event.possibleActions()))
    text.append('\tproposedAction: {0}'.format(event.proposedAction()))
    text.append('\tsource: {0}'.format(event.source()))
    
    text.append('#------------------------------------------------------')
    text.append('#                      Mime Data                     ')
    text.append('#------------------------------------------------------')
    
    data = event.mimeData()
    text.append('\tcolorData: {0}'.format(data.colorData()))
    text.append('\thasImage: {0}'.format(data.hasImage()))
    text.append('\thasHtml: {0}'.format(data.hasHtml()))
    text.append('\ttext: {0}'.format(data.text()))
    text.append('\turls: {0}'.format(data.urls()))
    
    text.append('#------------------------------------------------------')
    text.append('#                      Custom Data                     ')
    text.append('#------------------------------------------------------')
    
    for format in data.formats():
        try:
            text.append('\t{0}: {1}'.format(format, data.data(format)))
        except:
            text.append('\t{0}: !!unable to format!!'.format(format))
    
    return '\n'.join(text)
32563
function formatChange() {
  var mask = document.getElementById('blocklyMask');
  var languagePre = document.getElementById('languagePre');
  var languageTA = document.getElementById('languageTA');
  if (document.getElementById('format').value == 'Manual') {
    Blockly.hideChaff();
    mask.style.display = 'block';
    languagePre.style.display = 'none';
    languageTA.style.display = 'block';
    var code = languagePre.textContent.trim();
    languageTA.value = code;
    languageTA.focus();
    updatePreview();
  } else {
    mask.style.display = 'none';
    languageTA.style.display = 'none';
    languagePre.style.display = 'block';
    updateLanguage();
  }
  disableEnableLink();
}
1025424
public function formatList(): string
    {
        $html = '<a href="' . e($this->url()) . '" class="list_item">';
        $html .= '<b>' . $this->fullName() . '</b>';
        $html .= $this->formatListDetails();
        $html .= '</a>';

        return $html;
    }