code: def test_bool_arg(
      value: Optional[Union[bool, str]],
      default: bool,
      expected_result: bool,
  ):
      request = Mock()
      request.args = {}
      if value is not None:
          request.args = {"key": value}
      assert (
          endpoint_utils.bool_arg(request, "key", default)
          == expected_result
      )
  
file_path: rasa/tests/utils/test_endpoints.py
imports: import logging
  from pathlib import Path
  from typing import Text, Optional, Union
  from unittest.mock import Mock
  import pytest
  from aioresponses import aioresponses
  from rasa.shared.exceptions import FileNotFoundException
  from tests.utilities import latest_request, json_of_latest_request
  import rasa.utils.endpoints
label_desc: Use image node_id 8 for calling a global function with example usage: test_bool_arg(value, default, expected_result) without return types