code: def fuzzyfinder(text, collection):
      
      suggestions = []
      if not isinstance(text, six.text_type):
          text = six.u(text)
      pat = '.*?'.join(map(re.escape, text))
      regex = re.compile(pat, flags=re.IGNORECASE)
      for item in collection:
          r = regex.search(item)
          if r:
              suggestions.append((len(r.group()), r.start(), item))
  
      return (z for _, _, z in sorted(suggestions))
docs: https://github.com/amjith/fuzzyfinder