code: def get_matches(self, src, src_idx):
          
          if src not in ('l1', 'l2'):
              raise ValueError('Must have one of "l1" or "l2" as src')
          if src == 'l1':
              target_list = self.l2
          else:
              target_list = self.l1
          comparator = {
              'l1': lambda s_idx, t_idx: (s_idx, t_idx) in self.matches,
              'l2': lambda s_idx, t_idx: (t_idx, s_idx) in self.matches,
          }[src]
  
          return [(trg_idx, obj) for trg_idx, obj in enumerate(target_list)
                  if comparator(src_idx, trg_idx)]
docs: Get elements equal to the idx'th in src from the other list.
  
          e.g. get_matches(self, 'l1', 0) will return all elements from self.l2
          matching with self.l1[0]