<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_states(self, result):
 """Get states of devices."""

        if 'devices' not in result.keys():
            return

        for device_states in result['devices']:
            device = self.__devices[device_states['deviceURL']]
            try:
                device.set_active_states(device_states['states'])
            except KeyError:
                pass