display-format one row
        Formats one Asset Class record
492976
def __format_row(self, row: AssetAllocationViewModel):
        
        output = ""
        index = 0

        # Name
        value = row.name
        # Indent according to depth.
        for _ in range(0, row.depth):
            value = f"   {value}"
        output += self.append_text_column(value, index)

        # Set Allocation
        value = ""
        index += 1
        if row.set_allocation > 0:
            value = f"{row.set_allocation:.2f}"
        output += self.append_num_column(value, index)

        # Current Allocation
        value = ""
        index += 1
        if row.curr_allocation > Decimal(0):
            value = f"{row.curr_allocation:.2f}"
        output += self.append_num_column(value, index)

        # Allocation difference, percentage
        value = ""
        index += 1
        if row.alloc_diff_perc.copy_abs() > Decimal(0):
            value = f"{row.alloc_diff_perc:.0f} %"
        output += self.append_num_column(value, index)

        # Allocated value
        index += 1
        value = ""
        if row.set_value:
            value = f"{row.set_value:,.0f}"
        output += self.append_num_column(value, index)

        # Current Value
        index += 1
        value = f"{row.curr_value:,.0f}"
        output += self.append_num_column(value, index)

        # Value in security's currency. Show only if displaying full model, with stocks.
        index += 1
        if self.full:
            value = ""
            if row.curr_value_own_currency:
                value = f"({row.curr_value_own_currency:,.0f}"
                value += f" {row.own_currency}"
                value += ")"
            output += self.append_num_column(value, index)

        # https://en.wikipedia.org/wiki/ANSI_escape_code
        # CSI="\x1B["
        # red = 31, green = 32
        # output += CSI+"31;40m" + "Colored Text" + CSI + "0m"

        # Value diff
        index += 1
        value = ""
        if row.diff_value:
            value = f"{row.diff_value:,.0f}"
            # Color the output
            # value = f"{CSI};40m{value}{CSI};40m"
        output += self.append_num_column(value, index)

        return output
1125688
function(row,displayFlag){
			var displayStr = '';
			if(!this.options.autoExpand && row.level > 0 && displayFlag != 'block'){
				displayStr = 'display:none;'
			}
			var tmpcheck = row.value["$_#_@_id"]
			if(!tmpcheck) {
				tmpcheck = setTimeout(function(){});
			}
			if(gridBrowser.isIE8){
				//var	htmlStr = '<div style="width:' + this.multiSelectWidth + 'px;' + displayStr + '" class="u-grid-content-multiSelect " ><input class="u-grid-multi-input" id="checkbox'+tmpcheck+'" type="checkbox" value="1" ></div>'
				var	htmlStr = '<div style="width:' + this.multiSelectWidth + 'px;' + displayStr + '" class="u-grid-content-multiSelect " ><span class="u-grid-checkbox-outline" id="checkbox'+tmpcheck+'" value="1"><span class="u-grid-checkbox-tick-outline"></span></span></div>'
			}else{
				//var htmlStr = '<div style="width:' + this.multiSelectWidth + 'px;' + displayStr + '" class="u-grid-content-multiSelect checkbox check-success" ><input class="u-grid-multi-input" id="checkbox'+tmpcheck+'" type="checkbox" value="1" ><label for="checkbox'+tmpcheck+'"></label></div>'
				var htmlStr = '<div style="width:' + this.multiSelectWidth + 'px;' + displayStr + '" class="u-grid-content-multiSelect checkbox check-success" ><span class="u-grid-checkbox-outline" id="checkbox'+tmpcheck+'" value="1"><span class="u-grid-checkbox-tick-outline"></span></span></div>'
			}
			return htmlStr;
		}
904239
function formatRecord(rec) {
  const level = levels[rec.level];
  const msg = `${indent(rec.msg)}`;
  const meta = getMeta(rec);
  const details = getDetails(rec);
  return util.format('%s: %s%s\n%s', level, msg, meta, details);
}
128630
def format(self, model: AssetAllocationModel, full: bool = False):
        
        self.full = full

        # Header
        output = f"Asset Allocation model, total: {model.currency} {model.total_amount:,.2f}\n"

        # Column Headers
        for column in self.columns:
            name = column['name']
            if not self.full and name == "loc.cur.":
                # Skip local currency if not displaying stocks.
                continue
            width = column["width"]
            output += f"{name:^{width}}"
        output += "\n"
        output += f"-------------------------------------------------------------------------------\n"

        # Asset classes

        view_model = ModelMapper(model).map_to_linear(self.full)
        for row in view_model:
            output += self.__format_row(row) + "\n"

        return output
502137
def format_filename(self, data, row):
        
        return self.filename.format(**self.filename_formatters(data, row))
1304334
def format(filename=nil, line=nil)
      out = ""
      if filename
        out = Util::OS.windows? ? filename.gsub('/', '\\') : filename
        if line
          out += ":#{line}:"
        end
      end
      paint(:magenta, out)
    end
836921
def to_format
      if !get? && has_errors? && !response_overridden?
        display_errors
      elsif has_view_rendering? || response_overridden?
        default_render
      else
        api_behavior
      end
    rescue ActionView::MissingTemplate
      api_behavior
    end
357044
def format_entry(record, show_level=False, colorize=False):
    
    if show_level:
        log_str = u'{}: {}'.format(record.levelname, record.getMessage())
    else:
        log_str = record.getMessage()

    if colorize and record.levelname in LOG_COLORS:
        log_str = u'<span color="{}">'.format(LOG_COLORS[record.levelname]) + log_str + u'</span>'

    return log_str
682255
function formatFieldSwitch(status)
			{				
				var thisStatus = status ? true : false;
				
				thisStatus = status && formatbar.data("status") ? true : false;
				
				if(thisStatus || !status)
					formatbar.data("status",false).slideUp(200);
				else
					formatbar.data("status",true).slideDown(200);
			}
269778
def format_rows(row, center, fullrange=None, interquartile=None,
                custom_format='{:.2f}'):
    """"""
    if (fullrange or 0) + (interquartile or 0) == 1:
        legend = '{} ({})'.format(center, 'max, min' if fullrange is True
                                  else 'interquartile range')
        index = row.index.droplevel(2).drop_duplicates()
        count_arg = dict(tuples=[('count', '')], names=[None, legend])
    else:
        msg = 'displaying multiple range formats simultaneously not supported'
        raise NotImplementedError(msg)

    ret = pd.Series(index=pd.MultiIndex.from_tuples(**count_arg).append(index))

    row = row.sort_index()
    center = '50%' if center == 'median' else center

    # get maximum of `count` and write to first entry of return series
    count = max([i for i in row.loc[(slice(None), slice(None), 'count')]
                 if not np.isnan(i)])
    ret.loc[('count', '')] = ('{:.0f}'.format(count)) if count > 1 else ''

    # set upper and lower for the range
    upper, lower = ('max', 'min') if fullrange is True else ('75%', '25%')

    # format `describe()` columns to string output
    for i in index:
        x = row.loc[i]
        _count = x['count']
        if np.isnan(_count) or _count == 0:
            s = ''
        elif _count > 1:
            s = '{f} ({f}, {f})'.format(f=custom_format)\
                .format(x[center], x[upper], x[lower])
        elif _count == 1:
            s = '{f}'.format(f=custom_format).format(x['50%'])
        # add count of this section as `[]` if different from count_max
        if 0 < _count < count:
            s += ' [{:.0f}]'.format(_count)
        ret.loc[i] = s

    return ret
157196
def _display_data(self, index):
        """"""
        return to_qvariant(self._data[index.row()][index.column()])
198874
function doRowHeader(dataType, data, expand){
	return format(ROWHEADER, dataType, doHeaderStyle(dataType, expand), data);
}
704459
def _format_multirow(self, row, ilevels, i, rows):
        
        """
        for j in range(ilevels):
            if row[j].strip():
                nrow = 1
                for r in rows[i + 1:]:
                    if not r[j].strip():
                        nrow += 1
                    else:
                        break
                if nrow > 1:
                    # overwrite non-multirow entry
                    row[j] = '\\multirow{{{nrow:d}}}{{*}}{{{row:s}}}'.format(
                        nrow=nrow, row=row[j].strip())
                    # save when to end the current block with \cline
                    self.clinebuf.append([i + nrow - 1, j + 1])
        return row
512202
def display(self, previous=0, include_data=False):
        """"""
        no_data = " (No Data)" if self.data is None else ""
        return (
            (" +" * previous) + str(self.name) + no_data + '\n' +
            ''.join([child.display(previous + 1) for child in self.children]))
787168
def nice_display(item):
    """"""
    if hasattr(item, 'all'):  # RelatedManager: display a list
        return ', '.join(map(text_type, item.all()))
    return item
1125431
def format_prettytable(table):
    """"""
    for i, row in enumerate(table.rows):
        for j, item in enumerate(row):
            table.rows[i][j] = format_output(item)

    ptable = table.prettytable()
    ptable.hrules = prettytable.FRAME
    ptable.horizontal_char = '.'
    ptable.vertical_char = ':'
    ptable.junction_char = ':'
    return ptable
575321
function reapplyDisplayStyle(className, value) {
    value = value ? "block" : "none"
    ;[].slice.call(document.querySelectorAll(className)).forEach(function(element) {
        element.style.display = value
    })
}