code: def dep_for_depdef(depdef, flag_vals):
      resdef, res_location = resource_def(depdef, flag_vals)
      config = _resdef_config(resdef, flag_vals)
      return OpDependency(resdef, res_location, config)
  
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 2 for calling a global function with example usage: dep_for_depdef(depdef, flag_vals) and returns: OpDependency