code: def _hungarian(cost_matrix):
      """The Hungarian algorithm.
  
      Calculate the Munkres solution to the classical assignment problem and
      return the indices for the lowest-cost pairings.
  
      Parameters
      ----------
      cost_matrix : 2D matrix
          The cost matrix. Does not have to be square.
  
      Returns
      -------
      indices : 2D array of indices
          The pairs of (row, col) indices in the original array giving
          the original ordering.
      """
      state = _HungarianState(cost_matrix)
  
      # No need to bother with assignments if one of the dimensions
      # of the cost matrix is zero-length.
      step = None if 0 in cost_matrix.shape else _step1
  
      while step is not None:
          step = step(state)
  
      # Look for the starred columns
      results = np.array(np.where(state.marked == 1)).T
  
      # We need to swap the columns because we originally
      # did a transpose on the input cost matrix.
      if state.transposed:
          results = results[:, ::-1]
  
      return results
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/utils/linear_assignment_.py
imports: import numpy
  from .fixes import astype
label_desc: Use image node_id 2 for calling a global function with example usage: _hungarian(cost_matrix) and returns: results