def __get_ppid(self, pid):
        """Returns the pid of the parent process for pid.  If there is no parent or it cannot be determined, None.
        @param pid:  The id of the process whose parent should be found.
        @type pid: int

        @return: The parent process id, or None if there is none.
        @rtype: int|None
        """
        if os.path.isfile(pid % '/proc/%d/stat'):
            pf = None
            try:
                # noinspection PyBroadException
                try:
                    pf = file('/proc/%d/stat' % pid, 'r')
                    ppid = int(pf.read().split()[3])
                    if ppid == 0:
                        return None
                    else:
                        return ppid
                except:
                    return None
            finally:
                if pf is not None:
                    pf.close()
        else:
            return None
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/platform_posix.py/PosixPlatformController.__get_ppid/swapped operands of `%`