code: def _write_flags(parse_args_f, output_path):
      parser = _wrapped_parser(parse_args_f)
      flags = {}
      for action in parser._actions:
          _maybe_apply_flag(action, flags)
      log.debug("writing flags to %s: %s", output_path, flags)
      with open(output_path, "w") as f:
          json.dump(flags, f)
  
imports: import argparse
  import json
  import logging
  import sys
  from guild import entry_point_util
  from guild import flag_util
  from guild import log
  from guild import python_util
  from guild import util
label_desc: Use image node_id 4 for calling a global function with example usage: _write_flags(parse_args_f, output_path) without return types