code: def test_flatten_unflatten():
      """Test _flatten and _unflatten methods."""
      features = [1.0, 2.0]
      layer1 = [0.1, -0.3, 1.5]
      layer2 = [3.1, 0.2, -2.8]
      weights = [layer1, layer2]
  
      op = qml.QAOAEmbedding(
          features=features, wires=(0, 1), weights=weights
      )
      _, metadata = op._flatten()
      assert hash(metadata)
  
      new_op = type(op)._unflatten(*op._flatten())
      assert qml.equal(op, new_op)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_flatten_unflatten() without return types