code: def test_matrix_set_size():
      m = matrix()
      m.set_size(5, 5)
  
      assert m.nr() == 5
      assert m.nc() == 5
      assert m.shape == (5, 5)
      assert len(m) == 5
      assert (
          repr(m)
          == "< dlib.matrix containing: \n0 0 0 0 0 \n0 0 0 0 0 \n0 0 0 0 0 \n0 0 0 0 0 \n0 0 0 0 0 >"
      )
      assert (
          str(m)
          == "0 0 0 0 0 \n0 0 0 0 0 \n0 0 0 0 0 \n0 0 0 0 0 \n0 0 0 0 0"
      )
  
      deser = pickle.loads(pickle.dumps(m, 2))
  
      for row in range(5):
          for col in range(5):
              assert m[row][col] == deser[row][col]
  
file_path: dlib/tools/python/test/test_matrix.py
imports: from dlib import matrix
  from pytest import raises
label_desc: Use image node_id 6 for calling a global function with example usage: test_matrix_set_size() without return types