code: def parse_edges_arg_to_eid(g, edges, etid, argname="edges"):
      """Parse the :attr:`edges` argument and return an edge ID tensor.
  
      The resulting edge ID tensor has the same ID type and device of :attr:`g`.
  
      Parameters
      ----------
      g : DGLGraph
          Graph
      edges : pair of Tensor, Tensor, iterable[int]
          Argument for specifying edges.
      etid : int
          Edge type ID.
      argname : str, optional
          Argument name.
  
      Returns
      -------
      Tensor
          Edge ID tensor
      """
      if isinstance(edges, tuple):
          u, v = edges
          u = prepare_tensor(g, u, "{}[0]".format(argname))
          v = prepare_tensor(g, v, "{}[1]".format(argname))
          eid = g.edge_ids(u, v, etype=g.canonical_etypes[etid])
      else:
          eid = prepare_tensor(g, edges, argname)
      return eid
  
file_path: dgl/python/dgl/utils/checks.py
imports: from __future__ import absolute_import, division
  from collections.abc import Mapping
  from ..None import backend
  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: parse_edges_arg_to_eid(g, edges, etid, argname) and returns: eid