Wrap `msg` in bars to create a header effect
437933
def header(msg):
    
    # Accounting for '| ' and ' |'
    width = len(msg) + 4
    s = []
    s.append('-' * width)
    s.append("| %s |" % msg)
    s.append('-' * width)
    return '\n'.join(s)
684651
function (msg, colors) {

        if (!colors) {
            return msg;
        }

        if (typeof colors === 'string') {
            colors = [colors];
        }

        colors.forEach(function (color) {
            if (typeof colorsjs[color] === 'function') {
                msg = colorsjs[color](msg);
            }
        });

        return msg;
    }
393303
def wrap(s, width=80):
    
    return '\n'.join(textwrap.wrap(str(s), width=width))
1329775
public function ShowBanner($msg) {
	/*//
	print a header banner to the console with a message inside it.
	//*/

		$linefill = (75 - (strlen($msg) + 4));
		printf('%s%s%s',PHP_EOL,str_repeat('=',75),PHP_EOL);
		printf('== %s %s%s%s',$msg,str_repeat('=',$linefill),PHP_EOL,PHP_EOL);
		return $this;
	}
976902
def timed_display(msg):
    
    def print_header(msg, newline=True):
        """Print a header line.

        Args:
            msg: A message to be printed in the center of the header line.
            newline: Whether or not to print a newline at the end of the
                header. This can be convenient for allowing the line to
                overwrite another.
        """
        if sys.stdout.isatty():
            print('\r', end=Style.BRIGHT + Fore.BLUE)
        print(' {} '.format(msg).center(_ncols(), '='),
              end='\n{}'.format(Style.RESET_ALL)
              if newline else Style.RESET_ALL)
        sys.stdout.flush()

    def print_message(msg):
        """Print a task title message.

        Args:
            msg: The message to display before running the task.
        """
        if sys.stdout.isatty():
            print('\r', end='')
            msg = msg.ljust(_ncols())
        print(msg, end='')
        sys.stdout.flush()

    start = time.time()
    print_header(msg)
    with hidden_cursor():
        try:
            yield print_message
        finally:
            delta = time.time() - start
            print_header('completed in {:.2f}s'.format(delta), False)
653543
def art_msg(self, arttag, colorname, file=sys.stdout):
        """"""
        self.msg(self.art[arttag], colorname, file=file)
801171
function generateMDTable(headers, body) {
  const headerRow = headers.map(header => header.label);
  const alignmentRow = headers.map(header => {
    if (header.align === 'right') {
      return ' ---:';
    }
    if (header.align === 'center') {
      return ':---:';
    }
    return ' --- ';
  });

  return [headerRow, alignmentRow, ...body].map(row => row.join(' | ')).join('\n');
}
487024
def build_table(self, msg):
        """"""
        rows = msg.split('\n')
        if rows:
            header_row, *body_rows = rows
            self.create_md_row(header_row, True)
            for row in body_rows:
                self.create_md_row(row)
401096
def _header(self, message: str, with_gap=True):
        
        if with_gap:
            self._line_break()
        self._log(self._set_color(message, self.YELLOW))
1316708
function(bar, placement) {
            var options = this.options;
            placement = placement || options.scaleValuePlacement;
            placement = placement ? placement.toLowerCase() : 'auto';
            if(placement === 'auto') {
                placement = bar.y < 15 ? 'insdie' : 'outside';
            }

            var y = placement === 'insdie' ? (bar.y + 10) : (bar.y - 10);
            var ctx = this.chart.ctx;
            ctx.font = helpers.fontString(options.scaleFontSize, options.scaleFontStyle, options.scaleFontFamily);
            ctx.textBaseline = "middle";
            ctx.textAlign = "center";
            ctx.fillStyle = options.scaleFontColor;
            ctx.fillText(bar.value, bar.x, y);
        }
160329
function color(c, bold, msg) {
  return bold ? clic.xterm(c).bold(msg) : clic.xterm(c)(msg);
}
767868
def set_header(self, msg):
        
        self.s.move(1, 0)
        self.overwrite_line(msg, attr=curses.A_NORMAL)
95229
def sp_msg(cmd, pipe=None, data=None):
    """"""
    msg = [SP_HEADER, cmd]
    if pipe is not None:
        msg.append(pipe)
    if data is not None:
        msg.append(data)
    return msg
1061574
function _makeTableHeadAlignText(thElement) {
  const {align} = thElement;
  const textContent = (thElement.textContent || thElement.innerText).replace(RX_COLS, '');
  let textLength = textContent.length;
  let leftAlignValue = '';
  let rightAlignValue = '';

  if (align) {
    if (align === 'left') {
      leftAlignValue = ':';
      textLength -= 1;
    } else if (align === 'right') {
      rightAlignValue = ':';
      textLength -= 1;
    } else if (align === 'center') {
      rightAlignValue = ':';
      leftAlignValue = ':';
      textLength -= 2;
    }
  }

  textLength = Math.max(textLength, 3);

  return leftAlignValue + _createRepeatString('-', textLength) + rightAlignValue;
}
948728
def _render_bar(self, bar, value, max_value, label_width, bar_width, **settings):
        
        percent = value / max_value
        barstr = ""
        barstr += str(settings[self.SETTING_BAR_CHAR]) * int(bar_width * percent)
        s = {k: settings[k] for k in (self.SETTING_FLAG_PLAIN,)}
        s.update(settings[self.SETTING_BAR_FORMATING])
        barstr = self.fmt_text(barstr, **s)
        barstr += ' ' * int(bar_width - int(bar_width * percent))
        strptrn = "{:"+str(label_width)+"s} [{:s}]"
        return strptrn.format(bar.get('label'), barstr)
1035768
def bar(
    it,
    label="",
    width=32,
    hide=None,
    empty_char=BAR_EMPTY_CHAR,
    filled_char=BAR_FILLED_CHAR,
    expected_size=None,
    every=1,
):
    """"""
    count = len(it) if expected_size is None else expected_size
    with Bar(
        label=label,
        width=width,
        hide=hide,
        empty_char=BAR_EMPTY_CHAR,
        filled_char=BAR_FILLED_CHAR,
        expected_size=count,
        every=every,
    ) as bar:
        for i, item in enumerate(it):
            yield item

            bar.show(i + 1)
1268561
def _msg_create_line(self, msg, data, key):
        """"""
        ret = []

        ret.append(self.curse_add_line(msg))
        ret.append(self.curse_add_line(data.pre_char, decoration='BOLD'))
        ret.append(self.curse_add_line(data.get(), self.get_views(key=key, option='decoration')))
        ret.append(self.curse_add_line(data.post_char, decoration='BOLD'))
        ret.append(self.curse_add_line('  '))

        return ret