
    Given a list of bus route segments where each segment is represented as a tuple of two bus stops indicating a bidirectional connection, write a function that counts the number of unique bidirectional route segments in the network, considering that (Stop A, Stop B) and (Stop B, Stop A) represent the same route segment. This analysis will help identify redundant route coverage and optimize the bus network's efficiency.
    

    
def count_bidirectional(test_list):
    """
    Given a list of bus route segments where each segment is represented as a tuple of two bus stops indicating a bidirectional connection, write a function that counts the number of unique bidirectional route segments in the network, considering that (Stop A, Stop B) and (Stop B, Stop A) represent the same route segment. This analysis will help identify redundant route coverage and optimize the bus network's efficiency.
    

    """
def count_bidirectional(test_list):
    """
    Given a list of bus route segments where each segment is represented as a tuple of two bus stops indicating a bidirectional connection, write a function that counts the number of unique bidirectional route segments in the network, considering that (Stop A, Stop B) and (Stop B, Stop A) represent the same route segment. This analysis will help identify redundant route coverage and optimize the bus network's efficiency.
    

    """
    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