code: def default_flag_attrs_for_argparse_action(
      action, flag_name, ignore_unknown_type=False
  ):
      attrs = {}
      if action.help:
          attrs["description"] = action.help
      if action.default is not None:
          attrs["default"] = _ensure_json_encodable(
              action.default, flag_name
          )
      if action.choices:
          attrs["choices"] = _ensure_json_encodable(
              action.choices, flag_name
          )
      if action.required:
          attrs["required"] = True
      if action.type:
          attrs["type"] = _flag_type_for_action(
              action.type,
              flag_name,
              ignore_unknown_type,
          )
      if action.__class__.__name__ == "_StoreTrueAction":
          _apply_store_true_flag_attrs(attrs)
      elif action.__class__.__name__ == "_StoreFalseAction":
          _apply_store_false_flag_attrs(attrs)
      elif action.__class__.__name__ == "BooleanOptionalAction":
          _apply_boolean_option_flag_attrs(action, attrs)
      if _multi_arg(action):
          attrs["arg-split"] = True
          _maybe_encode_splittable_default(attrs)
      return attrs
  
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 11 for calling a global function with example usage: default_flag_attrs_for_argparse_action(action, flag_name, ignore_unknown_type) and returns: attrs