code: def _check_symmetric_graph_laplacian(mat, normed):
      if not hasattr(mat, "shape"):
          mat = eval(mat, dict(np=np, sparse=sparse))
  
      if sparse.issparse(mat):
          sp_mat = mat
          mat = sp_mat.todense()
      else:
          sp_mat = sparse.csr_matrix(mat)
  
      laplacian = csgraph.laplacian(mat, normed=normed)
      n_nodes = mat.shape[0]
      if not normed:
          assert_array_almost_equal(
              laplacian.sum(axis=0), np.zeros(n_nodes)
          )
      assert_array_almost_equal(laplacian.T, laplacian)
      assert_array_almost_equal(
          laplacian, csgraph.laplacian(sp_mat, normed=normed).todense()
      )
  
      assert_array_almost_equal(
          laplacian, _explicit_laplacian(mat, normed=normed)
      )
  
file_path: catboost/contrib/python/scipy/py2/scipy/sparse/csgraph/tests/test_graph_laplacian.py
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy.testing import assert_allclose, assert_array_almost_equal
  from pytest import raises
  from scipy import sparse
  from scipy.sparse import csgraph
label_desc: Use image node_id 2 for calling a global function with example usage: _check_symmetric_graph_laplacian(mat, normed) without return types