def gen_ep_cheatsheet(convo):
    """
    Generates a cheatsheet for a particular conversation (episode).
    The index and it's significance in the cheatsheet is shown below:
        0: First index of a USER that has an ASSISTANT reply to it
        1: Last index of a USER that has an ASSISTANT reply to it
        2: First index of an ASSISTANT that has a USER reply to it
        3: Last index of an ASSISTANT that has a USER reply to it
        4: Number of examples for USER speech  as text and ASSISTANT speech as label
        5: Number of examples for ASSISTANT speech as text and USER speech  as label
    :param convo:
        The dialogue between USER and ASSISTANT [after smoothening]
    """
    cheatsheet = [-1, -1, -1, -1, 0, 0]
    # Assumed that length of convo is greater than two due to filtering cond
    for idx in range(1, len(convo)):
        # find first USER with reply
        if convo[idx - 1]['speaker'] == "USER" and convo[idx]['speaker'] == "ASSISTANT":
            if cheatsheet[0] == -1:
                cheatsheet[0] = idx - 1
            # find last USER with reply
            cheatsheet[1] = idx - 1
        # find first ASSISTANT with reply
        if convo[idx - 1]['speaker'] == "ASSISTANT" and convo[idx]['speaker'] == "USER":
            if cheatsheet[2] == -1:
                cheatsheet[2] = idx - 1
            # find last ASSISTANT with reply
            cheatsheet[3] = idx - 1

        # Calculate num_examples only if atleast one user was found
        if cheatsheet[1] != -1:
            # Calculate number of user examples
            cheatsheet[4] = (cheatsheet[1] - cheatsheet[0]) // 2 + 1
        # Calculate num_examples only if atleast one user was found
        if cheatsheet[3] != -1:
            # Calculate number of assistant examples
            cheatsheet[5] = (cheatsheet[3] - cheatsheet[2]) // 2 + 1

    return cheatsheet