code: def get_result(self, refs, hyps):
      res = AlignmentResult(
          refs=deque(), hyps=deque(), codes=deque(), score=np.nan
      )
  
      num_rows, num_cols = self.scores_.shape
      res.score = self.scores_[num_rows - 1, num_cols - 1]
  
      curr_offset = coordinate_to_offset(
          num_rows - 1, num_cols - 1, num_cols
      )
  
      while curr_offset != 0:
          curr_row = offset_to_row(curr_offset, num_cols)
          curr_col = offset_to_col(curr_offset, num_cols)
  
          prev_offset = self.backtraces_[curr_row, curr_col]
  
          prev_row = offset_to_row(prev_offset, num_cols)
          prev_col = offset_to_col(prev_offset, num_cols)
  
          res.refs.appendleft(
              curr_row - 1
          )  # Note: this was .push_front() in C++
          res.hyps.appendleft(curr_col - 1)
          if curr_row - 1 == prev_row and curr_col == prev_col:
              res.codes.appendleft(Code.deletion)
          elif curr_row == prev_row and curr_col - 1 == prev_col:
              res.codes.appendleft(Code.insertion)
          else:
              # assert(curr_row - 1 == prev_row and curr_col - 1 == prev_col)
              ref_str = refs[res.refs[0]].label
              hyp_str = hyps[res.hyps[0]].label
  
              if ref_str == hyp_str:
                  res.codes.appendleft(Code.match)
              else:
                  res.codes.appendleft(Code.substitution)
  
                  confusion_pair = "%s -> %s" % (ref_str, hyp_str)
                  if confusion_pair not in self.confusion_pairs_:
                      self.confusion_pairs_[confusion_pair] = 1
                  else:
                      self.confusion_pairs_[confusion_pair] += 1
  
          curr_offset = prev_offset
  
      return res
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import re
  from collections import deque
  from enum import Enum
  import numpy
label_desc: Use image node_id 3 for calling the EditDistance obj's underlying member method code with example usage: obj.get_result(refs, hyps) and returns: res