code: def _transpose_named_matrix(mat):
      """Transpose mat inplace (no copy)."""
      mat["nrow"], mat["ncol"] = mat["ncol"], mat["nrow"]
      mat["row_names"], mat["col_names"] = (
          mat["col_names"],
          mat["row_names"],
      )
      mat["data"] = mat["data"].T
  
imports: from ..utils import logger
  from .constants import FIFF
  from .tag import find_tag, has_tag
  from .write import end_block, start_block, write_float_matrix, write_int, write_name_list
label_desc: Use image node_id 1 for calling a global function with example usage: _transpose_named_matrix(mat) without return types