code: def find_best_pattern(key: str, patterns: Iterable[str]):
      max_score = -1
      best = None
      for p in patterns:
          if is_pattern_match(key, p):
              s = 0
              for c in p:
                  if c not in {"*", "?"}:
                      s += 1
  
              # Find the last one
              if s >= max_score:
                  max_score = s
                  best = p
  
      return best, max_score / len(key)
  
label_desc: Use image node_id 2 for calling a global function with example usage: find_best_pattern(key, patterns) and returns: best,  unknown