问题描述:
Write a function to extract all the pairs which are symmetric in the given tuple list.

测试用例:
['assert extract_symmetric([(6, 7), (2, 3), (7, 6), (9, 8), (10, 2), (8, 9)] ) == {(8, 9), (6, 7)}', 'assert extract_symmetric([(7, 8), (3, 4), (8, 7), (10, 9), (11, 3), (9, 10)] ) == {(9, 10), (7, 8)}', 'assert extract_symmetric([(8, 9), (4, 5), (9, 8), (11, 10), (12, 4), (10, 11)] ) == {(8, 9), (10, 11)}']

生成的代码:
def extract_symmetric(tuple_list):
    symmetric_pairs = set()
    for pair in tuple_list:
        if (pair[1], pair[0]) in tuple_list:
            symmetric_pairs.add(pair)
    return symmetric_pairs

# Test cases
assert extract_symmetric([(6, 7), (2, 3), (7, 6), (9, 8), (10, 2), (8, 9)]) == {(8, 9), (6, 7)}
assert extract_symmetric([(7, 8), (3, 4), (8, 7), (10, 9), (11, 3), (9, 10)]) == {(9, 10), (7, 8)}
assert extract_symmetric([(8, 9), (4, 5), (9, 8), (11, 10), (12, 4), (10, 11)]) == {(8, 9), (10, 11)}