docs: def get_parentparser(parser, description=None, help=True):
      """
      :param parser: :class:`argparse.ArgumentParser` instance or None
      :param description: string used to build a new parser if parser is None
      :param help: flag used to build a new parser if parser is None
      :returns: if parser is None the new parser; otherwise the `.parentparser`
                attribute (if set) or the parser itself (if not set)
      """
      if parser is None:
          return argparse.ArgumentParser(
              description=description, add_help=help)
      elif hasattr(parser, 'parentparser'):
          return parser.parentparser
      else:
          return parser