code: def sub(
      pattern,
      repl,
      string,
      *args,
      count=_zero_sentinel,
      flags=_zero_sentinel,
  ):
      """Return the string obtained by replacing the leftmost
      non-overlapping occurrences of the pattern in string by the
      replacement repl.  repl can be either a string or a callable;
      if a string, backslash escapes in it are processed.  If it is
      a callable, it's passed the Match object and must return
      a replacement string to be used."""
      if args:
          if count is not _zero_sentinel:
              raise TypeError(
                  "sub() got multiple values for argument 'count'"
              )
          count, *args = args
          if args:
              if flags is not _zero_sentinel:
                  raise TypeError(
                      "sub() got multiple values for argument 'flags'"
                  )
              flags, *args = args
              if args:
                  raise TypeError(
                      "sub() takes from 3 to 5 positional arguments "
                      "but %d were given" % (5 + len(args))
                  )
  
          import warnings
  
          warnings.warn(
              "'count' is passed as positional argument",
              DeprecationWarning,
              stacklevel=2,
          )
  
      return _compile(pattern, flags).sub(repl, string, count)
  
imports: import enum
  from .None import _compiler, _parser
  import functools
  import _sre
  import copyreg
label_desc: Use image node_id 4 for calling a global function with example usage: sub(pattern, repl, string) and returns: _compile