code: def test_flatten_unflatten(mp):
      """Test flatten and unflatten methods."""
  
      data, metadata = mp._flatten()
      assert hash(metadata)
  
      new_mp = type(mp)._unflatten(data, metadata)
      assert qml.equal(new_mp, mp)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import ClassicalShadowMP, Counts, CountsMP, Expectation, ExpectationMP, MeasurementProcess, MeasurementTransform, MeasurementValue, MidMeasure, MidMeasureMP, MutualInfoMP, PurityMP, Probability, ProbabilityMP, Sample, SampleMeasurement, SampleMP, ShadowExpvalMP, Shots, State, StateMeasurement, StateMP, Variance, VarianceMP, VnEntropyMP, expval, sample, var
  from pennylane.operation import DecompositionUndefinedError
  from pennylane.queuing import AnnotatedQueue
  from pennylane.wires import Wires
label_desc: Use image node_id 8 for calling a global function with example usage: test_flatten_unflatten(mp) without return types