def get_processes(self):
        """Get the processes running on the device.

        Returns a dictionary (PID, Process)."""
        processes = {}
        # Get ps output
        cmd = ["ps", "-Z"]
        # Split by newlines and remove first line ("LABEL USER PID PPID NAME")
        # TODO: surround with try/except?
        psz = subprocess.check_output(self.shell + cmd).split('\n')[1:]
        for line in psz:
            line = line.strip("\r")
            if line:
                try:
                    p = Process(line, self.android_version)
                except __HOLE__ as e:
                    self.log.warning(e)
                else:
                    processes[p.pid] = p
        return processes
dataset/ETHPy150Open seandroid-analytics/seal/sealib/device.py/Device.get_processes