code: def replace(seq, replacementRules, n):
      for i in range(n):
          newseq = ""
          for element in seq:
              newseq = newseq + replacementRules.get(element, element)
          seq = newseq
      return seq
  
label_desc: Use image node_id 1 for calling a global function with example usage: replace(seq, replacementRules, n) and returns: seq