import time


def wait_for_channel_states(medialive, channel_id, states):
    """
    Wait for a MediaLive channel to be in a specified state.
    """
    current_state = ''
    while current_state not in states:
        time.sleep(5)
        current_state = medialive.describe_channel(ChannelId=channel_id)['State']
    return current_state