code: def iterator(self, plugins, context):
          
  
          test = pyblish.logic.registered_test()
          state = {
              "nextOrder": None,
              "ordersWithError": set()
          }
  
          signals = {
              pyblish.api.ValidatorOrder: self.validating,
              pyblish.api.ExtractorOrder: self.extracting,
              pyblish.api.IntegratorOrder: self.integrating,
          }
  
          for plug, instance in iterator(plugins, context):
  
              if instance is not None and not instance.data.get("publish", True):
                  continue
  
              state["nextOrder"] = plug.order
  
              for order in list(signals.keys()):
                  if pyblish.lib.inrange(plug.order, order):
                      signals.pop(order).emit()
  
              if not self.data["state"]["is_running"]:
                  raise StopIteration("Stopped")
  
              if test(**state):
                  raise StopIteration("Stopped due to %s" % test(**state))
  
              try:
                  # Notify GUI before commencing remote processing
                  self.about_to_process.emit(plug, instance)
  
                  result = self.host.process(plug, context, instance)
  
              except Exception as e:
                  raise StopIteration("Unknown error: %s" % e)
  
              else:
                  # Make note of the order at which the
                  # potential error error occured.
                  has_error = result["error"] is not None
                  if has_error:
                      state["ordersWithError"].add(plug.order)
  
              yield result
docs: Primary iterator
  
          CAUTION: THIS RUNS IN A SEPARATE THREAD
  
          This is the brains of publishing. It handles logic related
          to which plug-in to process with which Instance or Context,
          in addition to stopping when necessary.