docs: def _process_event(event: Event, sdp_state: SDPState,
                     service_states: List[ServiceState]):
      """Process a SDP state change event."""
      LOG.debug('Event detected! (id : "%s", type: "%s", data: "%s")',
                event.object_id, event.type, event.data)
  
      if event.object_id == 'SDP' and event.type == 'current_state_updated':
          LOG.info('SDP current state updated, no action required!')
  
      if event.object_id == 'SDP' and event.type == 'target_state_updated':
          LOG.info("SDP target state changed to '%s'",
                   sdp_state.target_state)
  
          # If the sdp is already in the target state do nothing
          if sdp_state.target_state == sdp_state.current_state:
              LOG.warning('SDP already in %s state',
                          sdp_state.current_state)
              return
  
          # Check that a transition to the target state is allowed in the
          # current state.
          if not sdp_state.is_target_state_allowed(sdp_state.target_state):
              LOG.error('Transition to %s is not allowed when in state %s',
                        sdp_state.target_state, sdp_state.current_state)
              sdp_state.target_state = sdp_state.current_state
              return
  
          _update_services_target_state(sdp_state.target_state)
  
          # If asking SDP to turn off, also turn off services.
          if sdp_state.target_state == 'off':
              LOG.info('Turning off services!')
              for service_state in service_states:
                  service_state.update_target_state('off')
                  service_state.update_current_state('off')
  
          LOG.info('Processing target state change request ...')
          time.sleep(0.1)
          LOG.info('Done processing target state change request!')
  
          # Assuming that the SDP has responding to the target
          # target state command by now, set the current state
          # to the target state.
          sdp_state.update_current_state(sdp_state.target_state)
  
          if sdp_state.current_state == 'alarm':
              LOG.debug('raising SDP state alarm')
              SIP_STATE_ALARM.set(1)
          else:
              SIP_STATE_ALARM.set(0)
          try:
              # FIXME(BMo) the pushgateway host should not be hardcoded!
              push_to_gateway('platform_pushgateway:9091', job='SIP',
                              registry=COLLECTOR_REGISTRY)
          except urllib.error.URLError:
              LOG.warning("Unable to connect to the Alarms service!")