human
Complete this python program:
def _assert_pid_not_reused(fun):
assistant
#Here is the Python code you requested.

    """Decorator which raises NoSuchProcess in case a process is no
    longer running or its PID has been reused.
    """
    @functools.wraps(fun)
    def wrapper(self, *args, **kwargs):
        if (not self.is_running()):
            raise NoSuchProcess(self.pid, self._name)
        return fun(self, *args, **kwargs)
    return wrapper