original_docstring: 
      Ensures the Django app running Polaris has the correct middleware
      configuration. Polaris requires SessionMiddleware and
      PolarisSameSiteMiddleware to be installed.
      
docstring: Ensures the Django app running Polaris has the correct middleware
  configuration. Polaris requires SessionMiddleware and
  PolarisSameSiteMiddleware to be installed.
docstring_tokens: Ensures the Django app running Polaris has the correct middleware configuration . Polaris requires SessionMiddleware and PolarisSameSiteMiddleware to be installed .
code: def check_middleware():
      """
      Ensures the Django app running Polaris has the correct middleware
      configuration. Polaris requires SessionMiddleware and
      PolarisSameSiteMiddleware to be installed.
      """
      err_msg = "{} is not installed in settings.MIDDLEWARE"
      session_middleware_path = "django.contrib.sessions.middleware.SessionMiddleware"
      if import_path not in django_settings.MIDDLEWARE:
          raise ValueError(err_msg.format(import_path))
      elif session_middleware_path not in django_settings.MIDDLEWARE:
          raise ValueError(err_msg.format(session_middleware_path))
      elif django_settings.MIDDLEWARE.index(
          import_path
      ) > django_settings.MIDDLEWARE.index(session_middleware_path):
          err_msg = f"{import_path} must be listed before {session_middleware_path}"
          raise ValueError(err_msg)
code_tokens: def check_middleware ( ) : err_msg = "{} is not installed in settings.MIDDLEWARE" session_middleware_path = "django.contrib.sessions.middleware.SessionMiddleware" if import_path not in django_settings . MIDDLEWARE : raise ValueError ( err_msg . format ( import_path ) ) elif session_middleware_path not in django_settings . MIDDLEWARE : raise ValueError ( err_msg . format ( session_middleware_path ) ) elif django_settings . MIDDLEWARE . index ( import_path ) > django_settings . MIDDLEWARE . index ( session_middleware_path ) : err_msg = f"{import_path} must be listed before {session_middleware_path}" raise ValueError ( err_msg )
short_docstring: Ensures the Django app running Polaris has the correct middleware
  configuration.
short_docstring_tokens: Ensures the Django app running Polaris has the correct middleware configuration .
comment: """
      Ensures the Django app running Polaris has the correct middleware
      configuration. Polaris requires SessionMiddleware and
      PolarisSameSiteMiddleware to be installed.
      """