code: def _run_id_flag_val_candidates(resdef, flag_vals):
      candidates = []
      for name in resdef_flag_name_candidates(resdef):
          flag_val = flag_vals.get(name)
          if not flag_val:
              continue
          if not isinstance(flag_val, list):
              flag_val = [str(flag_val)]
          candidates.extend(flag_val)
      return candidates
  
imports: import os
  import re
  import logging
  import typing
  from guild import cli
  from guild import resolver
  from guild import resourcedef
  from guild import util
label_desc: Use image node_id 42 for calling a global function with example usage: _run_id_flag_val_candidates(resdef, flag_vals) and returns: candidates