code: def base_app(import_name, instance_path=None, static_folder=None,
               static_url_path='/static', template_folder='templates',
               instance_relative_config=True, app_class=Flask):
      
      configure_warnings()
  
      # Create the Flask application instance
      app = app_class(
          import_name,
          instance_path=instance_path,
          instance_relative_config=instance_relative_config,
          static_folder=static_folder,
          static_url_path=static_url_path,
          template_folder=template_folder,
      )
  
      # Create instance path if it doesn't exists
      try:
          if instance_path and not os.path.exists(instance_path):
              os.makedirs(instance_path)
      except Exception:  # pragma: no cover
          app.logger.exception(
              'Failed to create instance folder: "{0}"'.format(instance_path)
          )
  
      return app
docs: Invenio base application factory.
  
      If the instance folder does not exists, it will be created.
  
      :param import_name: The name of the application package.
      :param env_prefix: Environment variable prefix.
      :param instance_path: Instance path for Flask application.
      :param static_folder: Static folder path.
      :param app_class: Flask application class.
      :returns: Flask application instance.
  
      .. versionadded: 1.0.0