itertools.combinations will return a generator of the k-combination sequence of a list.
In other words: It will return a generator of tuples of all the possible k-wise combinations of the input list.
For Example:
If you have a list:
a = [1,2,3,4,5]
b = list(itertools.combinations(a, 2))
print ...