code: def escape(string):
      """Escape a string such that it can be embedded into a Ninja file without
      further interpretation."""
      assert "\n" not in string, "Ninja syntax does not allow newlines"
      # We only have one special metacharacter: '$'.
      return string.replace("$", "$$")
  
imports: import re
  import textwrap
label_desc: Use image node_id 3 for calling a global function with example usage: escape(string) and returns: string