code: def test_warning_if_not_device_batch_transform():
      """Test that a warning is raised if the users requests to not run device batch transform."""
  
      # pylint: disable=too-few-public-methods
      class CustomOp(qml.operation.Operator):
          """Dummy operator."""
  
          def decomposition(self):
              return [qml.PauliX(self.wires[0])]
  
      dev = DefaultQubit()
  
      qs = qml.tape.QuantumScript(
          [CustomOp(0)], [qml.expval(qml.PauliZ(0))]
      )
  
      with pytest.warns(
          UserWarning,
          match="device batch transforms cannot be turned off",
      ):
          program, _ = dev.preprocess()
          results = qml.execute(
              [qs],
              dev,
              device_batch_transform=False,
              transform_program=program,
          )
  
      assert len(results) == 1
      assert qml.math.allclose(results[0], -1)
  
file_path: pennylane/tests/interfaces/default_qubit_2_integration/test_execute_default_qubit_2.py
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.workflow.execution import _preprocess_expand_fn
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 1 for calling a global function with example usage: test_warning_if_not_device_batch_transform() and returns: list