original_docstring: Return a depth-first traversal of a tree.
  
    Args:
      start: the root of the tree.
      children_func: function taking a node to its sequence of children.
    Returns:
      a list of nodes in depth-first order
    
docstring: Return a depth-first traversal of a tree.
docstring_tokens: Return a depth - first traversal of a tree .
code: def depth_first(start, children_func):
    """Return a depth-first traversal of a tree.
  
    Args:
      start: the root of the tree.
      children_func: function taking a node to its sequence of children.
    Returns:
      a list of nodes in depth-first order
    """
    seen = set()
    result = []
  
    def traversal(node):
      if node in seen:
        return
      seen.add(node)
  
      for i in children_func(node):
        traversal(i)
      result.append(node)
  
    traversal(start)
    return result
code_tokens: def depth_first ( start , children_func ) : seen = set ( ) result = [ ] def traversal ( node ) : if node in seen : return seen . add ( node ) for i in children_func ( node ) : traversal ( i ) result . append ( node ) traversal ( start ) return result
short_docstring: Return a depth-first traversal of a tree.
short_docstring_tokens: Return a depth - first traversal of a tree .
comment: """Return a depth-first traversal of a tree.
  
    Args:
      start: the root of the tree.
      children_func: function taking a node to its sequence of children.
    Returns:
      a list of nodes in depth-first order
    """