code: def str_to_bool(
      string: str, truths: Optional[List[str]] = None
  ) -> bool:
      """Convert a string into a boolean (case insensitively).
  
      Args:
          string: String to convert.
          truths: List of strings that count as Truthy; defaults to "yes" and "y".
  
      Returns:
          ``True`` if string is in truths; otherwise, returns ``False``. All strings
          are compared in lowercase, so the method is case insensitive.
      """
      truths = truths or ["yes", "y"]
      return string.lower() in [t.lower() for t in truths]
  
imports: import os
  import sys
  from contextlib import contextmanager
  from enum import EnumMeta, IntEnum
  from typing import Any, Dict, List, Optional, Union
  import requests
  from tqdm import tqdm
label_desc: Use image node_id 5 for calling a global function with example usage: str_to_bool(string, truths) and returns: unknown