'Helper function for merging.'

def _merge_alocs(self, other_region):

    merging_occurred = False
    for (aloc_id, aloc) in other_region.alocs.iteritems():
        if (aloc_id not in self.alocs):
            self.alocs[aloc_id] = aloc.copy()
            merging_occurred = True
        else:
            merging_occurred |= self.alocs[aloc_id].merge(aloc)
    return merging_occurred
