def extract_tag_indexes(tag_seq, b_tag, i_tag):
    """
    Returns index of B-LOC and I-LOC, I-LOC = -1 if no I-LOC exist
    """
    i_tag_index = -1  # default value
    b_tag_index = tag_seq.index(b_tag)
    if b_tag_index == len(tag_seq) - 1:
        i_tag_index = b_tag_index
        return b_tag_index, i_tag_index  # case when B-LOC at the end of tag_sequence", no I-LOC
    if tag_seq[b_tag_index + 1] == "O":
        i_tag_index = b_tag_index  # case when B-LOC in the middle but no "I-LOC"
        return b_tag_index, i_tag_index
    else:
        for i in range(b_tag_index + 1, len(tag_seq)):
            if tag_seq[i] == i_tag:
                i_tag_index = i  # return index of last I-LOC
        return b_tag_index, i_tag_index