code: def _unpack_paths(cls, objs, items, counts):
          
          if type(objs) is cls:
              objs = objs.items()
          for item in objs:
              path, obj = item if isinstance(item, tuple) else (None, item)
              if type(obj) is cls:
                  cls._unpack_paths(obj, items, counts)
                  continue
              new = path is None or len(path) == 1
              path = util.get_path(item) if new else path
              new_path = util.make_path_unique(path, counts, new)
              items.append((new_path, obj))
docs: Recursively unpacks lists and ViewableTree-like objects, accumulating
          into the supplied list of items.