code: def str_arg_to_bool(value):
      
      if value.lower() in ["y", "yes", "true", "1", "t"]:
          return True
      elif value.lower() in ["n", "no", "false", "0", "f"]:
          return False
      else:
          raise argparse.ArgumentTypeError("Boolean value expected.")
docs: Convert string argument into a boolean values.
      :param value: str value to convert. Allowed values are y, yes, true, 1, t, n, no, false, 0, f.
      The implementation is case insensitive.
      :raises: argparse.ArgumentTypeError if value is not recognized as a boolean.
      :return: boolean