code: def _get_bool(val) -> bool | None:
      """Convert val to bool if can be done with certainty; if we cannot infer intention we return None."""
      if isinstance(val, bool):
          return val
      elif isinstance(val, str):
          if val.strip().lower() == "true":
              return True
          elif val.strip().lower() == "false":
              return False
      return None
  
imports: from __future__ import annotations
  import contextlib
  import json
  import tempfile
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Generator
  import aiofiles
  from asgiref.sync import sync_to_async
  from kubernetes import client, config, watch
  from kubernetes.config import ConfigException
  from kubernetes_asyncio import client, config
  from urllib3.exceptions import HTTPError
  from airflow.exceptions import AirflowException, AirflowNotFoundException
  from airflow.hooks.base import BaseHook
  from airflow.models import Connection
  from airflow.providers.cncf.kubernetes.kube_client import _disable_verify_ssl, _enable_tcp_keepalive
  from airflow.providers.cncf.kubernetes.utils.pod_manager import PodOperatorHookProtocol
  from airflow.utils import yaml
label_desc: Use image node_id 2 for calling a global function with example usage: _get_bool(val) and returns: None, val, True, False