def _total_rectangles(tree):
return sum(len(sec.children) + sec.points.shape[<NUM_LIT:0>] - <NUM_LIT:1><EOL>for sec in tree.iter_sections())<EOL>
Calculate the total number of segments that are required
for the dendrogram. There is a vertical line for each segment
and two horizontal line at each branching point