code: def output(self, stream):
          
          for key, val in self.results.items():
              if isinstance(val, basestring):
                  print >> stream, '{0}: {1!s}'.format(key, val)
              elif isinstance(val, float):
                  print >> stream, '{0}: {1:.5f}'.format(key, val)
              elif val is None:
                  print >> stream, '{0}: '.format(key)
              else:
                  print >> stream, '{0}: {1!s}'.format(key, val)
          if self.results['Status'] == 'OK':
              return 0
          else:
              return 1
docs: Outputs the results of :meth:`.run` to the given stream. The results
          are presented similarly to HTTP headers, where each line has a key and
          value, separated by ``: ``. The ``Status`` key will always be available
          in the output.
  
          :param stream: The output file to write to.
          :returns: A return code that would be appropriate to return to the
                    operating system, e.g. zero means success, non-zero means
                    failure.
          :rtype: int