code: def split_edges_for_dgl_graph(
      cls,
      graph: dgl.DGLGraph,
      train_ratio: float,
      val_ratio: _typing.Optional[float] = ...,
  ) -> _typing.Union[
      _typing.Tuple[
          dgl.DGLGraph,
          dgl.DGLGraph,
          dgl.DGLGraph,
          dgl.DGLGraph,
          dgl.DGLGraph,
          dgl.DGLGraph,
          dgl.DGLGraph,
      ],
      _typing.Tuple[
          dgl.DGLGraph,
          dgl.DGLGraph,
          dgl.DGLGraph,
          dgl.DGLGraph,
          dgl.DGLGraph,
      ],
  ]:
      if not 0 < train_ratio < 1:
          raise ValueError(f"Invalid train_ratio as {train_ratio}")
      if isinstance(val_ratio, float):
          if not 0 < val_ratio < 1:
              raise ValueError(f"Invalid val_ratio as {val_ratio}")
          if not 0 < train_ratio + val_ratio < 1:
              raise ValueError(
                  f"Invalid combination (train_ratio, val_ratio) "
                  f"as ({train_ratio}, {val_ratio})"
              )
          return cls.__split_edges_train_val_test(
              graph, train_ratio, val_ratio
          )
      else:
          return cls.__split_edges_train_test(graph, train_ratio)
  
file_path: AutoGL/autogl/datasets/utils/_split_edges/_dgl_compatible.py
imports: import numpy
  import scipy.sparse
  import typing
  import dgl
  import autogl.data.graph
  from autogl.data.graph.utils.conversion import general_static_graph_to_dgl_graph
label_desc: Use image node_id 3 for calling the _SplitEdgesDGLImpl obj's underlying member method code with example usage: obj.split_edges_for_dgl_graph(cls, graph, train_ratio, val_ratio) and returns: cls, cls