code: def split_edges_for_data(
      data: _typing.Union[
          dgl.DGLGraph, autogl.data.graph.GeneralStaticGraph
      ],
      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 isinstance(data, dgl.DGLGraph):
          if not data.is_homogeneous:
              raise ValueError(
                  "provided DGL graph to split edges MUST be homogeneous"
              )
          else:
              return _SplitEdgesDGLImpl.split_edges_for_dgl_graph(
                  data, train_ratio, val_ratio
              )
      elif isinstance(data, autogl.data.graph.GeneralStaticGraph):
          if not (
              data.nodes.is_homogeneous and data.edges.is_homogeneous
          ):
              raise ValueError(
                  "Provided instance of GeneralStaticGraph MUST be homogeneous"
              )
          else:
              return _SplitEdgesDGLImpl.split_edges_for_dgl_graph(
                  general_static_graph_to_dgl_graph(data),
                  train_ratio,
                  val_ratio,
              )
      else:
          raise TypeError(f"Illegal provided data {data}")
  
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 1 for calling a global function with example usage: split_edges_for_data(data, train_ratio, val_ratio) and returns: _SplitEdgesDGLImpl, _SplitEdgesDGLImpl