class_docstr: A Graphbolt dataset for legacy DGLDataset.
class_docstr_tok: ["A","Graphbolt","dataset","for","legacy","DGLDataset","."]
code: def __init__(self, legacy: DGLDataset):
      # Only supports single graph cases.
      assert len(legacy) == 1
      graph = legacy[0]
      # Handle OGB Dataset.
      if isinstance(graph, tuple):
          graph, _ = graph
      if graph.is_homogeneous:
          self._init_as_homogeneous_node_pred(legacy)
      else:
          self._init_as_heterogeneous_node_pred(legacy)
  
file_path: dgl/python/dgl/graphbolt/impl/legacy_dataset.py
imports: from typing import List, Union
  from dgl.data import AsNodePredDataset, DGLDataset
  from ..base import etype_tuple_to_str
  from ..dataset import Dataset, Task
  from ..itemset import ItemSet, ItemSetDict
  from ..sampling_graph import SamplingGraph
  from .basic_feature_store import BasicFeatureStore
  from .fused_csc_sampling_graph import from_dglgraph
  from .ondisk_dataset import OnDiskTask
  from .torch_based_feature_store import TorchBasedFeature
label_desc: Use image node_id 1 to create a new LegacyDataset object from inherited base classes: Dataset with example: obj = LegacyDataset(legacy)