def METHOD_NAME(device, qubit_size, layout_str):
    q0 = cirq.GridQubit(5, 3)
    q1 = cirq.GridQubit(5, 4)
    valid_sycamore_gates_and_ops = [
        cirq_google.SYC,
        cirq.SQRT_ISWAP,
        cirq.SQRT_ISWAP_INV,
        cirq.X,
        cirq.Y,
        cirq.Z,
        cirq.Z(q0).with_tags(cirq_google.PhysicalZTag()),
        coupler_pulse.CouplerPulse(hold_time=cirq.Duration(nanos=10), coupling_mhz=25.0),
        cirq.measure(q0),
        cirq.WaitGate(cirq.Duration(millis=5)),
        # TODO(#5050) Uncomment after GlobalPhaseGate support is added.
        # cirq.GlobalPhaseGate(-1.0),
    ]
    syc = cirq.FSimGate(theta=np.pi / 2, phi=np.pi / 6)(q0, q1)
    sqrt_iswap = cirq.FSimGate(theta=np.pi / 4, phi=0)(q0, q1)
    assert str(device) == layout_str
    assert len(device.metadata.qubit_pairs) == qubit_size
    assert all(gate_or_op in device.metadata.gateset for gate_or_op in valid_sycamore_gates_and_ops)
    assert len(device.metadata.gate_durations) == len(device.metadata.gateset.gates)
    assert any(
        isinstance(cgs, cirq_google.SycamoreTargetGateset)
        for cgs in device.metadata.compilation_target_gatesets
    )
    assert any(
        isinstance(cgs, cirq.SqrtIswapTargetGateset)
        for cgs in device.metadata.compilation_target_gatesets
    )
    device.validate_operation(syc)
    device.validate_operation(sqrt_iswap)
    assert next(
        (
            duration
            for gate_family, duration in device.metadata.gate_durations.items()
            if syc in gate_family
        ),
        None,
    ) == cirq.Duration(nanos=12)
    assert next(
        (
            duration
            for gate_family, duration in device.metadata.gate_durations.items()
            if sqrt_iswap in gate_family
        ),
        None,
    ) == cirq.Duration(nanos=32)