def pp(i, base=1024):
    """
    Pretty-print the integer `i` as a human-readable size representation.
    """
    degree = 0
    pattern = '%4d     %s'
    while i > base:
        pattern = '%7.2f %s'
        i = i / float(base)
        degree += 1
    scales = ['B', 'KB', 'MB', 'GB', 'TB', 'EB']
    return pattern % (i, scales[degree])
