def _SetMustSplitOnFirstLeaf(node):
 def FindFirstLeaf(node):
  if isinstance(node, pytree.Leaf):
   return node
  return FindFirstLeaf(node.children[0])
 pytree_utils.SetNodeAnnotation(FindFirstLeaf(node), pytree_utils.Annotation.MUST_SPLIT, True)

def _SetMustSplitOnFirstLeaf ( node ) : def FindFirstLeaf ( node ) : if isinstance ( node , pytree . Leaf ) : return node return FindFirstLeaf ( node . children [ 0 ] ) pytree_utils . SetNodeAnnotation ( FindFirstLeaf ( node ) , pytree_utils . Annotation . MUST_SPLIT , True )
set the "must split" annotation on the first leaf node .