def _update_group_components(self):
    for (groupid, conn_components) in groupby(set(self._group.values()), key=(lambda group: group.groupid)):
        n_components = self.workflow.group_components.get(groupid, 1)
        if (n_components > 1):
            for chunk in group_into_chunks(n_components, conn_components):
                if (len(chunk) > 1):
                    primary = chunk[0]
                    for secondary in chunk[1:]:
                        primary.merge(secondary)
                    for j in primary:
                        self._group[j] = primary
def _update_group_components(self):
    for (groupid, conn_components) in groupby(set(self._group.values()), key=(lambda group: group.groupid)):
        n_components = self.workflow.group_components.get(groupid, 1)
        if (n_components > 1):
            for chunk in group_into_chunks(n_components, conn_components):
                if (len(chunk) > 1):
                    primary = chunk[0]
                    for secondary in chunk[1:]:
                        primary.merge(secondary)
                    for j in primary:
                        self._group[j] = primary