code: def _flag_args(
      flag_vals, flag_dest, cmd_flags, cmd_args, force_flag_args
  ):
      flag_args = []
      for name, val in sorted(flag_vals.items()):
          cmd_flag = _cmd_flag_for_name(
              name, cmd_flags, force_flag_args
          )
          if cmd_flag:
              flag_args.extend(
                  _args_for_flag(
                      name, val, cmd_flag, flag_dest, cmd_args
                  )
              )
      return flag_args
  
imports: import logging
  import pprint
  from guild import flag_util
  from guild import util
  from guild import yaml_util
label_desc: Use image node_id 6 for calling a global function with example usage: _flag_args(flag_vals, flag_dest, cmd_flags, cmd_args, force_flag_args) and returns: flag_args