def boolean(value):
if isinstance(value, bool):<EOL><INDENT>return value<EOL><DEDENT>if not value:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>value = value.lower()<EOL>if value in ('<STR_LIT:true>', '<STR_LIT:1>',):<EOL><INDENT>return True<EOL><DEDENT>if value in ('<STR_LIT:false>', '<STR_LIT:0>',):<EOL><INDENT>return False<EOL><DEDENT>raise ValueError("<STR_LIT>".format(value))<EOL>
Parse the string ``"true"`` or ``"false"`` as a boolean (case
    insensitive). Also accepts ``"1"`` and ``"0"`` as ``True``/``False``
    (respectively). If the input is from the request JSON body, the type is
    already a native python boolean, and will be passed through without
    further parsing.