code: def _apply_resource_flagdef(flag_name, opdef, for_source, flag_vals):
      from guild import guildfile
  
      assert not opdef.get_flagdef(flag_name), flag_name
      flagdef = guildfile.FlagDef(flag_name, {}, opdef)
      opdef.flags.append(flagdef)
      _maybe_apply_run_id_choices(for_source, flag_vals, flagdef)
  
imports: import click
  from guild import click_util
  from .None import ac_support
  from .None import remote_support
label_desc: Use image node_id 12 for calling a global function with example usage: _apply_resource_flagdef(flag_name, opdef, for_source, flag_vals) without return types