code: def _checked_mode2int(mode, cval, fname):
      if mode not in modes:
          raise ValueError(
              "mahotas.%s: `mode` not in %s" % (fname, modes)
          )
      if mode == "constant" and cval != 0.0:
          raise NotImplementedError(
              "Please email mahotas developers to get this implemented."
          )
      return mode2int[mode]
  
label_desc: Use image node_id 1 for calling a global function with example usage: _checked_mode2int(mode, cval, fname) and returns: mode2int