def attach_property(clusters, d, p):
    """
    Attach `p` to `c.properties[d]` for each `c` in `clusters`.
    """
    processed = []
    for c in clusters:
        properties = dict(c.properties)
        properties[d] = set(properties[d]) | {p}
        processed.append(c.rebuild(properties=properties))

    return processed