def bool_(val):
 if (isinstance(val, six.string_types) and (val.lower() == 'false')):
  return False
 return bool(val)

def bool_ ( val ) : if ( isinstance ( val , six . string_types ) and ( val . lower ( ) == 'false' ) ) : return False return bool ( val )
like bool .