code: def merge_closest_groups(groups, special_tokens):
      """Finds the two token groups with the best merge score and merges them."""
      scores = [
          merge_score(groups[i], groups[i + 1], special_tokens)
          for i in range(len(groups) - 1)
      ]
      # print(scores)
      ind = np.argmax(scores)
      groups[ind] = groups[ind] + groups[ind + 1]
      # print(groups[ind][0].s in openers, groups[ind][0])
      if (
          groups[ind][0].s in openers
          and groups[ind + 1][-1].s == openers[groups[ind][0].s]
      ):
          groups[ind][0].balanced = True
          groups[ind + 1][-1].balanced = True
  
      groups.pop(ind + 1)
  
imports: import math
  import re
  import numpy
  from .._serializable import Deserializer, Serializer
  from ..utils import safe_isinstance
  from ..utils.transformers import SENTENCEPIECE_TOKENIZERS, getattr_silent, parse_prefix_suffix_for_tokenizer
  from ._masker import Masker
label_desc: Use image node_id 3 for calling a global function with example usage: merge_closest_groups(groups, special_tokens) without return types