code: def get_leaves(self):
          
          ret_set = set()
          for val in self.values():
              if isinstance(val, self.__class__):
                  ret_set |= val.get_leaves()
              elif isinstance(val, dict):
                  ret_set |= set(val.values())
              elif isinstance(val, list):
                  ret_set |= set(val)
              elif isinstance(val, set):
                  ret_set |= val
              else:
                  ret_set.add(val)
          return ret_set
docs: Get the deepest entries as a flat set.