Format a single report line.
334754
def _format_report_line(self, test, time_taken, color, status, percent):
        """"""
        return "[{0}] {3:04.2f}% {1}: {2}".format(
            status, test, self._colored_time(time_taken, color), percent
        )
796548
def make_format(self, fmt, width):
        
        if not self.report_data:
            return
        
        for data_item in self.report_data:
            if data_item.results:
                if fmt is None or fmt == 'text':
                    data_item.make_text(width)
                elif fmt == 'html':
                    data_item.make_html()
                elif fmt == 'csv':
                    data_item.make_csv()
971243
def format(self, indent_level, indent_size=4):
        

        name = self.format_name('Bytes', indent_size)
        return self.wrap_lines(name, indent_level, indent_size)
492802
def format(self, format):
    """"""

    job_id = "%d - %d" % (self.job.id, self.id)
    queue = self.job.queue_name if self.machine_name is None else self.machine_name
    status = "%s" % self.status + (" (%d)" % self.result if self.result is not None else "" )

    return format.format("", job_id, queue, status)
1158808
function formatLinesWith (formatter, str) {
  return str
    .split('\n')
    .map(function (line) {
      return line.length ? formatter(line) : ''
    })
    .join('\n')
}
229297
def write_line(self, message):
        """"""

        self.out.write(message + "\n")
        self.out.flush()
1020462
def format (self, record):
        """"""
        record.hostname = self.hostname
        return logging.Formatter.format(self, record)
167435
def format(self, record):
        """"""
        if hasattr(record, 'data'):
            return "%s. DEBUG DATA=%s" % (
                logging.Formatter.format(self, record),
                record.__dict__['data'])
        return logging.Formatter.format(self, record)
473004
def _format_line(self, side, flag, linenum, text):
        
        try:
            linenum = '%d' % linenum
            id = ' id="%s%s"' % (self._prefix[side], linenum)
        except TypeError:
            # handle blank lines where linenum is '>' or ''
            id = ''
        # replace those things that would get confused with HTML symbols
        text = (
            text.replace("&", "&amp;").replace(">",
                                               "&gt;").replace("<", "&lt;")
        )

        type_ = 'neutral'
        if '\0+' in text:
            type_ = 'add'
        if '\0-' in text:
            if type_ == 'add':
                type_ = 'chg'
            type_ = 'sub'
        if '\0^' in text:
            type_ = 'chg'

        # make space non-breakable so they don't get compressed or line wrapped
        text = text.replace(' ', '&nbsp;').rstrip()

        return (
            '<td class="diff_lno"%s>%s</td>'
            '<td class="diff_line diff_line_%s">%s</td>' %
            (id, linenum, type_, text)
        )
1303524
def precmd(self, line):
        
        line = line.lower()
        
        if line == 'exit' or line == 'help':
            return line
        
        try:
            parts = stmt.parseString(line)

            if len(parts) == 2:
                self.simple_report(parts)
            else:
                self.grouped_report(parts)
        except ParseException, err:
            pass
        
        return "none"
1372241
def _get_linewise_report(self):
		
		d = defaultdict(list)  # line: [] of errors

		for error, lines in self.errors.items():
			for line_num in lines:
				d[line_num].append(error)

		return '\n'.join([
			'{:>3} → {}'.format(line, error.string)
			for line in sorted(d.keys())
			for error in d[line]])
802637
def format(self, text, width=78, indent=4):
        """"""
        return textwrap.fill(
            text,
            width=width,
            initial_indent=' ' * indent,
            subsequent_indent=' ' * indent,
        )
1347571
def format(self, record):
        
        formatted = super(IndentingFormatter, self).format(record)
        prefix = ''
        if self.add_timestamp:
            prefix = self.formatTime(record, "%Y-%m-%dT%H:%M:%S ")
        prefix += " " * get_indentation()
        formatted = "".join([
            prefix + line
            for line in formatted.splitlines(True)
        ])
        return formatted
483436
def format(self, filename, line, timestamp, **kwargs):
        """"""
        line = unicode(line.encode("utf-8"), "utf-8", errors="ignore")
        formatter = self._beaver_config.get_field('format', filename)
        if formatter not in self._formatters:
            formatter = self._default_formatter

        data = {
            self._fields.get('type'): kwargs.get('type'),
            self._fields.get('tags'): kwargs.get('tags'),
            '@timestamp': timestamp,
            self._fields.get('host'): self._current_host,
            self._fields.get('file'): filename,
            self._fields.get('message'): line
        }

        if self._logstash_version == 0:
            data['@source'] = 'file://{0}'.format(filename)
            data['@fields'] = kwargs.get('fields')
        else:
            data['@version'] = self._logstash_version
            fields = kwargs.get('fields')
            for key in fields:
                data[key] = fields.get(key)

        return self._formatters[formatter](data)
760631
def formatLine(self, line, indent=0, outcome_char=''):
        
        actual_spaces = (indent * self.indent_spaces) - len(outcome_char)
        return (outcome_char + ' ' * actual_spaces + line)
237606
def format_filename(self, item: Union[Post, StoryItem], target: Optional[str] = None):
        """"""
        return _PostPathFormatter(item).format(self.filename_pattern, target=target)
741237
public String formatValue(ReportValue val) {
      if (log.isLoggable(Level.FINE) || debug) {
         log.fine("raw: " + val + ", formatted: " + doFormatValue(val));
      }
      return doFormatValue(val);
   }