code: def test_format(
      dtype, arr_type, normed, symmetrized, use_out_degree, form
  ):
      n = 3
      mat = [[0, 1, 0], [4, 2, 0], [0, 0, 0]]
      mat = arr_type(np.array(mat), dtype=dtype)
      Lo, do = csgraph.laplacian(
          mat,
          return_diag=True,
          normed=normed,
          symmetrized=symmetrized,
          use_out_degree=use_out_degree,
          dtype=dtype,
      )
      La, da = csgraph.laplacian(
          mat,
          return_diag=True,
          normed=normed,
          symmetrized=symmetrized,
          use_out_degree=use_out_degree,
          dtype=dtype,
          form="array",
      )
      assert_allclose(do, da)
      _assert_allclose_sparse(Lo, La)
  
      L, d = csgraph.laplacian(
          mat,
          return_diag=True,
          normed=normed,
          symmetrized=symmetrized,
          use_out_degree=use_out_degree,
          dtype=dtype,
          form=form,
      )
      assert_allclose(d, do)
      assert d.dtype == dtype
      Lm = L(np.eye(n, dtype=mat.dtype)).astype(dtype)
      _assert_allclose_sparse(Lm, Lo, rtol=2e-7, atol=2e-7)
      x = np.arange(6).reshape(3, 2)
      if not (normed and dtype in INT_DTYPES):
          assert_allclose(L(x), Lo @ x)
      else:
          # Normalized Lo is casted to integer, but L() is not
          pass
  
file_path: scipy/scipy/sparse/csgraph/tests/test_graph_laplacian.py
imports: import pytest
  import numpy
  from numpy.testing import assert_allclose
  from pytest import raises
  from scipy import sparse
  from scipy.sparse import csgraph
  from scipy._lib._util import np_long, np_ulong
label_desc: Use image node_id 12 for calling a global function with example usage: test_format(dtype, arr_type, normed, symmetrized, use_out_degree, form) without return types