<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wrap(self, data):
 """ Wraps and consumes an arbitrary dictionary into the model. """

        for name, field in self.fields:
            try:
                self._state[name] = field.consume(
                    self._state.get(name, None), data[name])
            except KeyError:
                self._state[name] = None