code: def test_generator(self):
      pyg_dataset = Planetoid("./cora", "Cora")
      dg = Graph.pyg_to_graph(pyg_dataset[0])
  
      num_nodes = 500
      sizes = [2, 3]
  
      class NeighborGenerator(Generator):
          def __len__(self):
              return sizes
  
          def generate(self):
              graph = Graph(gen_graph(num_nodes, dg.G))
              return graph
  
      dataset = GraphDataset(None, generator=NeighborGenerator(sizes))
      self.assertTrue(dataset[0].node_feature.shape[0] == num_nodes)
  
imports: import random
  import torch
  import unittest
  from torch_geometric.datasets import TUDataset, Planetoid
  from copy import deepcopy
  from deepsnap.graph import Graph
  from deepsnap.hetero_graph import HeteroGraph
  from deepsnap.dataset import GraphDataset, Generator, EnsembleGenerator
  from tests.utils import simple_networkx_graph, simple_networkx_small_graph, simple_networkx_graph_alphabet, simple_networkx_dense_graph, simple_networkx_dense_multigraph, simple_networkx_multigraph, generate_dense_hete_dataset, generate_simple_small_hete_graph, generate_simple_dense_hete_graph, generate_simple_dense_hete_multigraph, generate_dense_hete_multigraph, gen_graph
label_desc: Use image node_id 7 for calling the TestDataset obj's underlying member method code with example usage: obj.test_generator() and returns: sizes, graph