code: def decode_spec_tokens(tokens):
      "Decode the special tokens in `tokens`"
      new_toks, rule, arg = [], None, None
      for t in tokens:
          if t in [TK_MAJ, TK_UP, TK_REP, TK_WREP]:
              rule = t
          elif rule is None:
              new_toks.append(t)
          elif rule == TK_MAJ:
              new_toks.append(t[:1].upper() + t[1:].lower())
              rule = None
          elif rule == TK_UP:
              new_toks.append(t.upper())
              rule = None
          elif arg is None:
              try:
                  arg = int(t)
              except:
                  rule = None
          else:
              if rule == TK_REP:
                  new_toks.append(t * arg)
              else:
                  new_toks += [t] * arg
      return new_toks
  
imports: from __future__ import annotations
  from ..basics import *
  from .core import *
  from .data import *
  from .models.core import *
  from .models.awdlstm import *
  from ..callback.rnn import *
  from ..callback.progress import *
  from .models.core import _model_meta
label_desc: Use image node_id 7 for calling a global function with example usage: decode_spec_tokens(tokens) and returns: new_toks