
    Given a list of paired morning and evening patient readings, determine the number of unique measurement pairs that show matching patterns regardless of whether they occur in morning-to-evening or evening-to-morning sequence. Each reading pair appears as a tuple in the input list, and pairs are considered equivalent if they contain the same values in either order (e.g., morning reading of 120 and evening reading of 140 is considered the same pattern as morning reading of 140 and evening reading of 120).
    

    
def count_bidirectional(test_list):
    """
    Given a list of paired morning and evening patient readings, determine the number of unique measurement pairs that show matching patterns regardless of whether they occur in morning-to-evening or evening-to-morning sequence. Each reading pair appears as a tuple in the input list, and pairs are considered equivalent if they contain the same values in either order (e.g., morning reading of 120 and evening reading of 140 is considered the same pattern as morning reading of 140 and evening reading of 120).
    

    """
def count_bidirectional(test_list):
    """
    Given a list of paired morning and evening patient readings, determine the number of unique measurement pairs that show matching patterns regardless of whether they occur in morning-to-evening or evening-to-morning sequence. Each reading pair appears as a tuple in the input list, and pairs are considered equivalent if they contain the same values in either order (e.g., morning reading of 120 and evening reading of 140 is considered the same pattern as morning reading of 140 and evening reading of 120).
    

    """
    res = 0
    for idx in range(0, len(test_list)):
        for iidx in range(idx + 1, len(test_list)):
            if test_list[iidx][0] == test_list[idx][1] and test_list[idx][1] == test_list[iidx][0]:
                res += 1
    return res