class_docstr: Represent a single graph with additional attributes.
class_docstr_tok: ["Represent","a","single","graph","with","additional","attributes","."]
docstr: Build the graph from dgl.DGLGraph
  
  Parameters
  ----------
  dgl_g : dgl.DGLGraph
      The source graph
code: def from_dgl(self, dgl_g: dgl.DGLGraph):
      """
      Build the graph from dgl.DGLGraph
  
      Parameters
      ----------
      dgl_g : dgl.DGLGraph
          The source graph
      """
      if not (self.get_edge_num() == 0 and self.get_node_num() == 0):
          raise ValueError(
              "This graph isn't an empty graph. Please use an empty graph for conversion."
          )
      # assert self.get_edge_num() == 0 and self.get_node_num() == 0, \
      #     'This graph isn\'t an empty graph. Please use an empty graph for conversion.'
  
      # Add nodes
      self.add_nodes(dgl_g.number_of_nodes())
      for k, v in dgl_g.ndata.items():
          self.node_features[k] = v
  
      # Add edges
      src_tensor, tgt_tensor = dgl_g.edges()
      src_list = list(src_tensor.detach().cpu().numpy())
      tgt_list = list(tgt_tensor.detach().cpu().numpy())
      self.add_edges(src_list, tgt_list)
      for k, v in dgl_g.edata.items():
          self.edge_features[k] = v
      return self
  
imports: import os
  import warnings
  from collections import namedtuple
  from typing import Any, Callable, Dict, List, Tuple, Union
  import dgl
  import scipy.sparse
  import torch
  from torch.nn.utils.rnn import pad_sequence
  from .utils import EdgeNotFoundException, SizeMismatchException, check_and_expand, entail_zero_padding, int_to_list, slice_to_list
  from .views import BatchEdgeFeatView, BatchNodeFeatView, EdgeView, NodeFeatView, NodeView
label_desc: Use image node_id 25 for calling the GraphData obj's underlying member method code with example usage: obj.from_dgl(dgl_g) and returns: self