Вы можете сделать это:
from itertools import groupby
users=([1,'MX'],[2,'EN'],[3,'US'],[4,'FR'],[5,'US'],[6,'EN'],[7,'MX'])
prod=[
(1005,[5]),
(1004,[2,4,1]),
(1003,[3,5]),
(1002,[7,5,2]),
(1001,[6,5,1])
]
temp = [(p[0],u[1]) for p in prod for u in users if u[0] in p[1]]
result = []
for id, locations in groupby(temp, key=lambda x: x[0]):
result.append((id, {x[1] for x in locations}))
Выход:
[(1005, {'US'}), (1004, {'MX', 'FR', 'EN'}), (1003, {'US'}), (1002, {'EN', 'US', 'MX'}), (1001, {'MX', 'US', 'EN'})]