Pretty formats the failure object into a string.
198107
def pformat(self, traceback=False):
        """"""
        buf = six.StringIO()
        if not self._exc_type_names:
            buf.write('Failure: %s' % (self._exception_str))
        else:
            buf.write('Failure: %s: %s' % (self._exc_type_names[0],
                                           self._exception_str))
        if traceback:
            if self._traceback_str is not None:
                traceback_str = self._traceback_str.rstrip()
            else:
                traceback_str = None
            if traceback_str:
                buf.write(os.linesep)
                buf.write(traceback_str)
            else:
                buf.write(os.linesep)
                buf.write('Traceback not available.')
        return buf.getvalue()
81846
def format_error(err_type, err_value, err_trace=None):
    """"""
    if err_trace is None:
        err_parts = "".join(traceback.format_exception_only(err_type, err_value)).strip().split(": ", 1)
        if len(err_parts) == 1:
            err_name, err_msg = err_parts[0], ""
        else:
            err_name, err_msg = err_parts
        err_name = err_name.split(".")[-1]
        return err_name + ": " + err_msg
    else:
        return "".join(traceback.format_exception(err_type, err_value, err_trace)).strip()
874388
private String failureReasonToString(int failureReason)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "failureReasonToString", new Integer(failureReason));
    String frString = "";

    switch (failureReason)
    {
      case SIMPConstants.BROWSE_STORE_EXCEPTION:
        frString = "browse store exception";
        break;

      case SIMPConstants.BROWSE_OUT_OF_ORDER:
        frString = "browse out of order";
        break;

      case SIMPConstants.BROWSE_BAD_FILTER:
        frString = "browse bad filter";
        break;

      default:
        frString = "";
        break;
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "failureReasonToString", frString);
    return frString;
  }
986922
def failure_message(self, fail):
        
        try:
            return u'{0}: {1}'.format(
                fail._value.__class__.__name__,
                str(fail._value),
            )
        except Exception:
            return u'Failed to produce failure message for "{0}"'.format(fail)
772782
function (err) {
    var msg = '';
    var t$ = Tool;
    try {
      if (t$.isString(err)) {
        msg = err;
      } else if (t$.isError(err)) {
        msg = err.message;
      } else if (t$.isObject(err)) {
        var errMsg = [];
        for (var p in err) {
          if (err.hasOwnProperty(p)) {
            errMsg.push(p + '=' + err[p]);
          }
        }
        if (errMsg.length === 0) {
          msg = err;
        } else {
          msg = errMsg.join('\n');
        }
      } else {
        msg += '[RTY_CANT_TYPE] = ' + t$.getType(err);
        msg += JSON.stringify(err);
      }
    } catch (error) {
      throw error
    }

    return msg
  }
9907
def format_match(self, obj):
        
        result = [escape(obj.name)]

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

        return " ".join(result)
1107712
def pretty_str(self, indent=0):
        
        spaces = ' ' * indent
        condition = pretty_str(self.condition)
        v = self.declarations.pretty_str() if self.declarations else ''
        i = self.increment.pretty_str(indent=1) if self.increment else ''
        pretty = '{}for ({}; {}; {}):\n'.format(spaces, v, condition, i)
        pretty += self.body.pretty_str(indent=indent + 2)
        return pretty
1374684
private JSONNavi<?> failure(String err, Object jPathPostfix) {
		failure = true;
		StringBuilder sb = new StringBuilder();
		sb.append("Error: ");
		sb.append(err);
		sb.append(" at ");
		sb.append(getJPath());
		if (jPathPostfix != null)
			if (jPathPostfix instanceof Integer)
				sb.append('[').append(jPathPostfix).append(']');
			else
				sb.append('/').append(jPathPostfix);
		this.failureMessage = sb.toString();
		return this;
	}
162711
def pretty_describe(object, nestedness=0, indent=2):
    """"""
    if not isinstance(object, dict):
        return str(object)
    sep = f'\n{" " * nestedness * indent}'
    out = sep.join((f'{k}: {pretty_describe(v, nestedness + 1)}' for k, v in object.items()))
    if nestedness > 0 and out:
        return f'{sep}{out}'
    return out
253878
def format_exc(*exc_info):
    """"""
    typ, exc, tb = exc_info or sys.exc_info()
    error = traceback.format_exception(typ, exc, tb)
    return "".join(error)
275420
def format_for_exception
      return "Command execution failed. STDOUT/STDERR suppressed for sensitive resource" if sensitive
      msg = ""
      msg << "#{@terminate_reason}\n" if @terminate_reason
      msg << "---- Begin output of #{command} ----\n"
      msg << "STDOUT: #{stdout.strip}\n"
      msg << "STDERR: #{stderr.strip}\n"
      msg << "---- End output of #{command} ----\n"
      msg << "Ran #{command} returned #{status.exitstatus}" if status
      msg
    end
1294803
def to_string(level):
        
        if level == LogLevel.Fatal:
            return "FATAL" 
        if level == LogLevel.Error:
            return "ERROR" 
        if level == LogLevel.Warn:
            return "WARN" 
        if level == LogLevel.Info:
            return "INFO" 
        if level == LogLevel.Debug:
            return "DEBUG" 
        if level == LogLevel.Trace:
            return "TRACE"
        return "UNDEF"
900273
def as_text(self, is_pretty=False):
        """"""
        values = {'id': self._id, 'type': self._type}
        if self._owner:
            values['owner'] = self._owner

        if is_pretty:
            return json.dumps(values, indent=4, separators=(',', ': '))

        return json.dumps(values)
467682
function formatObject(o) {
		var s = String(o);
		if(s === '[object Object]' && typeof JSON !== 'undefined') {
			s = tryStringify(o, s);
		}
		return s;
	}
641061
def dollar_signs(value, failure_string='N/A'):
    
    try:
        count = int(value)
    except ValueError:
        return failure_string
    string = ''
    for i in range(0, count):
        string += '$'
    return string
1271570
function prettyFormat (value) {
  if (isString(value)) {
    return value
  }

  if (value instanceof Error) {
    return value.message + '\n' + value.stack
  }

  return JSON.stringify(value, null, 2)
}
655644
function format(err, options) {
    const error = { message: 'Internal Server Error' };

    options = options || {};

    if (options.exposeErrors || (err.httpStatusCode && err.httpStatusCode < 500)) {
        error.message = err.message;
        if (err.code) error.code = err.code;
        if (err.validation) error.validation = err.validation;
    }

    if (options.exposeErrors) {
        if (err.stack) error.stack = err.stack.split(/\r?\n/);

        if (err.info) {
            Object.keys(err.info).forEach(key => {
                if (!has(error, key) && has(err.info, key)) error[key] = err.info[key];
            });
        }
    }

    return error;
}