code: def _apply_resolve_dep_sources(
      op, dep, resolve_context, run, for_stage, resolved
  ):
      log.info(loglib.dim("Resolving %s"), dep.resdef.resolving_name)
      for source in dep.resdef.sources:
          if (
              not source.always_resolve
              and source.resolving_name in resolved
          ):
              log.info(
                  "Skipping resolution of %s because it's already resolved",
                  source.resolving_name,
              )
              continue
          if for_stage and _is_operation_source(source):
              log.info(
                  "Skipping resolution of %s because it's being staged",
                  source.resolving_name,
              )
              continue
          try:
              run_rel_resolved_paths = _resolve_dep_source(
                  op, source, dep, resolve_context, run
              )
          except op_dep.OpDependencyError as e:
              if not source.optional:
                  raise
              log.debug(e)
              log.info(
                  "Could not resolve %s - skipping because dependency is optional",
                  source.resolving_name,
              )
              continue
          else:
              resolved[source.resolving_name] = source_info = {
                  "uri": source.uri,
                  "paths": run_rel_resolved_paths,
              }
              _apply_source_config(dep.config, source, source_info)
  
imports: import logging
  import os
  import subprocess
  import time
  from guild import config
  from guild import exit_code
  from guild import log
  from guild import op_dep
  from guild import op_util
  from guild import run
  from guild import util
label_desc: Use image node_id 34 for calling a global function with example usage: _apply_resolve_dep_sources(op, dep, resolve_context, run, for_stage, resolved) without return types