Returns a nicely formatted representation of this
 message.
504923
def to_s
      _mti_name = _get_mti_definition(mti)[1]
      str = "MTI:#{mti} (#{_mti_name})\n\n"
      _max = @values.values.max {|a,b|
        a.name.length <=> b.name.length
      }
      _max_name = _max.name.length

      @values.keys.sort.each{|bmp_num|
        _bmp = @values[bmp_num]
        str += ("%03d %#{_max_name}s : %s\n" % [bmp_num, _bmp.name, _bmp.value])
      }
      str
    end
887854
def colorize(message, color=None):
    """"""
    if not color:
        return message

    colors = {
        "green": colorama.Fore.GREEN,
        "yellow": colorama.Fore.YELLOW,
        "blue": colorama.Fore.BLUE,
        "red": colorama.Fore.RED,
    }

    return "{color}{message}{nc}".format(
        color=colors.get(color, ""), message=message, nc=colorama.Fore.RESET
    )
557932
public static String formatMessage(String msg, Object... params) {
		try {
			// required by MessageFormat, single quotes break string interpolation!
			msg = StringUtils.replace(msg, "'", "''");
			return StringUtils.isBlank(msg) ? "" : MessageFormat.format(msg, params);
		} catch (IllegalArgumentException e) {
			return msg;
		}
	}
701986
def format_notification(self, notification):
        

        return "{0} | '{1}'".format(time.ctime(notification.time), notification.message)
647552
def formatMessage(self, record: logging.LogRecord) -> str:
        """"""
        level_color = "0"
        text_color = "0"
        fmt = ""
        if record.levelno <= logging.DEBUG:
            fmt = "\033[0;37m" + logging.BASIC_FORMAT + "\033[0m"
        elif record.levelno <= logging.INFO:
            level_color = "1;36"
            lmsg = record.message.lower()
            if self.GREEN_RE.search(lmsg):
                text_color = "1;32"
        elif record.levelno <= logging.WARNING:
            level_color = "1;33"
        elif record.levelno <= logging.CRITICAL:
            level_color = "1;31"
        if not fmt:
            fmt = "\033[" + level_color + \
                  "m%(levelname)s\033[0m:%(rthread)s:%(name)s:\033[" + text_color + \
                  "m%(message)s\033[0m"
        fmt = _fest + fmt
        record.rthread = reduce_thread_id(record.thread)
        return fmt % record.__dict__
932780
def indent(self, message):
        
        indent = self.indent_char * self.indent_size
        return indent + message
40212
public String formatMessage(String key, Object... params) {
        return Tr.formatMessage(tc, key, params);
    }
633379
def content(self):
        """"""

        if not self.payload:
            return ''

        if self.payload.is_multipart():
            message_bytes = mime_to_bytes(
                self.payload, 0).replace(b'\n', b'\r\n')
            boundary = b'--' + self.payload.get_boundary().encode('utf-8')
            temp = message_bytes.split(boundary)
            temp.pop(0)
            return boundary + boundary.join(temp)
        else:
            content = self.payload.get_payload()
            if isinstance(content, str_cls):
                content = content.encode('utf-8')
            return content
880694
def format(self):
        
        _bold = bold
        if not self.pretty:
            _bold = lambda x: x
        # Attach memory address and return
        _attrs = self._format_attrs()
        self.data = "<{}.{}({}){}>{}".format(
            self.obj.__module__ if hasattr(self.obj, "__module__") \
                else "__main__",
            _bold(self.obj.__class__.__name__),
            _attrs,
            ":{}".format(hex(id(self.obj))) if self.address else "",
            _break+self.supplemental if self.supplemental else "")
        return stdout_encode(self.data)
106523
def pretty_format(message):
    
    skip = {
        TIMESTAMP_FIELD, TASK_UUID_FIELD, TASK_LEVEL_FIELD, MESSAGE_TYPE_FIELD,
        ACTION_TYPE_FIELD, ACTION_STATUS_FIELD}

    def add_field(previous, key, value):
        value = unicode(pprint.pformat(value, width=40)).replace(
            "\\n", "\n ").replace("\\t", "\t")
        # Reindent second line and later to match up with first line's
        # indentation:
        lines = value.split("\n")
        # indent lines are "  <key length>|  <value>"
        indent = "{}| ".format(" " * (2 + len(key)))
        value = "\n".join([lines[0]] + [indent + l for l in lines[1:]])
        return "  %s: %s\n" % (key, value)

    remaining = ""
    for field in [ACTION_TYPE_FIELD, MESSAGE_TYPE_FIELD, ACTION_STATUS_FIELD]:
        if field in message:
            remaining += add_field(remaining, field, message[field])
    for (key, value) in sorted(message.items()):
        if key not in skip:
            remaining += add_field(remaining, key, value)

    level = "/" + "/".join(map(unicode, message[TASK_LEVEL_FIELD]))
    return "%s -> %s\n%sZ\n%s" % (
        message[TASK_UUID_FIELD],
        level,
        # If we were returning or storing the datetime we'd want to use an
        # explicit timezone instead of a naive datetime, but since we're
        # just using it for formatting we needn't bother.
        datetime.utcfromtimestamp(message[TIMESTAMP_FIELD]).isoformat(
            sep=str(" ")),
        remaining, )
1318163
def _msg_name(self, container, max_width):
        """"""
        name = container['name']
        if len(name) > max_width:
            name = '_' + name[-max_width + 1:]
        else:
            name = name[:max_width]
        return ' {:{width}}'.format(name, width=max_width)
1204941
def format_messages(self, messages):
        
        mess = ""
        for message in self.message:
            if self.pretty:
                mess = "{}{}".format(mess, self.format_message(message))
            else:
                mess += str(message)
        if self.include_time:
            return ": {} : {}".format(
                datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'), mess)
        return stdout_encode(mess)
558462
public static String formatMessage(String msgKey) {
        String msg;
        try {
            msg = JaxbToolsConstants.messages.getString(msgKey);
        } catch (Exception ex) {
            // no FFDC required
            return msgKey;
        }

        return msg;
    }
227188
def str_def(self):
        
        return "classname={!r}; read_timeout={!r}; read_retries={!r}; " \
            "message={!r};". \
            format(self.__class__.__name__, self.read_timeout,
                   self.read_retries, self.args[0])
1179103
@Override
    public String getFormattedMessage() {
        if (formattedMessage == null) {
            formattedMessage = formatMessage(messagePattern, argArray);
        }
        return formattedMessage;
    }
219246
String formatMessage(int msgLogLevel, String module, String msg) {
        return getLevelTag(msgLogLevel) + module + ": " + msg;
    }
911927
def format_string(message,max_characters=80)
      max_characters = 5 if max_characters < 5
      m = message.gsub(/\r\n|\n|\r/m,";")
      return (m[0..max_characters-4] + "...") if m.size > max_characters
      return m
    end