code: def shell_escape(str):
      """Escape str such that it's interpreted as a single argument by
      the shell."""
  
      # This isn't complete, but it's just enough to make NINJA_PYTHON work.
      if platform.is_windows():
          return str
      if '"' in str:
          return "'%s'" % str.replace("'", "\\'")
      return str
  
imports: from optparse import OptionParser
  import os
  import shlex
  import subprocess
  import sys
  import ninja_syntax
label_desc: Use image node_id 8 for calling a global function with example usage: shell_escape(str) and returns: str, str, unknown