code: def test_multiple_edges():
      # create a random sqare matrix with an even number of elements
      np.random.seed(1234)
      X = np.random.random((10, 10))
      Xcsr = csr_matrix(X)
  
      # now double-up every other column
      Xcsr.indices[::2] = Xcsr.indices[1::2]
  
      # normal sparse toarray() will sum the duplicated edges
      Xdense = Xcsr.toarray()
      assert_array_almost_equal(Xdense[:, 1::2], X[:, ::2] + X[:, 1::2])
  
      # csgraph_to_dense chooses the minimum of each duplicated edge
      Xdense = csgraph_to_dense(Xcsr)
      assert_array_almost_equal(
          Xdense[:, 1::2], np.minimum(X[:, ::2], X[:, 1::2])
      )
  
file_path: catboost/contrib/python/scipy/py2/scipy/sparse/csgraph/tests/test_conversions.py
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy.testing import assert_array_almost_equal
  from scipy.sparse import csr_matrix
  from scipy.sparse.csgraph import csgraph_from_dense, csgraph_to_dense
label_desc: Use image node_id 3 for calling a global function with example usage: test_multiple_edges() without return types