

def get_system_users():
    'Return currently connected users as a list of namedtuples.'
    retlist = []
    rawlist = _psutil_linux.get_system_users()
    for item in rawlist:
        (user, tty, hostname, tstamp, user_process) = item
        if (not user_process):
            continue
        if (hostname == ':0.0'):
            hostname = 'localhost'
        nt = nt_user(user, (tty or None), hostname, tstamp)
        retlist.append(nt)
    return retlist

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