code: def _model_resource(spec, depdef):
      m = MODEL_RES_P.match(spec)
      if m is None:
          return None
      res_name = m.group(1)
      return _modeldef_resource(depdef.modeldef, res_name, depdef.opdef)
  
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 10 for calling a global function with example usage: _model_resource(spec, depdef) and returns: _modeldef_resource, None