@StateHandler()
  def End(self):
    """Final state.

    This method is called prior to destruction of the flow to give
    the flow a chance to clean up.
    """
    if self.runner.output is not None:
      self.Notify(
          "ViewObject", self.runner.output.urn,
          u"Completed with {0} results".format(len(self.runner.output)))

    else:
      self.Notify("FlowStatus", self.client_id,
                  "Flow %s completed" % self.__class__.__name__)
dataset/ETHPy150Open google/grr/grr/lib/flow.py/GRRFlow.End/original