code: def chased_dp_assignment(scores):
      """Run dp matching as https://github.com/fujiso/SODA/blob/master/soda.py."""
  
      m, n = scores.shape
      dp = -np.ones((m, n))
      path = np.zeros((m, n))
  
      def transition(i, j):
          if dp[i, j] >= 0:
              return dp[i, j]
          elif i == 0 and j == 0:
              state = [-1, -1, scores[i, j]]
          elif i == 0:
              state = [-1, transition(i, j - 1), scores[i, j]]
          elif j == 0:
              state = [transition(i - 1, j), -1, scores[i, j]]
          else:
              state = [
                  transition(i - 1, j),
                  transition(i, j - 1),
                  transition(i - 1, j - 1) + scores[i, j],
              ]
          dp[i, j] = np.max(state)
          path[i, j] = np.argmax(state)
          return dp[i, j]
  
      def get_pairs(i, j):
          p = np.where(path[i][: j + 1] == 2)[0]
          # pylint: disable=g-explicit-length-test
          if i != 0 and not len(p):
              return get_pairs(i - 1, j)
          elif i == 0 or p[-1] == 0:
              return [(i, p[-1])]
          else:
              return get_pairs(i - 1, p[-1] - 1) + [(i, p[-1])]
  
      n, m = scores.shape
      max_score = transition(n - 1, m - 1)
      pairs = get_pairs(n - 1, m - 1)
      return max_score, pairs
  
imports: import collections
  import logging
  import random
  import re
  import string
  import numpy
  from scenic.projects.vid2seq.metrics.cider import Cider
  from scenic.projects.vid2seq.metrics.meteor import Meteor
  from scenic.projects.vid2seq.metrics.ptbtokenizer import PTBTokenizer
label_desc: Use image node_id 4 for calling a global function with example usage: chased_dp_assignment(scores) and returns: max_score,  pairs, dp, dp, get_pairs, list, unknown