code: def test_labelling_matrix_cache(op, mat, base):
      """Test state prep matrix parameters interact with labelling matrix cache"""
  
      assert op.label() == base
  
      cache = {"matrices": []}
      assert op.label(cache=cache) == f"{base}(M0)"
      assert qml.math.allclose(cache["matrices"][0], mat)
  
      cache = {"matrices": [0, mat, 0]}
      assert op.label(cache=cache) == f"{base}(M1)"
      assert len(cache["matrices"]) == 3
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.wires import WireError
label_desc: Use image node_id 2 for calling a global function with example usage: test_labelling_matrix_cache(op, mat, base) without return types