code: def get_typeid_by_target(gidx, etid, target):
      """Find the src/dst/etype id based on the target 'u', 'v' or 'e'."""
      src_id, dst_id = gidx.metagraph.find_edge(etid)
      if target in [0, "u"]:
          return src_id
      if target in [2, "v"]:
          return dst_id
      return etid
  
imports: from __future__ import absolute_import
  from .None import backend, ndarray
  from ._ffi.function import _init_api
  from .base import DGLError
label_desc: Use image node_id 4 for calling a global function with example usage: get_typeid_by_target(gidx, etid, target) and returns: etid, src_id, dst_id