docs: def sub_menu(
      context, menuitem_or_page, use_specific=None, allow_repeating_parents=None,
      apply_active_classes=None, template='', use_absolute_page_urls=None,
      add_sub_menus_inline=None, **kwargs
  ):
      """
      Retrieve the children pages for the `menuitem_or_page` provided, turn them
      into menu items, and render them to a template.
      """
      validate_supplied_values('sub_menu', use_specific=use_specific,
                               menuitem_or_page=menuitem_or_page)
  
      max_levels = context.get(
          'max_levels', settings.DEFAULT_CHILDREN_MENU_MAX_LEVELS
      )
  
      if use_specific is None:
          use_specific = context.get(
              'use_specific', constants.USE_SPECIFIC_AUTO)
  
      if apply_active_classes is None:
          apply_active_classes = context.get('apply_active_classes', True)
  
      if allow_repeating_parents is None:
          allow_repeating_parents = context.get('allow_repeating_parents', True)
  
      if use_absolute_page_urls is None:
          use_absolute_page_urls = context.get('use_absolute_page_urls', False)
  
      if add_sub_menus_inline is None:
          add_sub_menus_inline = context.get('add_sub_menus_inline', False)
  
      if isinstance(menuitem_or_page, Page):
          parent_page = menuitem_or_page
      else:
          parent_page = menuitem_or_page.link_page
  
      original_menu = context.get('original_menu_instance')
      if original_menu is None:
          raise SubMenuUsageError()
  
      menu_class = original_menu.get_sub_menu_class()
      return menu_class.render_from_tag(
          context=context,
          parent_page=parent_page,
          max_levels=max_levels,
          use_specific=use_specific,
          apply_active_classes=apply_active_classes,
          allow_repeating_parents=allow_repeating_parents,
          use_absolute_page_urls=use_absolute_page_urls,
          add_sub_menus_inline=add_sub_menus_inline,
          template_name=template,
          **kwargs
      )