code: def _step5(state):
      """
      Construct a series of alternating primed and starred zeros as follows.
      Let Z0 represent the uncovered primed zero found in Step 4.
      Let Z1 denote the starred zero in the column of Z0 (if any).
      Let Z2 denote the primed zero in the row of Z1 (there will always be one).
      Continue until the series terminates at a primed zero that has no starred
      zero in its column. Unstar each starred zero of the series, star each
      primed zero of the series, erase all primes and uncover every line in the
      matrix. Return to Step 3
      """
      count = 0
      path = state.path
      path[count, 0] = state.Z0_r
      path[count, 1] = state.Z0_c
  
      while True:
          # Find the first starred element in the col defined by
          # the path.
          row = np.argmax(state.marked[:, path[count, 1]] == 1)
          if not state.marked[row, path[count, 1]] == 1:
              # Could not find one
              break
          else:
              count += 1
              path[count, 0] = row
              path[count, 1] = path[count - 1, 1]
  
          # Find the first prime element in the row defined by the
          # first path step
          col = np.argmax(state.marked[path[count, 0]] == 2)
          if state.marked[row, col] != 2:
              col = -1
          count += 1
          path[count, 0] = path[count - 1, 0]
          path[count, 1] = col
  
      # Convert paths
      for i in range(count + 1):
          if state.marked[path[i, 0], path[i, 1]] == 1:
              state.marked[path[i, 0], path[i, 1]] = 0
          else:
              state.marked[path[i, 0], path[i, 1]] = 1
  
      state._clear_covers()
      # Erase all prime markings
      state.marked[state.marked == 2] = 0
      return _step3
  
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 6 for calling a global function with example usage: _step5(state) and returns: _step3