code: def _event_received(self, ref, data):
          
          match = self._resolve_match_data(ref, data)
          if match:
              if self.flag_to_set:
                  self.flag_to_set.set()
              if self.callback:
                  self.callback(EventMatch(ref, data, match))
              if self.__forget:
                  self.forget()
docs: Handle received event.
  
          :param ref: ref is the object that generated the event.
          :param data: event data.
          :return: Nothing.