def auto_update(self, callback=None):
        if self.version_finder is None:
            raise NoVersionFinderError
        if callback is None:
            callback = lambda *args: True
        got_root = False
        cleaned = False
        try:
            callback({"status": "searching"})
            version = self.find_update()
            if version is not None:
                callback({"status": "found", "new_version": version})
                #  Try to install the new version.  If it fails with
                #  a permission error, escalate to root and try again.
                try:
                    self._do_auto_update(version, callback)
                except EnvironmentError:
                    exc_type, exc_value, exc_traceback = sys.exc_info()
                    if exc_value.errno != errno.EACCES or self.has_root():
                        raise
                    try:
                        self.get_root()
                    except Exception, e:
                        raise exc_type, exc_value, exc_traceback
                    else:
                        got_root = True
                        self._do_auto_update(version, callback)
                self.reinitialize()
            #  Try to clean up the app dir.  If it fails with a
            #  permission error, escalate to root and try again.
            try:
                callback({"status": "cleaning up"})
                cleaned = self.cleanup()
            except EnvironmentError:
                exc_type, exc_value, exc_traceback = sys.exc_info()
                if exc_value.errno != errno.EACCES or self.has_root():
                    raise
                try:
                    self.get_root()
                except Exception, e:
                    raise exc_type, exc_value, exc_traceback
                else:
                    got_root = True
                    callback({"status": "cleaning up"})
                    cleaned = self.cleanup()
        except Exception, e:
            callback({"status": "error", "exception": e})
            raise
        else:
            callback({"status": "done"})
        finally:
            #  Drop root privileges as soon as possible.
            if not cleaned and self.needs_cleanup():
                self.cleanup_at_exit()
            if got_root:
                self.drop_root()
test function with 2 arguments 2*x+y
dataset/ETHPy150Open cloudmatrix/esky/esky/__init__.py/Esky.auto_update--crossover with--dataset/ETHPy150Open xraypy/xraylarch/tests/test_plugins_call.py/TestPlugins.test2