code: def _resolve_source_for_location(
      source, dep, location, resolve_context
  ):
      res_proxy = ResourceProxy(location, dep.config)
      resolver = resolverlib.for_resdef_source(source, res_proxy)
      if not resolver:
          raise OpDependencyError(
              f"unsupported source '{source}' in {dep.resdef.name} resource"
          )
      return resolver.resolve(resolve_context)
  
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 21 for calling a global function with example usage: _resolve_source_for_location(source, dep, location, resolve_context) and returns: resolver