def gen_tags(fp):
  for term in fp:
    term = term.encode('hex')
    pos = 0
    for l in kTagLengths:
      yield '%d:%s' % (pos, term[pos:pos+l])
      pos += l
    assert pos == len(term)
dataset/ETHPy150Open viewfinderco/viewfinder/experimental/imagefingerprint/tools/find_near_dupes.py/gen_tags/original