def is_true(val):
 return ((val is True) or (val in ['True', 'true', 'T', 't']))

def is_true ( val ) : return ( ( val is True ) or ( val in [ 'True' , 'true' , 'T' , 't' ] ) )
returns true if input is a boolean and true or is a string and looks like a true value .