Check process id to ensure integrity, reset if in new process.

def _check_pid(self, allow_reset=False):
        """Check process id to ensure integrity, reset if in new process."""
        if not self.pid == current_process().pid:
            if allow_reset:
                self.reset()
            else:
                raise RuntimeError("Forbidden operation in multiple processes")