def METHOD_NAME(intended_scale_factor):
    """tests if the intended scale factor is approximately close to the
    actual scale factor.
    """
    qreg = LineQubit.range(3)
    circ = Circuit(
        [ops.H.on_each(*qreg)],
        [ops.CNOT.on(qreg[0], qreg[1])],
        [ops.X.on(qreg[2])],
        [ops.TOFFOLI.on(*qreg)],
    )
    scaled = insert_id_layers(circ, intended_scale_factor)
    achieved_scale_factor = len(scaled) / len(circ)
    assert achieved_scale_factor <= intended_scale_factor
    assert achieved_scale_factor >= intended_scale_factor - 1