code: def replace_rep(t):
      "Replace repetitions at the character level: cccc -- TK_REP 4 c"
  
      def _replace_rep(m):
          c, cc = m.groups()
          return f" {TK_REP} {len(cc)+1} {c} "
  
      return _re_rep.sub(_replace_rep, t)
  
imports: from __future__ import annotations
  from ..torch_basics import *
  from ..data.all import *
  import html
label_desc: Use image node_id 3 for calling a global function with example usage: replace_rep(t) and returns: _re_rep, str, TK_REP, str, unknown, str, c, str