code: def commutation_matrix(p, q):
      """
      Create the commutation matrix K_{p,q} satisfying vec(A') = K_{p,q} vec(A)
  
      Parameters
      ----------
      p : int
      q : int
  
      Returns
      -------
      K : ndarray (pq x pq)
      """
      p = int_like(p, "p")
      q = int_like(q, "q")
  
      K = np.eye(p * q)
      indices = np.arange(p * q).reshape((p, q), order="F")
      return K.take(indices.ravel(), axis=0)
  
imports: from __future__ import annotations
  from statsmodels.compat.python import Literal, lrange
  import warnings
  import numpy
  import pandas
  from pandas import DataFrame
  from pandas.tseries import offsets
  from pandas.tseries.frequencies import to_offset
  from statsmodels.tools.data import _is_recarray, _is_using_pandas
  from statsmodels.tools.sm_exceptions import ValueWarning
  from statsmodels.tools.typing import NDArray
  from statsmodels.tools.validation import array_like, bool_like, int_like, string_like
label_desc: Use image node_id 15 for calling a global function with example usage: commutation_matrix(p, q) and returns: K