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

    """Many methods on fetch strategies require a stage to be set
    using set_stage().  This decorator adds a check for self.stage.
    """
    @wraps(fun)
    def wrapper(self, *args, **kwargs):
        if (not self.stage):
            raise NoStageError(fun)
        return fun(self, *args, **kwargs)
    return wrapper