code: def finalize(self, errs):
          
          for group, value in self._groups.items():
              doc = {'group': group, 'value': value}
              self._target_coll.update({'group': group}, doc, upsert=True)
          return True
docs: Update target collection with calculated maximum values.