code: def apply_flags(
      opdef, import_flags_data_cb, apply_flags_data_cb=None
  ):
      log_flags_info("### Script flags for %s", opdef.fullname)
      if _flags_import_disabled(opdef):
          log_flags_info("flags import disabled - skipping")
          return
      import_all_marker = object()
      to_import = _flags_to_import(opdef, import_all_marker)
      to_skip = _flags_to_skip(opdef)
      try:
          flags_data = import_flags_data_cb()
      except Exception as e:
          if log.getEffectiveLevel() <= logging.DEBUG:
              log.exception(repr(import_flags_data_cb))
          log.warning(e)
      else:
          if apply_flags_data_cb:
              apply_flags_data_cb(flags_data)
          import_data = {
              name: flags_data[name]
              for name in flags_data
              if (
                  (to_import is import_all_marker or name in to_import)
                  and not name in to_skip
              )
          }
          opdef.merge_flags(
              _ImportedFlagsOpDefProxy(import_data, opdef)
          )
  
imports: import logging
  import os
  from guild import cli
  from guild import guildfile
  from guild import util
  from guild import yaml_util
label_desc: Use image node_id 1 for calling a global function with example usage: apply_flags(opdef, import_flags_data_cb, apply_flags_data_cb) without return types