def setup_local_stubs(self, connection):
        if self.active_stubs == 'local':
            return

        from .base import get_datastore_paths
        from google.appengine.tools import dev_appserver_main
        args = dev_appserver_main.DEFAULT_ARGS.copy()
        args.update(get_datastore_paths(connection.settings_dict))
        args.update(connection.settings_dict.get('DEV_APPSERVER_OPTIONS', {}))
        log_level = logging.getLogger().getEffectiveLevel()
        logging.getLogger().setLevel(logging.WARNING)

        try:
            from google.appengine.tools import dev_appserver
        except __HOLE__:
            from google.appengine.tools import old_dev_appserver as dev_appserver
        dev_appserver.SetupStubs('dev~' + appid, **args)
        logging.getLogger().setLevel(log_level)
        self.active_stubs = 'local'
dataset/ETHPy150Open django-nonrel/djangoappengine/djangoappengine/db/stubs.py/StubManager.setup_local_stubs