code: def levenshtein(a, b):
      n, m = len(a), len(b)
      if n > m:
          a, b, n, m = b, a, m, n
  
      current = list(range(n + 1))
      for i in range(1, m + 1):
          previous, current = current, [i] + [0] * n
          for j in range(1, n + 1):
              add, delete = previous[j] + 1, current[j - 1] + 1
              change = previous[j - 1]
              if a[j - 1] != b[i - 1]:
                  change = change + 1
              current[j] = min(add, delete, change)
  
      return current[n]
  
file_path: tinygrad/examples/mlperf/metrics.py
imports: import re
  import string
  from collections import Counter
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: levenshtein(a, b) and returns: current