def format_options(example, start_str, item_names, opt_end_str, opt_delimiter, unanswerable_option, random_seed):
    """Formats options in a variety of ways.
    args:
        start_str: start_str.
        item_names: item_name for each option.
        opt_end_str: end str for each option.

    We take array example["options"] as input, and outputs example["options_"]
    which contains a random format of the options. Note that this supports up to
    26 option items.
    For example:
    example["options"] = [["An apple", "A banana", "A cashew"]]
    example["options_"] can be:
        "Select from below.
           + Eat apple;
           + Eat banana;
           + Eat cashew;"

    Note that we change the answer string too. If the options are:
        A. Eat apple; B. Eat banana;
    Then the answer will be changed from "Eat apple"/"Eat banana" to "A."/"B.".

    Args:
        example: dictionary of inputs. It must have an "options" entry.

    Returns:
        The same example dictionary but with the additional "options_" entry.
    """
    options = copy.deepcopy(example["options"])
    random.Random(random_seed).shuffle(options) # the model tends to generate many gold options at (A) or (C), we try to mitigate this
    # Interleave item_names, options, and opt_end_str.
    options_ = [
        f"{item}{opt}{end}" for item, opt, end in zip(item_names[:len(options)], options, opt_end_str[:len(options)])
    ]

    example["options_"] = "".join([start_str] + options_)

    # Potentially changed the answer string.
    answer = example["answer"]

    # step 1, check if None of the options are correct
    if answer not in options and answer in UNANSWERABLE_OPTIONS:
        example["option_answer"] = unanswerable_option
        return example

    # step 2, check if single label question
    match_arr = [answer.strip() == opt.strip() for opt in options]
    has_match = any(match_arr)

    # Check if the item_names are unique.
    is_abc_style = len(set(item_names)) == len(item_names)

    if has_match == True:
        # single label question
        answer_maybe_abc_style = item_names[match_arr.index(True)].strip() if is_abc_style else answer
        example["option_answer"] = answer_maybe_abc_style
    else:
        raise Exception('no match answers')    

    return example
Formats options in a variety of ways.
    args:
        start_str: start_str.
        item_names: item_name for each option.
        opt_end_str: end str for each option.

    We take array example["options"] as input, and outputs example["options_"]
    which contains a random format of the options. Note that this supports up to
    26 option items.
    For example:
    example["options"] = [["An apple", "A banana", "A cashew"]]
    example["options_"] can be:
        "Select from below.
           + Eat apple;
           + Eat banana;
           + Eat cashew;"

    Note that we change the answer string too. If the options are:
        A. Eat apple; B. Eat banana;
    Then the answer will be changed from "Eat apple"/"Eat banana" to "A."/"B.".

    Args:
        example: dictionary of inputs. It must have an "options" entry.

    Returns:
        The same example dictionary but with the additional "options_" entry.
    
instruction_pretrain/utils/read_compre_pt.py