parameters: (self, argument)
docstring: Converts the argument to a boolean; raise ValueError on errors.
docstring_summary: Converts the argument to a boolean; raise ValueError on errors.
docstring_tokens: Converts the argument to a boolean ; raise ValueError on errors .
function: def Convert(self, argument):
      """Converts the argument to a boolean; raise ValueError on errors."""
      if type(argument) == str:
        if argument.lower() in ['true', 't', '1']:
          return True
        elif argument.lower() in ['false', 'f', '0']:
          return False
  
      bool_argument = bool(argument)
      if argument == bool_argument:
        # The argument is a valid boolean (True, False, 0, or 1), and not just
        # something that always converts to bool (list, string, int, etc.).
        return bool_argument
  
      raise ValueError('Non-boolean argument to boolean flag', argument)
function_tokens: def Convert ( self , argument ) : if type ( argument ) == str : if argument . lower ( ) in [ 'true' , 't' , '1' ] : return True elif argument . lower ( ) in [ 'false' , 'f' , '0' ] : return False bool_argument = bool ( argument ) if argument == bool_argument : # The argument is a valid boolean (True, False, 0, or 1), and not just # something that always converts to bool (list, string, int, etc.). return bool_argument raise ValueError ( 'Non-boolean argument to boolean flag' , argument )