#NEWLINE# def boolParam( self , key , params , default = None ) : #NEWLINE# #INDENT# "\n        Coerce a parameter value from a str to a bool. This function is case\n        insensitive. The following string values will be interpreted as True:\n\n          - ``'true'``\n          - ``'on'``\n          - ``'1'``\n          - ``'yes'``\n\n        All other strings will be interpreted as False. If the given param\n        is not passed at all, returns the value specified by the default arg.\n        " #NEWLINE# if ( key not in params ) : #NEWLINE# #INDENT# return default #NEWLINE# #UNINDENT# val = params [ key ] #NEWLINE# if isinstance ( key , bool ) : #NEWLINE# #INDENT# return val #NEWLINE# #UNINDENT# return ( val . lower ( ) . strip ( ) in ( 'true' , 'on' , '1' , 'yes' ) )