code: def cost(self, ref, hyp, code):
      if self.time_mediated_:
          if code == Code.match:
              return abs(ref.start - hyp.start) + abs(ref.end - hyp.end)
          elif code == Code.insertion:
              return hyp.end - hyp.start
          elif code == Code.deletion:
              return ref.end - ref.start
          else:  # substitution
              return (
                  abs(ref.start - hyp.start)
                  + abs(ref.end - hyp.end)
                  + 0.1
              )
      else:
          if code == Code.match:
              return 0
          elif code == Code.insertion or code == Code.deletion:
              return 3
          else:  # substitution
              return 4
  
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 2 for calling the EditDistance obj's underlying member method code with example usage: obj.cost(ref, hyp, code) and returns: unknown, int, unknown, int, int, unknown, unknown