@staticmethod
def bytes2human(size, repr_format='{value:.2f}{symbol}'):
    """
        >>> bytes2human(10000)
        '9K'
        >>> bytes2human(100001221)
        '95M'
        """
    symbols = 'B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'
    prefix = {}
    for i, symbol in enumerate(symbols[1:]):
        prefix[symbol] = 1 << (i + 1) * 10
    for symbol in reversed(symbols[1:]):
        if size >= prefix[symbol]:
            value = float(size) / prefix[symbol]
            return repr_format.format(value=value, symbol=symbol)
    return repr_format.format(symbol=symbols[0], value=size)
