code: def apply(self, gen):
      ret_gen = functools.partial(gen, generator=self.generator)
      ret = type(self).from_generator_func(ret_gen)
      return ret
  
imports: import os
  import sys
  import time
  import warnings
  import functools
  import numpy
  from collections import defaultdict, OrderedDict
  import paddle.distributed.fleet
  import pgl
  from pgl.graph_kernel import skip_gram_gen_pair
  from pgl.utils.logger import log
  from pgl.distributed import DistGraphClient, DistGraphServer
  from pgl.utils.data import Dataloader, StreamDataset
  from pgl.distributed import helper
  from pgl.utils.logger import log
  from utils.config import prepare_config
  from datasets.node import NodeGenerator
  from datasets.walk import WalkGenerator
  from datasets.ego_graph import ego_graph_sample, EgoGraphGenerator
  from datasets.pair import PairGenerator
label_desc: Use image node_id 2 for calling the Generator obj's underlying member method code with example usage: obj.apply(gen) and returns: ret