code: def escape_special_chars(line):
      line = line.replace("'", "&apos;")  # xml
      line = line.replace('"', "&quot;")  # xml
      line = line.replace("[", "&#91;")  # syntax non-terminal
      line = line.replace("]", "&#93;")  # syntax non-terminal
      line = line.replace("|", "&#124;")
  
      return line
  
imports: import sys
  import re
  from collections import namedtuple
label_desc: Use image node_id 1 for calling a global function with example usage: escape_special_chars(line) and returns: line