code: def test_graph_maximum_bipartite_matching():
      A = diags(np.ones(25), offsets=0, format="csc")
      rand_perm = np.random.permutation(25)
      rand_perm2 = np.random.permutation(25)
  
      Rrow = np.arange(25)
      Rcol = rand_perm
      Rdata = np.ones(25, dtype=int)
      Rmat = coo_matrix((Rdata, (Rrow, Rcol))).tocsc()
  
      Crow = rand_perm2
      Ccol = np.arange(25)
      Cdata = np.ones(25, dtype=int)
      Cmat = coo_matrix((Cdata, (Crow, Ccol))).tocsc()
      # Randomly permute identity matrix
      B = Rmat * A * Cmat
  
      # Row permute
      perm = maximum_bipartite_matching(B, perm_type="row")
      Rrow = np.arange(25)
      Rcol = perm
      Rdata = np.ones(25, dtype=int)
      Rmat = coo_matrix((Rdata, (Rrow, Rcol))).tocsc()
      C1 = Rmat * B
  
      # Column permute
      perm2 = maximum_bipartite_matching(B, perm_type="column")
      Crow = perm2
      Ccol = np.arange(25)
      Cdata = np.ones(25, dtype=int)
      Cmat = coo_matrix((Cdata, (Crow, Ccol))).tocsc()
      C2 = B * Cmat
  
      # Should get identity matrix back
      assert_equal(any(C1.diagonal() == 0), False)
      assert_equal(any(C2.diagonal() == 0), False)
  
      # Test int64 indices input
      B.indices = B.indices.astype("int64")
      B.indptr = B.indptr.astype("int64")
      perm = maximum_bipartite_matching(B, perm_type="row")
      Rrow = np.arange(25)
      Rcol = perm
      Rdata = np.ones(25, dtype=int)
      Rmat = coo_matrix((Rdata, (Rrow, Rcol))).tocsc()
      C3 = Rmat * B
      assert_equal(any(C3.diagonal() == 0), False)
  
file_path: catboost/contrib/python/scipy/py2/scipy/sparse/csgraph/tests/test_reordering.py
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy.testing import assert_equal
  from scipy.sparse.csgraph import reverse_cuthill_mckee, maximum_bipartite_matching, structural_rank
  from scipy.sparse import diags, csc_matrix, csr_matrix, coo_matrix
label_desc: Use image node_id 3 for calling a global function with example usage: test_graph_maximum_bipartite_matching() without return types