from collections import Counter
from itertools import chain, combinations
meets = Counter(chain.from_iterable(combinations(line, 2) for line in lines))
Python: Counting frequency of pairs of elements in a list of lists