code: def _maybe_apply_flag(action, flags):
      flag_name = _flag_name(action)
      if not flag_name:
          log.debug("skipping %s - not a flag action", action)
          return
      if action.__class__.__name__ not in flag_action_class_names:
          if (
              action.__class__.__name__
              not in ignore_flag_action_class_names
          ):
              log.debug("skipping %s - not an action type", action)
          return
      attrs = _flag_attrs_for_action(action, flag_name)
      if attrs is not None:
          flags[flag_name] = attrs
          log.debug("added flag %r: %r", flag_name, attrs)
      else:
          log.debug(
              "unable to import %s flag for action %r",
              flag_name,
              action,
          )
  
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 8 for calling a global function with example usage: _maybe_apply_flag(action, flags) without return types