class_docstr: Traverser interface for tasks.
  
  Class for storing the state while performing a preorder-traversal of a
  task.
  
  Parameters
  ----------
  term : task
      The task to be traversed
  
  Attributes
  ----------
  term
      The current element in the traversal
  current
      The head of the current element in the traversal. This is simply `head`
      applied to the attribute `term`.
class_docstr_tok: ["Traverser","interface","for","tasks",".","Class","for","storing","the","state","while","performing","a","preorder-traversal","of","a","task",".","Parameters","--","--","--","--","--","term",":","task","The","task","to","be","traversed","Attributes","--","--","--","--","--","term","The","current","element","in","the","traversal","current","The","head","of","the","current","element","in","the","traversal",".","This","is","simply","`","head","`","applied","to","the","attribute","`","term","`","."]
docstr: Proceed to the next term in the preorder traversal.
docstr_tok: ["Proceed","to","the","next","term","in","the","preorder","traversal","."]
code: def next(self):
      """Proceed to the next term in the preorder traversal."""
  
      subterms = args(self.term)
      if not subterms:
          # No subterms, pop off stack
          self.term = self._stack.pop()
      else:
          self.term = subterms[0]
          self._stack.extend(reversed(subterms[1:]))
  
imports: from collections import deque
  from flash.core.serve.dag.task import istask, subs
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 4 for calling the Traverser obj's underlying member method code with example usage: obj.next() without return types