def cluster_index_resolver():
    for (group, color) in group_iter:
        if isinstance(group, (int, long)):
            group = clustering[group]
        (yield (group, color))
def cluster_index_resolver():
    for (group, color) in group_iter:
        if isinstance(group, (int, long)):
            group = clustering[group]
        (yield (group, color))