code: def test_flatten_unflatten():
      """Test the _flatten and _unflatten methods."""
      wires = qml.wires.Wires((0, 1, 2))
      op = qml.AngleEmbedding(
          features=[1, 2, 3], wires=wires, rotation="Z"
      )
  
      data, metadata = op._flatten()
      assert data == op.data
      assert len(metadata) == 2
      assert metadata[0] == wires
      assert metadata[1] == (("rotation", "Z"),)
  
      new_op = type(op)._unflatten(*op._flatten())
      assert qml.equal(op, new_op)
      assert op is not new_op
  
imports: import pytest
  import numpy
  from pennylane import numpy
  import pennylane
label_desc: Use image node_id 3 for calling a global function with example usage: test_flatten_unflatten() without return types