

def swap_memory():
    (_, _, _, _, total, free) = _psutil_linux.get_sysinfo()
    used = (total - free)
    percent = usage_percent(used, total, _round=1)
    f = open('/proc/vmstat', 'r')
    sin = sout = None
    try:
        for line in f:
            if line.startswith('pswpin'):
                sin = ((int(line.split(' ')[1]) * 4) * 1024)
            elif line.startswith('pswpout'):
                sout = ((int(line.split(' ')[1]) * 4) * 1024)
            if ((sin is not None) and (sout is not None)):
                break
        else:
            raise RuntimeError('line(s) not found')
    finally:
        f.close()
    return nt_swapmeminfo(total, used, free, percent, sin, sout)

dataset/ETHPy150Open packages/psutil/psutil/_pslinux.py swap_memory/original