class_docstr: Displays children each on a separate accordion tab.
code: def _reset_selected_index(self):
      # if there are no tabs, then none should be selected
      num_children = len(self.children)
      if num_children == 0:
          self.selected_index = None
  
      # if there are tabs, but none is selected, select the first one
      elif self.selected_index == None:
          self.selected_index = 0
  
      # if there are tabs and a selection, but the selection is no longer
      # valid, select the last tab.
      elif num_children < self.selected_index:
          self.selected_index = num_children - 1
  
imports: from .widget_box import Box
  from .widget import register
  from .widget_core import CoreWidget
  from traitlets import Unicode, Dict, CInt, TraitError, validate, observe
  from .trait_types import TypedTuple
  from itertools import chain, repeat, islice
label_desc: Use image node_id 2 for calling the Tab obj's underlying member method code with example usage: obj._reset_selected_index() without return types