code: def test_matrix_xyz():
      def matrix_convert(mode):
          # Arrange
          im = hopper("RGB")
          im.info["transparency"] = (255, 0, 0)
          # fmt: off
          matrix = (
              0.412453, 0.357580, 0.180423, 0,
              0.212671, 0.715160, 0.072169, 0,
              0.019334, 0.119193, 0.950227, 0)
          # fmt: on
          assert im.mode == "RGB"
  
          # Act
          # Convert an RGB image to the CIE XYZ colour space
          converted_im = im.convert(mode=mode, matrix=matrix)
  
          # Assert
          assert converted_im.mode == mode
          assert converted_im.size == im.size
          with Image.open("Tests/images/hopper-XYZ.png") as target:
              if converted_im.mode == "RGB":
                  assert_image_similar(converted_im, target, 3)
                  assert converted_im.info["transparency"] == (
                      105,
                      54,
                      4,
                  )
              else:
                  assert_image_similar(
                      converted_im, target.getchannel(0), 1
                  )
                  assert converted_im.info["transparency"] == 105
  
      matrix_convert("RGB")
      matrix_convert("L")
  
imports: import pytest
  from PIL import Image
  from .helper import assert_image, assert_image_equal, assert_image_similar, hopper
label_desc: Use image node_id 17 for calling a global function with example usage: test_matrix_xyz() without return types