def METHOD_NAME(spawngroups):
    '''Adds missing weights to classes without copying the data.'''
    for container in spawngroups:
        if 'entries' not in container:
            container['entries'] = list()
            continue
        for entry in container['entries']:
            class_num = len(entry['classes'])
            weight_num = len(entry['classWeights'])
            # Remove excess weights if present
            if weight_num > class_num:
                entry['classWeights'] = entry['classWeights'][:class_num]
            # Grow the weights to match number of classes
            elif weight_num < class_num:
                entry['classWeights'] += [1] * (class_num-weight_num)