code: def _get_events(self):
          
          events, changed_container_ids = self.docker_util.get_events()
          if not self._disable_net_metrics:
              self._invalidate_network_mapping_cache(events)
          if changed_container_ids and self._service_discovery:
              get_sd_backend(self.agentConfig).update_checks(changed_container_ids)
          if changed_container_ids:
              self.metadata_collector.invalidate_cache(events)
          return events
docs: Get the list of events.