code: def randomPairsMatch(n_records_A, n_records_B, sample_size):
      
      n = int(n_records_A * n_records_B)
  
      if sample_size >= n:
          random_pairs = numpy.arange(n)
      else:
          random_pairs = numpy.array(random.sample(range(n), sample_size),
                                     dtype=int)
  
      i, j = numpy.unravel_index(random_pairs, (n_records_A, n_records_B))
  
      return zip(i, j)
docs: Return random combinations of indices for record list A and B