code: def randomPairsWithReplacement(
      n_records: int, sample_size: int
  ) -> IndicesIterator:
      # If the population is very large relative to the sample
      # size than we'll get very few duplicates by chance
      warnings.warn(
          "The same record pair may appear more than once in the sample"
      )
  
      try:
          random_indices = numpy.random.randint(
              n_records, size=sample_size * 2
          )
      except (OverflowError, ValueError):
          max_int: int = numpy.iinfo("int").max
          warnings.warn(
              "Asked to sample pairs from %d records, will only sample pairs from first %d records"
              % (n_records, max_int)
          )
  
          random_indices = numpy.random.randint(
              max_int, size=sample_size * 2
          )
  
      random_indices = random_indices.reshape((-1, 2))
      random_indices.sort(axis=1)
  
      return ((p.item(), q.item()) for p, q in random_indices)
  
imports: from __future__ import annotations
  import collections
  import itertools
  import random
  import sys
  import warnings
  from typing import Iterator, Tuple, overload
  import numpy
  import dedupe
  from dedupe._typing import DataInt, DataStr, Literal, RecordDict, RecordDictPair, RecordID, TrainingData
  from dedupe.canonical import getCanonicalRep
  from dedupe.core import unique
label_desc: Use image node_id 3 for calling a global function with example usage: randomPairsWithReplacement(n_records, sample_size) and returns: unknown