code: def generator_factory(mother_class):
      def generator_progress(iteritem, iterations=None, *args, **kw):
          if iterations is None:
              iterations = len(iteritem)
          assert iterations
          mbar = mother_class(iterations, *args, **kw)
          for item in iteritem:
              yield item
              mbar.update()
  
      return generator_progress
  
label_desc: Use image node_id 1 for calling a global function with example usage: generator_factory(mother_class) and returns: generator_progress