code: def _process_items(cls, vals):
          "Processes list of items assigning unique paths to each."
          if type(vals) is cls:
              return vals.data
          elif not isinstance(vals, (list, tuple)):
              vals = [vals]
          items = []
          counts = defaultdict(lambda: 1)
          cls._unpack_paths(vals, items, counts)
          items = cls._deduplicate_items(items)
          return itemf _process_items(cls, vals):
          "Processes list of items assigning unique paths to each."
          if type(vals) is cls:
              return vals.data
          elif not isinstance(vals, (list, tuple)):
              vals = [vals]
          items = []
          counts = defaultdict(lambda: 1)
          cls._unpack_paths(vals, items, counts)
          items = cls._deduplicate_items(items)
          return items
docs: Processes list of items assigning unique paths to each.