def _expected_devices_events(self, devices, state):
        """Helper to check that events are received for expected devices.

        :param devices: The list of expected devices. WARNING: This list
          is modified by this method
        :param state: The state of the devices (added or removed)
        """
        events = self.monitor.get_events()
        event_devices = [
            (dev['name'], dev['external_ids']) for dev in events.get(state)]
        for dev in event_devices:
            if dev[0] == devices:
                devices.remove(dev[0])
                self.assertEqual(dev[1].get('iface-status'), 'active')
            if not devices:
                return True
dataset/ETHPy150Open openstack/neutron/neutron/tests/functional/agent/linux/test_ovsdb_monitor.py/TestSimpleInterfaceMonitor._expected_devices_events/operator `in` -> `==`