code: def levenshtein(seq1, seq2, limit=None):
      """Returns the Levenshtein edit distance between two strings."""
  
      oneago = None
      thisrow = list(range(1, len(seq2) + 1)) + [0]
      for x in xrange(len(seq1)):
          # Python lists wrap around for negative indices, so put the
          # leftmost column at the *end* of the list. This matches with
          # the zero-indexed strings and saves extra calculation.
          oneago, thisrow = thisrow, [0] * len(seq2) + [x + 1]
          for y in xrange(len(seq2)):
              delcost = oneago[y] + 1
              addcost = thisrow[y - 1] + 1
              subcost = oneago[y - 1] + (seq1[x] != seq2[y])
              thisrow[y] = min(delcost, addcost, subcost)
  
          if limit and x > limit and min(thisrow) > limit:
              return limit + 1
  
      return thisrow[len(seq2) - 1]
  
imports: from whoosh.compat import xrange
label_desc: Use image node_id 1 for calling a global function with example usage: levenshtein(seq1, seq2, limit) and returns: thisrow, unknown