def calculate_node_height(root_node):
    """
    Calculates the height of a node by finding
    how many levels exist down to the node which is
    located deepest.
    """
    if root_node is None:
        return 0

    height =  1 + max(calculate_node_height(root_node.left),
               calculate_node_height(root_node.right)
               )
    setattr(root_node, 'height', height)
    return height