code: def _replace_special(
      ttype, value, regex, specialttype, replacefunc=lambda x: x
  ):
      last = 0
      for match in regex.finditer(value):
          start, end = match.start(), match.end()
          if start != last:
              yield ttype, value[last:start]
          yield specialttype, replacefunc(value[start:end])
          last = end
      if last != len(value):
          yield ttype, value[last:]
  
imports: import re
  from pygments.token import String, Comment, Keyword, Name, Error, Whitespace, string_to_tokentype
  from pygments.filter import Filter
  from pygments.util import get_list_opt, get_int_opt, get_bool_opt, get_choice_opt, ClassNotFound, OptionError, text_type, string_types
  from pygments.plugin import find_plugin_filters
label_desc: Use image node_id 4 for calling a global function with example usage: _replace_special(ttype, value, regex, specialttype, replacefunc) without return types