def create_engine_validator(
    max_moments: int = MAX_MOMENTS, max_repetitions: int = MAX_TOTAL_REPETITIONS
) -> VALIDATOR_TYPE:
    """Creates a Callable gate set validator with a set message size.

    This validator can be used for a validator in `cg.ValidatingSampler`
    and can also be useful in generating 'engine emulators' by using
    `cg.SimulatedLocalProcessor` with this callable as a validator.

    Args:
        max_moments: Maximum number of moments to allow.
        max_repetitions: Maximum number of parameter sweep values allowed
            when summed across all sweeps and all batches.
    """

    def _validator(
        circuits: Sequence[cirq.AbstractCircuit],
        sweeps: Sequence[cirq.Sweepable],
        repetitions: int | Sequence[int],
    ):
        return validate_for_engine(circuits, sweeps, repetitions, max_moments, max_repetitions)

    return _validator
Creates a Callable gate set validator with a set message size.

    This validator can be used for a validator in `cg.ValidatingSampler`
    and can also be useful in generating 'engine emulators' by using
    `cg.SimulatedLocalProcessor` with this callable as a validator.

    Args:
        max_moments: Maximum number of moments to allow.
        max_repetitions: Maximum number of parameter sweep values allowed
            when summed across all sweeps and all batches.
    
cirq-google/cirq_google/engine/engine_validator.py