code: def test_mottonenstate_preparation(mocker):
      """Test that batching works for MottonenStatePreparation"""
      dev = qml.device("default.qubit", wires=3)
  
      @qml.batch_params
      @qml.qnode(dev, interface="autograd")
      def circuit(data, weights):
          qml.templates.MottonenStatePreparation(data, wires=[0, 1, 2])
          qml.templates.StronglyEntanglingLayers(
              weights, wires=[0, 1, 2]
          )
          return qml.probs(wires=[0, 1, 2])
  
      batch_size = 3
  
      # create a batched input statevector
      data = np.random.random((batch_size, 2**3))
      data /= np.linalg.norm(data, axis=1).reshape(-1, 1)  # normalize
      weights = np.random.random((batch_size, 10, 3, 3))
  
      spy = mocker.spy(circuit.device, "execute")
      res = circuit(data, weights)
      assert res.shape == (batch_size, 2**3)
      assert len(spy.call_args[0][0]) == batch_size
  
      # check the results against individually executed circuits (no batching)
      @qml.qnode(dev)
      def circuit2(data, weights):
          qml.templates.MottonenStatePreparation(data, wires=[0, 1, 2])
          qml.templates.StronglyEntanglingLayers(
              weights, wires=[0, 1, 2]
          )
          return qml.probs(wires=[0, 1, 2])
  
      indiv_res = []
      for state, weight in zip(data, weights):
          indiv_res.append(circuit2(state, weight))
      assert np.allclose(res, indiv_res)
  
imports: import functools
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: test_mottonenstate_preparation(mocker) and returns: qml, qml