code: def _check_scipy_linalg_matrix(a, func_name):
      """
      Adapted from https://github.com/numba/numba/blob/bd7ebcfd4b850208b627a3f75d4706000be36275/numba/np/linalg.py#L831
      """
      prefix = "scipy.linalg"
      interp = (prefix, func_name)
      # Unpack optional type
      if isinstance(a, types.Optional):
          a = a.type
      if not isinstance(a, types.Array):
          msg = "%s.%s() only supported for array types" % interp
          raise numba.TypingError(msg, highlighting=False)
      if a.ndim not in [1, 2]:
          msg = (
              "%s.%s() only supported on 1d or 2d arrays, found %s."
              % (interp + (a.ndim,))
          )
          raise numba.TypingError(msg, highlighting=False)
      if not isinstance(a.dtype, (types.Float, types.Complex)):
          msg = (
              "%s.%s() only supported on "
              "float and complex arrays." % interp
          )
          raise numba.TypingError(msg, highlighting=False)
  
imports: import ctypes
  import numba
  import numpy
  from numba.core import cgutils, types
  from numba.extending import get_cython_function_address, intrinsic, overload
  from numba.np.linalg import _copy_to_fortran_order, ensure_lapack, get_blas_kind
  from scipy import linalg
  from pytensor.link.numba.dispatch import basic
  from pytensor.link.numba.dispatch.basic import numba_funcify
  from pytensor.tensor.slinalg import BlockDiagonal, Cholesky, SolveTriangular
label_desc: Use image node_id 12 for calling a global function with example usage: _check_scipy_linalg_matrix(a, func_name) without return types