<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def refresh_keyboard_mapping(self, evt):
 """This method should be called once when a MappingNotify event is received, to update the keymap cache. evt should be the event object."""

        if isinstance(evt, event.MappingNotify):
            if evt.request == X.MappingKeyboard:
                self._update_keymap(evt.first_keycode, evt.count)
        else:
            raise TypeError('expected a MappingNotify event')