def is_sequence_of_booleans(obj):
 if (not cbook.iterable(obj)):
  return False
 _it = (isinstance(x, bool) for x in obj)
 if all(_it):
  return True
 return False

def is_sequence_of_booleans ( obj ) : if ( not cbook . iterable ( obj ) ) : return False _it = ( isinstance ( x , bool ) for x in obj ) if all ( _it ) : return True return False
return true if *obj* is array-like and contains boolean values .