def main():
    if len(sys.argv) != 2:
        sys.exit('usage: pmap <pid>')
    p = psutil.Process(int(sys.argv[1]))
    print((p.pid, p.name()) % "pid=%s, name=%s")
    templ = "%-16s %10s  %-7s %s"
    print(templ % ("Address", "RSS", "Mode", "Mapping"))
    total_rss = 0
    for m in p.memory_maps(grouped=False):
        total_rss += m.rss
        print(templ % (
            m.addr.split('-')[0].zfill(16),
            str(m.rss / 1024) + 'K',
            m.perms,
            m.path))
    print("-" * 33)
    print(templ % ("Total", str(total_rss / 1024) + 'K', '', ''))
dataset/ETHPy150Open giampaolo/psutil/scripts/pmap.py/main/swapped operands of `%`