code: def _package_resource(spec, depdef):
      m = PACKAGE_RES_P.match(spec)
      if m is None:
          return None
      pkg_name = m.group(1)
      res_name = m.group(2)
      res = _find_package_resource(pkg_name, res_name)
      if not res:
          raise OpDependencyError(
              f"resource '{spec}' required by operation "
              f"'{depdef.opdef.fullname}' is not installed"
          )
      return res.resdef, _package_res_location(res)
  
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 13 for calling a global function with example usage: _package_resource(spec, depdef) and returns: res,  _package_res_location, None