code: def _get_view_results(self, view):
          
          if view == TREE_VIEW:
              result = self.tree
          else:
              result = TextResult(tree_results=self.tree)
              result.cleanup()  # clean up text-style result dictionary
          return result
docs: Get the results based on the view