code: def test_sanitize_labels():
      from ..matrix_plotting import _sanitize_labels
  
      labs = ["foo", "bar"]
      with pytest.raises(
          ValueError,
          match="Length of labels unequal to length of matrix.",
      ):
          _sanitize_labels((6, 6), labs)
      for lab in [labs, np.array(labs)]:
          assert _sanitize_labels((2, 2), lab) == labs
  
imports: import matplotlib
  import matplotlib.pyplot
  import numpy
  import pandas
  import pytest
  from numpy.testing import assert_array_equal
  from nilearn.glm.first_level.design_matrix import make_first_level_design_matrix
  from nilearn.glm.tests._testing import design_with_null_durations
  from nilearn.plotting.matrix_plotting import pad_contrast_matrix, plot_contrast_matrix, plot_design_matrix, plot_event, plot_matrix
label_desc: Use image node_id 3 for calling a global function with example usage: test_sanitize_labels() without return types