code: def kronsum(A, B, format=None):
      """kronecker sum of sparse matrices A and B
  
      Kronecker sum of two sparse matrices is a sum of two Kronecker
      products kron(I_n,A) + kron(B,I_m) where A has shape (m,m)
      and B has shape (n,n) and I_m and I_n are identity matrices
      of shape (m,m) and (n,n) respectively.
  
      Parameters
      ----------
      A
          square matrix
      B
          square matrix
      format : str
          format of the result (e.g. "csr")
  
      Returns
      -------
      kronecker sum in a sparse matrix format
  
      Examples
      --------
  
  
      """
      A = coo_matrix(A)
      B = coo_matrix(B)
  
      if A.shape[0] != A.shape[1]:
          raise ValueError("A is not square")
  
      if B.shape[0] != B.shape[1]:
          raise ValueError("B is not square")
  
      dtype = upcast(A.dtype, B.dtype)
  
      L = kron(eye(B.shape[0], dtype=dtype), A, format=format)
      R = kron(B, eye(A.shape[0], dtype=dtype), format=format)
  
      return (L + R).asformat(format)
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from scipy._lib._numpy_compat import get_randint
  from scipy._lib.six import xrange
  from .sputils import upcast, get_index_dtype, isscalarlike
  from .csr import csr_matrix
  from .csc import csc_matrix
  from .bsr import bsr_matrix
  from .coo import coo_matrix
  from .dia import dia_matrix
  from .base import issparse
label_desc: Use image node_id 6 for calling a global function with example usage: kronsum(A, B, format) and returns: unknown