def argToBool(x):
 if isinstance(x, six.string_types):
  if (x.lower() in (u'0', u'false', u'f', u'no', u'n', u'off')):
   return False
  elif (x.lower() in (u'1', u'true', u't', u'yes', u'y', u'on')):
   return True
  raise ValueError(u'failed to cast as boolean')
 return bool(x)

def argToBool ( x ) : if isinstance ( x , six . string_types ) : if ( x . lower ( ) in ( u'0' , u'false' , u'f' , u'no' , u'n' , u'off' ) ) : return False elif ( x . lower ( ) in ( u'1' , u'true' , u't' , u'yes' , u'y' , u'on' ) ) : return True raise ValueError ( u'failed to cast as boolean' ) return bool ( x )
convert argument of unknown type to a bool: .