code: def open_listing_file(path, echo_to_stderr=1):
      # Begin a new error listing. If path is None, no file
      # is opened, the error counter is just reset.
      global listing_file, num_errors, echo_file
      if path is not None:
          listing_file = open_new_file(path)
      else:
          listing_file = None
      if echo_to_stderr:
          echo_file = sys.stderr
      else:
          echo_file = None
      num_errors = 0
  
imports: from __future__ import absolute_import
  import sys
  from contextlib import contextmanager
  from ..Utils import open_new_file
  from .None import DebugFlags
  from .None import Options
label_desc: Use image node_id 4 for calling a global function with example usage: open_listing_file(path, echo_to_stderr) without return types