class_docstr: Automagic DGL models from Graphistry Instances.
class_docstr_tok: ["Automagic","DGL","models","from","Graphistry","Instances","."]
code: def _convert_edge_dataframe_to_DGL(
      self, weight_column: Optional[str] = None, inplace: bool = False
  ):
      logger.info("-Converting edge DataFrame to DGL graph")
  
      if inplace:
          res = self
      else:
          res = self.bind()
  
      if res._node is None:
          res._node = config.IMPLICIT_NODE_ID
  
      if not res._removed_edges_previously:
          logger.info(
              f"--Node in convert dataframe to dgl: {res._node}"
          )
          res._remove_edges_not_in_nodes(res._node)
  
      if res._source is None:
          raise ValueError(
              'source column not set, try running g.bind(source="my_col") or g.edges(df, source="my_col")'
          )
  
      if res._destination is None:
          raise ValueError(
              'destination column not set, try running g.bind(destination="my_col") or g.edges(df, destination="my_col")'
          )
  
      (
          res._dgl_graph,
          res._adjacency,
          res._entity_to_index,
      ) = pandas_to_dgl_graph(
          res._edges,
          res._source,
          res._destination,
          weight_col=weight_column,
          device=res.device,
      )
      if res._entity_to_index is None:
          raise ValueError(
              "entity_to_index is None, something went wrong"
          )
      res._index_to_entity = {
          k: v for v, k in res._entity_to_index.items()
      }
      # this is a sanity check after _remove_edges_not_in_nodes
      res._check_nodes_lineup_with_edges()
      return res
  
imports: from collections import Counter
  from typing import Dict, Optional, TYPE_CHECKING, Tuple
  import numpy
  import pandas
  from .None import constants
  from .feature_utils import FeatureEngine, FeatureMixin, resolve_feature_engine, XSymbolic, YSymbolic, resolve_X, resolve_y
  from .util import setup_logger
label_desc: Use image node_id 6 for calling the DGLGraphMixin obj's underlying member method code with example usage: obj._convert_edge_dataframe_to_DGL(weight_column, inplace) and returns: res