def strahler_order(section):
if section.children:<EOL><INDENT>child_orders = [strahler_order(child) for child in section.children]<EOL>max_so_children = max(child_orders)<EOL>it = iter(co == max_so_children for co in child_orders)<EOL>any(it)<EOL>if any(it):<EOL><INDENT>return max_so_children + <NUM_LIT:1><EOL><DEDENT>return max_so_children<EOL><DEDENT>return <NUM_LIT:1><EOL>
Branching order of a tree section

    The strahler order is the inverse of the branch order,
    since this is computed from the tips of the tree
    towards the root.

    This implementation is a translation of the three steps described in
    Wikipedia (https://en.wikipedia.org/wiki/Strahler_number):

       - If the node is a leaf (has no children), its Strahler number is one.
       - If the node has one child with Strahler number i, and all other children
         have Strahler numbers less than i, then the Strahler number of the node
         is i again.
       - If the node has two or more children with Strahler number i, and no
         children with greater number, then the Strahler number of the node is
         i + 1.

    No efforts have been invested in making it computationnaly efficient, but
    it computes acceptably fast on tested morphologies (i.e., no waiting time).