def METHOD_NAME(account, msgs_list):
    """wait for one or more MSGS_CHANGED events to match msgs_list contents."""
    account.log(f"waiting for msgs_list={msgs_list}")
    msgs_list = list(msgs_list)
    while msgs_list:
        ev = account._evtracker.get_matching("DC_EVENT_MSGS_CHANGED")
        for i, (data1, data2) in enumerate(msgs_list):
            if ev.data1 == data1:
                if data2 is None or ev.data2 == data2:
                    del msgs_list[i]
                    break
        else:
            account.log(f"waiting mismatch data1={data1} data2={data2}")
    return ev.data1, ev.data2