code: def reverse_opt_map(opt_map):
      """Reverse the key/value pairs of the option map in the interface classes.
  
      Parameters
      ----------
      opt_map : dict
          Dictionary mapping the attribute name to a command line flag.
          Each interface class defines these for the command it wraps.
  
      Returns
      -------
      rev_opt_map : dict
         Dictionary mapping the flags to the attribute name.
      """
  
      # For docs, we only care about the mapping from our attribute
      # names to the command-line flags.  The 'v.split()[0]' below
      # strips off the string format characters.
      # if (k != 'flags' and v) , key must not be flags as it is generic,
      # v must not be None or it cannot be parsed by this line
      revdict = {}
      for key, value in list(opt_map.items()):
          if is_container(value):
              # The value is a tuple where the first element is the
              # format string and the second element is a docstring.
              value = value[0]
          if key != "flags" and value is not None:
              revdict[value.split()[0]] = key
      return revdict
  
file_path: nipype/nipype/utils/docparse.py
imports: import subprocess
  from ..interfaces.base import CommandLine
  from .misc import is_container
label_desc: Use image node_id 2 for calling a global function with example usage: reverse_opt_map(opt_map) and returns: revdict