class_docstr: Abstract class of on-the-fly generator used in the dataset.
  It generates on-the-fly graphs, which will be fed into the model.
class_docstr_tok: ["Abstract","class","of","on-the-fly","generator","used","in","the","dataset",".","It","generates","on-the-fly","graphs",",","which","will","be","fed","into","the","model","."]
code: def __init__(self, sizes, size_prob=None, dataset_len=0):
      self.sizes = sizes
      if sizes is not None:
          if size_prob is None:
              self.size_prob = np.ones(len(sizes)) / len(sizes)
          else:
              self.size_prob = size_prob
      # by default length of generator dataset is 0
      self._len = dataset_len
  
imports: import copy
  import math
  import types
  import random
  import networkx
  import numpy
  import torch
  import deepsnap
  from deepsnap.graph import Graph
  from deepsnap.hetero_graph import HeteroGraph
  import pdb
  from typing import Dict, List, Union
  import warnings
label_desc: Use image node_id 1 to create a new Generator object from inherited base classes: object with example: obj = Generator(sizes, size_prob, dataset_len)