def all_engines(f):

    def decorated(self):
        old = self.use_all_engines
        self.use_all_engines = True
        try:
            f(self)
        finally:
            self.use_all_engines = old
    return decorated
def all_engines(f):

    def decorated(self):
        old = self.use_all_engines
        self.use_all_engines = True
        try:
            f(self)
        finally:
            self.use_all_engines = old
    return decorated