code: def result(self, root = None):
      
      root = root or self._result
      if isinstance(root, Aggregator):
        return root.result()
      else:
        result = {}
        for key, value in six.iteritems(root):
          if value:
            result[key] = self.result(value)
        return result
docs: Formats the result.