parameters: (depth)
docstring: Yields all trees of the given depth.
docstring_summary: Yields all trees of the given depth.
docstring_tokens: Yields all trees of the given depth .
function: def all_trees_of_depth(depth):
    """Yields all trees of the given depth."""
    if depth < 1:
      return
    elif depth == 1:
      yield BinaryTreeNode()
      return
    elif depth == 2:
      yield BinaryTreeNode(left=BinaryTreeNode(), right=BinaryTreeNode())
      return
  
    for node in all_trees_of_depth(depth - 1):
      yield BinaryTreeNode(left=node, right=BinaryTreeNode())
      yield BinaryTreeNode(left=BinaryTreeNode(), right=node)
  
    for left_node in all_trees_of_depth(depth - 1):
      for right_node in itertools.chain.from_iterable(all_trees_of_depth(d)
                                                      for d in xrange(2, depth)):
        yield BinaryTreeNode(left=left_node, right=right_node)
  
    for left_node in itertools.chain.from_iterable(all_trees_of_depth(d)
                                                   for d in xrange(2, depth - 1)):
      for right_node in all_trees_of_depth(depth - 1):
        yield BinaryTreeNode(left=left_node, right=right_node)
function_tokens: def all_trees_of_depth ( depth ) : if depth < 1 : return elif depth == 1 : yield BinaryTreeNode ( ) return elif depth == 2 : yield BinaryTreeNode ( left = BinaryTreeNode ( ) , right = BinaryTreeNode ( ) ) return for node in all_trees_of_depth ( depth - 1 ) : yield BinaryTreeNode ( left = node , right = BinaryTreeNode ( ) ) yield BinaryTreeNode ( left = BinaryTreeNode ( ) , right = node ) for left_node in all_trees_of_depth ( depth - 1 ) : for right_node in itertools . chain . from_iterable ( all_trees_of_depth ( d ) for d in xrange ( 2 , depth ) ) : yield BinaryTreeNode ( left = left_node , right = right_node ) for left_node in itertools . chain . from_iterable ( all_trees_of_depth ( d ) for d in xrange ( 2 , depth - 1 ) ) : for right_node in all_trees_of_depth ( depth - 1 ) : yield BinaryTreeNode ( left = left_node , right = right_node )