'Checks if pid is a descendant of the current process.
:param pid: process id to check
:type pid: int
:rtype: bool'

def _is_descendant_process(self, pid):

    try:
        return (psutil.Process(pid) in psutil.Process().children(recursive=True))
    except psutil.NoSuchProcess:
        return False
