class_docstr: A HelpFormatter with a couple of changes to meet our needs.
      
code: def _format_action_invocation(self, action):
      if not action.option_strings:
          (metavar,) = self._metavar_formatter(action, action.dest)(1)
          return metavar
  
      else:
          parts = []
  
          # if the Optional doesn't take a value, format is:
          #    -s, --long
          if action.nargs == 0:
              parts.extend(action.option_strings)
  
          # if the Optional takes a value, format is:
          #    -s ARGS, --long ARGS
          else:
              default = action.dest.upper()
              args_string = self._format_args(action, default)
              # IPYTHON MODIFICATION: If args_string is not a plain name, wrap
              # it in <> so it's valid RST.
              if not NAME_RE.match(args_string):
                  args_string = "<%s>" % args_string
              for option_string in action.option_strings:
                  parts.append("%s %s" % (option_string, args_string))
  
          return ", ".join(parts)
  
imports: import argparse
  import re
  from IPython.core.error import UsageError
  from IPython.utils.decorators import undoc
  from IPython.utils.process import arg_split
  from IPython.utils.text import dedent
label_desc: Use image node_id 2 for calling the MagicHelpFormatter obj's underlying member method code with example usage: obj._format_action_invocation(action) and returns: metavar, str