code: def get_last_compatible_gui_version() -> LooseVersion:
      logger.debug("Getting last compatible frontend..")
      try:
          res = requests.get(
              "https://mindsdb-web-builds.s3.amazonaws.com/compatible-config.json",
              timeout=5,
          )
      except (
          ConnectionError,
          requests.exceptions.ConnectionError,
      ) as e:
          logger.error(f"Is no connection. {e}")
          return False
      except Exception as e:
          logger.error(
              f"Is something wrong with getting compatible-config.json: {e}"
          )
          return False
  
      if res.status_code != 200:
          logger.error(
              f"Cant get compatible-config.json: returned status code = {res.status_code}"
          )
          return False
  
      try:
          versions = res.json()
      except Exception as e:
          logger.error(f"Cant decode compatible-config.json: {e}")
          return False
  
      current_mindsdb_lv = LooseVersion(mindsdb_version)
  
      try:
          gui_versions = {}
          max_mindsdb_lv = None
          max_gui_lv = None
          for el in versions["mindsdb"]:
              if el["mindsdb_version"] is None:
                  gui_lv = LooseVersion(el["gui_version"])
              else:
                  mindsdb_lv = LooseVersion(el["mindsdb_version"])
                  gui_lv = LooseVersion(el["gui_version"])
                  if (
                      mindsdb_lv.vstring not in gui_versions
                      or gui_lv > gui_versions[mindsdb_lv.vstring]
                  ):
                      gui_versions[mindsdb_lv.vstring] = gui_lv
                  if (
                      max_mindsdb_lv is None
                      or max_mindsdb_lv < mindsdb_lv
                  ):
                      max_mindsdb_lv = mindsdb_lv
              if max_gui_lv is None or max_gui_lv < gui_lv:
                  max_gui_lv = gui_lv
  
          all_mindsdb_lv = [
              LooseVersion(x) for x in gui_versions.keys()
          ]
          all_mindsdb_lv.sort()
  
          if current_mindsdb_lv.vstring in gui_versions:
              gui_version_lv = gui_versions[current_mindsdb_lv.vstring]
          elif current_mindsdb_lv > all_mindsdb_lv[-1]:
              gui_version_lv = max_gui_lv
          else:
              lower_versions = {
                  key: value
                  for key, value in gui_versions.items()
                  if LooseVersion(key) < current_mindsdb_lv
              }
              if len(lower_versions) == 0:
                  gui_version_lv = gui_versions[
                      all_mindsdb_lv[0].vstring
                  ]
              else:
                  all_lower_versions = [
                      LooseVersion(x) for x in lower_versions.keys()
                  ]
                  gui_version_lv = gui_versions[
                      all_lower_versions[-1].vstring
                  ]
      except Exception as e:
          logger.error(
              f"Error in compatible-config.json structure: {e}"
          )
          return False
  
      logger.debug(
          f"Last compatible frontend version: {gui_version_lv}."
      )
      return gui_version_lv
  
imports: import datetime
  import mimetypes
  import os
  import secrets
  import threading
  import traceback
  import webbrowser
  from distutils.version import LooseVersion
  from pathlib import Path
  import requests
  from flask import Flask, url_for, make_response, request, send_from_directory
  from flask.json import dumps
  from flask_compress import Compress
  from flask_restx import Api
  from werkzeug.exceptions import HTTPException
  from mindsdb.__about__ import __version__
  from mindsdb.api.http.gui import update_static
  from mindsdb.api.http.utils import http_error
  from mindsdb.api.http.namespaces.agents import ns_conf
  from mindsdb.api.http.namespaces.analysis import ns_conf
  from mindsdb.api.http.namespaces.auth import ns_conf
  from mindsdb.api.http.namespaces.chatbots import ns_conf
  from mindsdb.api.http.namespaces.config import ns_conf
  from mindsdb.api.http.namespaces.databases import ns_conf
  from mindsdb.api.http.namespaces.default import ns_conf, check_auth
  from mindsdb.api.http.namespaces.file import ns_conf
  from mindsdb.api.http.namespaces.handlers import ns_conf
  from mindsdb.api.http.namespaces.models import ns_conf
  from mindsdb.api.http.namespaces.projects import ns_conf
  from mindsdb.api.http.namespaces.skills import ns_conf
  from mindsdb.api.http.namespaces.sql import ns_conf
  from mindsdb.api.http.namespaces.tab import ns_conf
  from mindsdb.api.http.namespaces.tree import ns_conf
  from mindsdb.api.http.namespaces.views import ns_conf
  from mindsdb.api.http.namespaces.util import ns_conf
  from mindsdb.interfaces.database.integrations import integration_controller
  from mindsdb.interfaces.database.database import DatabaseController
  from mindsdb.interfaces.file.file_controller import FileController
  from mindsdb.interfaces.storage import db
  from mindsdb.utilities import log
  from mindsdb.utilities.config import Config
  from mindsdb.utilities.context import context
  from mindsdb.utilities.json_encoder import CustomJSONEncoder
  from mindsdb.utilities.ps import is_pid_listen_port, wait_func_is_true
  from mindsdb.utilities.telemetry import inject_telemetry_to_static
label_desc: Use image node_id 2 for calling a global function with example usage: get_last_compatible_gui_version() and returns: gui_version_lv, False, False, False, False, False