def get_process_list(self):
        process_list = []
        for p in psutil.process_iter():
            mem = p.memory_info()
            
            # psutil throws a KeyError when the uid of a process is not associated with an user.
            try:
                username = p.username()
            except __HOLE__:
                username = None

            proc = {
                'pid': p.pid,
                'name': p.name(),
                'cmdline': ' '.join(p.cmdline()),
                'user': username,
                'status': p.status(),
                'created': p.create_time(),
                'mem_rss': mem.rss,
                'mem_vms': mem.vms,
                'mem_percent': p.memory_percent(),
                'cpu_percent': p.cpu_percent(0)
            }
            process_list.append(proc)

        return process_list
dataset/ETHPy150Open Jahaja/psdash/psdash/node.py/LocalService.get_process_list