code: def _pidExists(pid):
          
          assert pid > 0
          try:
              os.kill(pid, 0)
          except OSError as err:
              if err.errno == errno.ESRCH:
                  # ESRCH == No such process
                  return False
              else:
                  raise
          else:
              return True
docs: This will return True if the process associated with pid is still running on the machine.
          This is based on stackoverflow question 568271.
  
          :param int pid: ID of the process to check for
          :return: True/False
          :rtype: bool