code: def run(local_mode):
      app = web.Application(middlewares=[monitor_endpoints_middleware])
  
      if local_mode:
          log.error(
              "running in local mode with bogus cookie storage key"
          )
          aiohttp_session.setup(
              app,
              aiohttp_session.cookie_storage.EncryptedCookieStorage(
                  b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                  cookie_name=deploy_config.auth_session_cookie_name(),
                  secure=True,
                  httponly=True,
                  domain=os.environ["HAIL_DOMAIN"],
                  # 2592000s = 30d
                  max_age=2592000,
              ),
          )
      else:
          setup_aiohttp_session(app)
  
      setup_aiohttp_jinja2(
          app,
          "website",
          jinja2.PackageLoader("website", "pages"),
          jinja2.PackageLoader("website", "docs"),
      )
      setup_common_static_routes(routes)
      app.on_startup.append(on_startup)
      app.on_cleanup.append(on_cleanup)
      app.add_routes(routes)
      app.router.add_get("/metrics", server_stats)
      sass_compile("website")
      web.run_app(
          deploy_config.prefix_application(app, "www"),
          host="0.0.0.0",
          port=int(os.environ.get("PORT", 5000)),
          access_log_class=AccessLogger,
          ssl_context=None
          if local_mode
          else internal_server_ssl_context(),
      )
  
file_path: hail/website/website/website.py
imports: import logging
  import os
  from typing import Set
  import aiohttp_session
  import aiohttp_session.cookie_storage
  import jinja2
  from aiohttp import web
  from prometheus_async.aio.web import server_stats
  from gear import AuthServiceAuthenticator, monitor_endpoints_middleware, setup_aiohttp_session
  from hailtop import httpx
  from hailtop.config import get_deploy_config
  from hailtop.hail_logging import AccessLogger
  from hailtop.tls import internal_server_ssl_context
  from web_common import render_template, sass_compile, setup_aiohttp_jinja2, setup_common_static_routes
label_desc: Use image node_id 3 for calling a global function with example usage: run(local_mode) without return types