def get_node_sum(self, age=None):
        """Get sum of all branches in the tree.

        Returns:
            int: The sum of all nodes grown until the age.
        """
        if age is None:
            age = self.age

        return age if self.comp == 1 else int((pow(self.comp, age+1) - 1) / (self.comp - 1))
def get_node_sum ( self , age = None ) : if age is None : age = self . age return age if self . comp == 1 else int ( ( pow ( self . comp , age + 1 ) - 1 ) / ( self . comp - 1 ) )
Get sum of all branches in the tree.

        Returns:
            int: The sum of all nodes grown until the age.