code: def tree_to_dict(cls, tree):
          
          specs = {}
          for k in tree.keys():
              spec_key = '.'.join(k)
              specs[spec_key] = {}
              for grp in tree[k].groups:
                  kwargs = tree[k].groups[grp].kwargs
                  if kwargs:
                      specs[spec_key][grp] = kwargs
          return specs
docs: Given an OptionTree, convert it into the equivalent dictionary format.