code: def lookup_command(cmdname, mode):
      
      if cmdname in COMMANDS[mode]:
          return COMMANDS[mode][cmdname]
      elif cmdname in COMMANDS['global']:
          return COMMANDS['global'][cmdname]
      else:
          return None, None, None
docs: returns commandclass, argparser and forced parameters used to construct
      a command for `cmdname` when called in `mode`.
  
      :param cmdname: name of the command to look up
      :type cmdname: str
      :param mode: mode identifier
      :type mode: str
      :rtype: (:class:`Command`, :class:`~argparse.ArgumentParser`,
              dict(str->dict))