returns the value in a readable format.
977776
def prettyval(self, val):
        
        if len(val) == self.wordsize and val[-1:] in (b'\x00', b'\xff'):
            return "%x" % struct.unpack("<" + self.fmt, val)
        if len(val) == self.wordsize and re.search(b'[\x00-\x08\x0b\x0c\x0e-\x1f]', val, re.DOTALL):
            return "%x" % struct.unpack("<" + self.fmt, val)
        if len(val) < 2 or not re.match(b'^[\x09\x0a\x0d\x20-\xff]+.$', val, re.DOTALL):
            return hexdump(val)
        val = val.replace(b"\n", b"\\n")
        return "'%s'" % val.decode('utf-8', 'ignore')
934430
def format(self, typedval):
        ''
        if typedval is None:
            return None

        if isinstance(typedval, (list, tuple)):
            return '[%s]' % len(typedval)
        if isinstance(typedval, dict):
            return '{%s}' % len(typedval)
        if isinstance(typedval, bytes):
            typedval = typedval.decode(options.encoding, options.encoding_errors)

        return getType(self.type).formatter(self.fmtstr, typedval)
558798
def format_value(value):
    
    value = decimal.Decimal(str(value))
    if int(value) == value:
        return int(value)

    # On Python 3, an explicit cast to float is required
    return float(round(value, 1))
298098
def format_value(self, value):
        
        if value == '' or value is None:
            return None
        return formats.localize_input(value, self.format)
797081
def value(self):
        
        if self._value:
            return self._value
        if self.formatter:
            return self.formatter(self.raw)
        return self.raw
418010
public String format(Object value) {
    ValueFormatter<Object> valueFormatter = VALUE_FORMATTERS.get(value.getClass());
    if (valueFormatter != null) {
      return valueFormatter.format(this, value);
    } else {
      return value.toString();
    }
  }
777931
def pretty_str(self, indent=0):
        
        indent = ' ' * indent
        values = '{{{}}}'.format(', '.join(map(pretty_str, self.value)))

        if self.parenthesis:
            return '{}({})'.format(indent, values)
        return '{}{}'.format(indent, values)
98445
def safestr(value):
    ''''''
    if not value or isinstance(value, (int, float, bool, long)):
        return value
    elif isinstance(value, (date, datetime)):
        return value.isoformat()
    else:
        return unicode(value)
201142
def getvalue(self) -> str:
        """"""
        return self.buffer.byte_buf.decode(encoding=self.encoding, errors=self.errors)
656489
def _value_format(self, value):
        """"""
        return super(VerticalPyramid, self)._value_format(value and abs(value))
1183047
def format_value(self, value, padding):
        """"""

        # padding = padding - 1 if value < 0 and padding > 0 else padding
        # prefix = '-' if value < 0 else ''

        if padding:
            return "{:0{pad}d}".format(value, pad=padding)

        else:
            return str(value)
741237
public String formatValue(ReportValue val) {
      if (log.isLoggable(Level.FINE) || debug) {
         log.fine("raw: " + val + ", formatted: " + doFormatValue(val));
      }
      return doFormatValue(val);
   }
790433
def ConvertToWireFormat(self, value):
    """"""
    data = value.SerializeToString()
    return (self.encoded_tag, VarintEncode(len(data)), data)
118225
def formatted_value(value, format, width)
      value_str = value ? format(format, value) : ' ' * width # all space for nil value
      length = value_str.length
      if length > width
        value_str.slice(0..width - 1)
      elsif length < width
        ' ' * (width - length) + value_str
      else
        value_str
      end
    end
797404
function getFormattedValue(value) {
            let format;

            if (isInteger(value)) {
                format = formatIntegerValue;
            } else {
                format = formatDecimalValue;
            }

            return format(value);
        }
767987
def _value_format(self, value):
        """"""
        return super(Funnel, self)._value_format(value and abs(value))
561219
def value(self):
        
        if isinstance(self.raw_value, (datetime.datetime, datetime.date)):
            return self.raw_value.isoformat()
        elif isinstance(self.raw_value, (bool,)):
            return 'Yes' if self.raw_value else 'No'
        return self.raw_value