@staticmethod
  def _GetSectionOrder(explicit_order, sections):
    order = explicit_order or []
    default_order = [
      'intro',
      'config',
      'commands',
      'autocmds',
      'settings',
      'dicts',
      'functions',
      'exceptions',
      'mappings']
    # Add any undeclared sections before custom sections, except 'about' which
    # comes at the end by default.
    section_insertion_idx = 0
    order = order[:]
    for builtin in default_order:
      if builtin in order:
        # Section already present. Skip and continue later sections after it.
        section_insertion_idx = order.index(builtin) + 1
        continue
      else:
        # If section present, insert into order at logical index.
        if builtin in sections:
          order.insert(section_insertion_idx, builtin)
          section_insertion_idx += 1
    if 'about' in sections and 'about' not in order:
      order.append('about')
    return order
Gets final section order from explicit_order and actual sections present.
dataset/ETHPy150Open google/vimdoc/vimdoc/module.py/Module._GetSectionOrder