code: def format_options(self, scope, description, option_registrations_iter):
      
      oshi = HelpInfoExtracter(self._scope).get_option_scope_help_info(option_registrations_iter)
      lines = []
      def add_option(category, ohis):
        if ohis:
          lines.append('')
          display_scope = scope or 'Global'
          if category:
            lines.append(self._maybe_blue('{} {} options:'.format(display_scope, category)))
          else:
            lines.append(self._maybe_blue('{} options:'.format(display_scope)))
            if description:
              lines.append(description)
          lines.append(' ')
          for ohi in ohis:
            lines.extend(self.format_option(ohi))
      add_option('', oshi.basic)
      if self._show_recursive:
        add_option('recursive', oshi.recursive)
      if self._show_advanced:
        add_option('advanced', oshi.advanced)
      return lines
docs: Return a help message for the specified options.
  
      :param option_registrations_iter: An iterator over (args, kwargs) pairs, as passed in to
                                        options registration.