def _assign_id_if_needed(self, d, pool):
        # Also enforces string IDs
        if d.get('id') is None:
            did = str(counter(pool))
            while did in self._seen_ids[pool]:
                did = str(counter(pool))
            d['id'] = did
            self._seen_ids[pool].add(did)
        else:
            d['id'] = str(d['id'])


# Modifying the yaml parser to use  an OrderedDict, rather then regular Python
# dict for mappings. This preservers the order in which the items are
# specified. See
#   http://stackoverflow.com/a/21048064
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/core/agenda.py/Agenda._assign_id_if_needed/original