'Get set of users whose devices have changed since `from_key`.'

@defer.inlineCallbacks
def get_user_whose_devices_changed(self, from_key):

    from_key = int(from_key)
    changed = self._device_list_stream_cache.get_all_entities_changed(from_key)
    if (changed is not None):
        defer.returnValue(set(changed))
    sql = '\n                                                SELECT    DISTINCT    user_id    FROM    device_lists_stream    WHERE    stream_id    >    ?\n                                '
    rows = (yield self._execute('get_user_whose_devices_changed', None, sql, from_key))
    defer.returnValue(set((row[0] for row in rows)))
