code: def etype_str_to_tuple(c_etype):
      """Convert canonical etype from string to tuple.
  
      Examples
      --------
      >>> c_etype_str = "user:like:item"
      >>> c_etype = _etype_str_to_tuple(c_etype_str)
      >>> print(c_etype)
      ("user", "like", "item")
      """
      if isinstance(c_etype, tuple):
          return c_etype
      ret = tuple(c_etype.split(CANONICAL_ETYPE_DELIMITER))
      assert len(ret) == 3, (
          "Passed-in canonical etype should be in format of 'str:str:str'. "
          f"But got {c_etype}."
      )
      return ret
  
file_path: dgl/python/dgl/graphbolt/base.py
imports: from dataclasses import dataclass
  import torch
  from torch.utils.data import functional_datapipe
  from torchdata.datapipes.iter import IterDataPipe
  from ..utils import recursive_apply
label_desc: Use image node_id 4 for calling a global function with example usage: etype_str_to_tuple(c_etype) and returns: ret, c_etype