code: def test_str_to_bool():
      # Global bool mappings are used.
      assert strings_utils.str2bool("True")
      assert strings_utils.str2bool(True)
      assert strings_utils.str2bool("true")
      assert not strings_utils.str2bool("0")
  
      # Error raised if non-mapped value is encountered and no fallback is specified.
      with pytest.raises(Exception):
          strings_utils.str2bool("bot")
  
      # Fallback label is used.
      assert strings_utils.str2bool("bot", fallback_true_label="bot")
      assert not strings_utils.str2bool(
          "human", fallback_true_label="bot"
      )
      assert strings_utils.str2bool(
          "human", fallback_true_label="human"
      )
      assert not strings_utils.str2bool(
          "human", fallback_true_label="Human"
      )
  
      # Fallback label is used, strictly as a fallback.
      assert strings_utils.str2bool("True", fallback_true_label="False")
  
file_path: ludwig/tests/ludwig/utils/test_strings_utils.py
imports: from collections import defaultdict
  import numpy
  import pandas
  import pytest
  from ludwig.schema.features.preprocessing.text import TextPreprocessingConfig
  from ludwig.utils import strings_utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_str_to_bool() without return types