code: def service_changed(self, event):
          
          if (
              self._ipopo_instance is None
              or not self._ipopo_instance.check_event(event)
          ):
              # stop() and clean() may have been called after we have been put
              # inside a listener list copy...
              # or we've been told to ignore this event
              return
  
          # Call sub-methods
          kind = event.get_kind()
          svc_ref = event.get_service_reference()
  
          if kind == ServiceEvent.REGISTERED:
              # Service coming
              self.on_service_arrival(svc_ref)
  
          elif kind in (
              ServiceEvent.UNREGISTERING,
              ServiceEvent.MODIFIED_ENDMATCH,
          ):
              # Service gone or not matching anymore
              self.on_service_departure(svc_ref)
  
          elif kind == ServiceEvent.MODIFIED:
              # Modified properties (can be a new injection)
              self.on_service_modify(svc_ref, event.get_previous_properties())
docs: Called by the framework when a service event occurs