code: def _subx(pattern, template):
      # internal: Pattern.sub/subn implementation helper
      template = _compile_repl(template, pattern)
      if not template[0] and len(template[1]) == 1:
          # literal replacement
          return template[1][0]
  
      def filter(match, template=template):
          return _parser.expand_template(template, match)
  
      return filter
  
imports: import enum
  from .None import _compiler, _parser
  import functools
  import copyreg
label_desc: Use image node_id 16 for calling a global function with example usage: _subx(pattern, template) and returns: filter, template, _parser