
    Develop a function that identifies mutual interest matches between users and local events in a social networking platform, where a match exists when both a user shows interest in an event and the event is recommended for that user. Given a list of user-event interest pairs, count how many complete bidirectional matches exist where both (user, event) and (event, user) connections are present in the system.
    

    
def count_bidirectional(test_list):
    """
    Develop a function that identifies mutual interest matches between users and local events in a social networking platform, where a match exists when both a user shows interest in an event and the event is recommended for that user. Given a list of user-event interest pairs, count how many complete bidirectional matches exist where both (user, event) and (event, user) connections are present in the system.
    

    """
def count_bidirectional(test_list):
    """
    Develop a function that identifies mutual interest matches between users and local events in a social networking platform, where a match exists when both a user shows interest in an event and the event is recommended for that user. Given a list of user-event interest pairs, count how many complete bidirectional matches exist where both (user, event) and (event, user) connections are present in the system.
    

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