code: def _laplacian_sparse(graph, normed=False, axis=0):
      if graph.format in ("lil", "dok"):
          m = graph.tocoo()
          needs_copy = False
      else:
          m = graph
          needs_copy = True
      w = m.sum(axis=axis).getA1() - m.diagonal()
      if normed:
          m = m.tocoo(copy=needs_copy)
          isolated_node_mask = w == 0
          w = np.where(isolated_node_mask, 1, np.sqrt(w))
          m.data /= w[m.row]
          m.data /= w[m.col]
          m.data *= -1
          m.setdiag(1 - isolated_node_mask)
      else:
          if m.format == "dia":
              m = m.copy()
          else:
              m = m.tocoo(copy=needs_copy)
          m.data *= -1
          m.setdiag(w)
      return m, w
  
imports: import numpy
  from scipy.sparse import isspmatrix
label_desc: Use image node_id 3 for calling a global function with example usage: _laplacian_sparse(graph, normed, axis) and returns: m,  w