parameters: (self, image)
return_statement: return mask
docstring: Load image mask if it exists, otherwise return None.
docstring_summary: Load image mask if it exists, otherwise return None.
docstring_tokens: Load image mask if it exists otherwise return None .
function: def load_mask(self, image):
          """Load image mask if it exists, otherwise return None."""
          if image in self.mask_files:
              mask_path = self.mask_files[image]
              mask = io.imread(mask_path, grayscale=True)
              if mask is None:
                  raise IOError("Unable to load mask for image {} "
                                "from file {}".format(image, mask_path))
          else:
              mask = None
          return mask
function_tokens: def load_mask ( self , image ) : if image in self . mask_files : mask_path = self . mask_files [ image ] mask = io . imread ( mask_path , grayscale = True ) if mask is None : raise IOError ( "Unable to load mask for image {} " "from file {}" . format ( image , mask_path ) ) else : mask = None return mask