code: def step_3_helper(word, r1, r2, end, repl, r2_necessary):
      if word.endswith(end):
          if len(word) - len(end) >= r1:
              if not r2_necessary:
                  return word[: -len(end)] + repl
              else:
                  if len(word) - len(end) >= r2:
                      return word[: -len(end)] + repl
          return word
      return None
  
imports: import re
label_desc: Use image node_id 15 for calling a global function with example usage: step_3_helper(word, r1, r2, end, repl, r2_necessary) and returns: None, word, unknown, unknown