code: def test_reorder_diagonal_submatrix():
      nobs = 5
      k_endog = 3
  
      missing = np.zeros((k_endog, nobs))
      missing[0, 0] = 1
      missing[:2, 1] = 1
      missing[0, 2] = 1
      missing[2, 2] = 1
      missing[1, 3] = 1
      missing[2, 4] = 1
  
      given = np.zeros((k_endog, k_endog, nobs))
      given[:, :, :] = np.array(
          [[11, 00, 00], [00, 22, 00], [00, 00, 33]]
      )[:, :, np.newaxis]
      desired = given.copy()
  
      given[:, :, 0] = np.array([[22, 00, 0], [00, 33, 0], [0, 0, 0]])
      desired[0, :, 0] = 0
      desired[:, 0, 0] = 0
  
      given[:, :, 1] = np.array([[33, 0, 0], [0, 0, 0], [0, 0, 0]])
      desired[:2, :, 1] = 0
      desired[:, :2, 1] = 0
  
      given[:, :, 2] = np.array([[22, 0, 0], [0, 0, 0], [0, 0, 0]])
      desired[0, :, 2] = 0
      desired[:, 0, 2] = 0
      desired[2, :, 2] = 0
      desired[:, 2, 2] = 0
  
      given[:, :, 3] = np.array([[11, 00, 0], [00, 33, 0], [0, 0, 0]])
      desired[1, :, 3] = 0
      desired[:, 1, 3] = 0
  
      given[:, :, 4] = np.array([[11, 00, 0], [00, 22, 0], [0, 0, 0]])
      desired[2, :, 4] = 0
      desired[:, 2, 4] = 0
  
      actual = np.asfortranarray(given.copy())
      missing = np.asfortranarray(missing.astype(np.int32))
      tools.reorder_missing_matrix(
          actual, missing, True, True, False, inplace=True
      )
      assert_equal(actual, desired)
  
      actual = np.asfortranarray(given.copy())
      tools.reorder_missing_matrix(
          actual, missing, True, True, True, inplace=True
      )
      assert_equal(actual, desired)
  
imports: import pytest
  import numpy
  from numpy.testing import assert_allclose, assert_equal, assert_array_less, assert_array_equal, assert_almost_equal
  import pandas
  from scipy.linalg import solve_discrete_lyapunov
  from statsmodels.tsa.statespace import tools
  from statsmodels.tsa.stattools import acovf
label_desc: Use image node_id 6 for calling a global function with example usage: test_reorder_diagonal_submatrix() without return types