<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _sync_and_resolve(self, config, resolver):
        '''Synchronize all items represented by the config according to the resolver and return a
        set of keys that have been resolved.'''
        resolved = set()
        for key, theirs in config.items(self._name):
            theirs = self._real_value_of(theirs)
            if key in self:
                mine = self[key]
                value = resolver(self._name, key, mine, theirs)
            else:
                value = theirs
            self._set_value(config, key, value)
            resolved.add(key)
        return resolved