code: def get_app_instance(request):
      
      app = None
      if getattr(request, 'current_page', None) and request.current_page.application_urls:
          app = apphook_pool.get_apphook(request.current_page.application_urls)
      if app and app.app_config:
          try:
              config = None
              with override(get_language_from_request(request, check_path=True)):
                  namespace = resolve(request.path_info).namespace
                  config = app.get_config(namespace)
              return namespace, config
          except Resolver404:
              pass
      return '', None
docs: Returns a tuple containing the current namespace and the AppHookConfig instance
  
      :param request: request object
      :return: namespace, config