def _get_bolean_mask(self, mask):
if mask.dtype.kind == '<STR_LIT:f>':<EOL><INDENT>warnings.warn("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if mask.ndim == <NUM_LIT:2>:<EOL><INDENT>boolean_mask = mask == <NUM_LIT:255><EOL><DEDENT>elif mask.ndim == <NUM_LIT:3>:<EOL><INDENT>boolean_mask = np.all(mask[:, :, :<NUM_LIT:3>] == <NUM_LIT:255>, axis=-<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % str(mask.shape))<EOL><DEDENT>return boolean_mask<EOL>
Cast to two dimensional boolean mask.