code: def _format_subtree(self, subtree):
          
          subtree['children'] = list(subtree['children'].values())
          for child in subtree['children']:
              self._format_subtree(child)
          return subtree
docs: Recursively format all subtrees.