def pprint_ntuple(nt):
    for name in nt._fields:
        value = getattr(nt, name)
        if name != 'percent':
            value = bytes2human(value)
        print('%-10s : %7s' % (name.capitalize(), value))
dataset/ETHPy150Open giampaolo/psutil/scripts/meminfo.py/pprint_ntuple/original