def METHOD_NAME(full_text, regexp, repl):
  """
  Returns a list of patches to `full_text` to replace each occurrence of `regexp` with `repl`. If
  repl is a function, will replace with `repl(match_object)`. If repl is a string, it is used
  verbatim, without interpreting any special characters.
  """
  repl_func = repl if callable(repl) else (lambda m: repl)
  return [make_patch(full_text, m.start(0), m.end(0), repl_func(m))
          for m in regexp.finditer(full_text)]