code: def _check_A_type(A):
      if not (
          isinstance(A, cupy.ndarray)
          or cupyx.scipy.sparse.isspmatrix(A)
      ):
          msg = "A must be cupy.ndarray or cupyx.scipy.sparse.spmatrix"
          raise TypeError(msg)
  
imports: import cupy
  import cupyx
  from cupyx.scipy import sparse
label_desc: Use image node_id 4 for calling a global function with example usage: _check_A_type(A) without return types