code: def bool_str() -> Callable:
      """
      Returns a method that can be used in argument parsing to check that the argument is a valid representation of
      a boolean value.
  
      :return: A method that can be used as a type in argparse.
      """
  
      def parse(value: str):
          lower_value = value.lower()
          if lower_value in ["true", "yes", "1"]:
              return True
          elif lower_value in ["false", "no", "0"]:
              return False
          else:
              raise argparse.ArgumentTypeError(
                  "Invalid value for bool argument. Use true/false, yes/no or 1/0."
              )
  
      return parse
  
imports: import argparse
  import os
  import sys
  import types
  from typing import Any, Callable, Dict, List, Tuple, Optional
  import yaml
  from sockeye.utils import smart_open
  from .None import constants
label_desc: Use image node_id 7 for calling a global function with example usage: bool_str() and returns: parse, True, False