class_docstr: Test dunder and other visualizing methods.
class_docstr_tok: ["Test","dunder","and","other","visualizing","methods","."]
docstr: Test _flatten and _unflatten.
docstr_tok: ["Test","_flatten","and","_unflatten","."]
code: def test_flatten_unflatten(self, ops_lst):
      """Test _flatten and _unflatten."""
      op = ValidOp(*ops_lst)
      data, metadata = op._flatten()
      for data_op, input_op in zip(data, ops_lst):
          assert data_op is input_op
  
      assert metadata == tuple()
  
      new_op = type(op)._unflatten(*op._flatten())
      assert qml.equal(op, new_op)
  
imports: from copy import copy
  import numpy
  import pytest
  import pennylane
  from pennylane.operation import DecompositionUndefinedError
  from pennylane.ops.op_math import CompositeOp, Prod, Sum, SProd
  from pennylane.wires import Wires
label_desc: Use image node_id 8 for calling the TestMscMethods obj's underlying member method code with example usage: obj.test_flatten_unflatten(ops_lst) without return types