def METHOD_NAME(digits, num_examples):
    """Generate random number pairs with the given number of digits.
    The generated sequence does not contain duplicates.
    """
    def pair_generator():
        history = []
        for _ in range(num_examples):
            while True:
                pair = generate_number(digits), generate_number(digits)
                if pair not in history:
                    break
            history.append(pair)
            yield pair
    return pair_generator