def valid_lock(self):
        """
        See if the lock exists and is left over from an old process.
        """

        lock_pid = self.get_lock_pid()

        # If we're unable to get lock_pid
        if lock_pid is None:
            return False

        # this is our process
        if self._pid == lock_pid:
            return True

        # it is/was another process
        # see if it is running
        try:
            os.kill(lock_pid, 0)
        except __HOLE__:
            self.release()
            return False

        # it is running
        return True
dataset/ETHPy150Open ui/django-post_office/post_office/lockfile.py/FileLock.valid_lock