code: def get_database_ssl_context(sql_config: SQLConfig) -> ssl.SSLContext:
      database_ssl_context = ssl.create_default_context(
          cafile=sql_config.ssl_ca
      )
      if (
          sql_config.ssl_cert is not None
          and sql_config.ssl_key is not None
      ):
          database_ssl_context.load_cert_chain(
              sql_config.ssl_cert,
              keyfile=sql_config.ssl_key,
              password=None,
          )
      database_ssl_context.verify_mode = ssl.CERT_REQUIRED
      database_ssl_context.check_hostname = False
      return database_ssl_context
  
imports: import asyncio
  import contextlib
  import functools
  import logging
  import os
  import ssl
  import traceback
  from typing import Any, AsyncIterator, Awaitable, Callable, Dict, Optional, TypeVar
  import aiomysql
  import aiomysql.utils
  import kubernetes_asyncio.client
  import kubernetes_asyncio.config
  import pymysql
  from typing_extensions import Concatenate, ParamSpec
  from gear.metrics import DB_CONNECTION_QUEUE_SIZE, SQL_TRANSACTIONS, PrometheusSQLTimer
  from hailtop.aiotools import BackgroundTaskManager
  from hailtop.auth.sql_config import SQLConfig
  from hailtop.config import get_deploy_config
  from hailtop.utils import first_extant_file, sleep_before_try
label_desc: Use image node_id 4 for calling a global function with example usage: get_database_ssl_context(sql_config) and returns: database_ssl_context