code: def _build_graph(self, res) -> Plottable:
      _, _, _, dgl, _, _, _, _ = lazy_embed_import_dep()
      s, r, t = res._triplets.T
  
      if res._train_idx is not None:
          g_dgl = dgl.graph(
              (s[res._train_idx], t[res._train_idx]), num_nodes=res._num_nodes  # type: ignore
          )
          g_dgl.edata[dgl.ETYPE] = r[res._train_idx]
  
      else:
          g_dgl = dgl.graph(
              (s, t), num_nodes=res._num_nodes  # type:ignore
          )
          g_dgl.edata[dgl.ETYPE] = r
  
      g_dgl.edata["norm"] = dgl.norm_by_dst(g_dgl).unsqueeze(-1)
      res._kg_dgl = g_dgl
      return res
  
imports: import logging
  import numpy
  import pandas
  from typing import Optional, Union, Callable, List, TYPE_CHECKING, Any, Tuple
  from .PlotterBase import Plottable
  from .compute.ComputeMixin import ComputeMixin
label_desc: Use image node_id 3 for calling the HeterographEmbedModuleMixin obj's underlying member method code with example usage: obj._build_graph(res) and returns: res