code: def merge_partition(self, partition, path, value):
          
          dct = self.partitions[partition]
          *heads, tail = path
          for part in heads:
              dct = dct.setdefault(part, dict())
          dct[tail] = value
docs: Merge a value into a partition for a key path.