code: def _convert_mode_argument(mode):
      # resolve mode constants, convert to lowercase
      mode = (
          {
              ADJ_DIRECTED: "directed",
              ADJ_UNDIRECTED: "undirected",
              ADJ_MAX: "max",
              ADJ_MIN: "min",
              ADJ_PLUS: "plus",
              ADJ_UPPER: "upper",
              ADJ_LOWER: "lower",
          }
          .get(mode, mode)
          .lower()
      )
  
      if mode not in _SUPPORTED_MODES:
          raise ValueError(
              "mode should be one of " + (" ".join(_SUPPORTED_MODES))
          )
  
      if mode == "undirected":
          mode = "max"
  
      return mode
  
imports: from __future__ import with_statement
  from operator import add
  from igraph._igraph import ADJ_DIRECTED, ADJ_UNDIRECTED, ADJ_MAX, ADJ_MIN, ADJ_PLUS, ADJ_UPPER, ADJ_LOWER
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_mode_argument(mode) and returns: mode