code: def _explicit_laplacian(x, normed=False):
      if sparse.issparse(x):
          x = x.todense()
      x = np.asarray(x)
      y = -1.0 * x
      for j in range(y.shape[0]):
          y[j, j] = x[j, j + 1 :].sum() + x[j, :j].sum()
      if normed:
          d = np.diag(y).copy()
          d[d == 0] = 1.0
          y /= d[:, None] ** 0.5
          y /= d[None, :] ** 0.5
      return y
  
file_path: catboost/contrib/python/scipy/py3/scipy/sparse/csgraph/tests/test_graph_laplacian.py
imports: 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 1 for calling a global function with example usage: _explicit_laplacian(x, normed) and returns: y