def _get_cells(self, left, right, vertical):
if vertical:<EOL><INDENT>vcells = max(sum(self._shape(l)[<NUM_LIT:0>] for l in left),<EOL>self._shape(right)[<NUM_LIT:0>])<EOL>hcells = (max(self._shape(l)[<NUM_LIT:1>] for l in left) +<EOL>self._shape(right)[<NUM_LIT:1>])<EOL><DEDENT>else:<EOL><INDENT>vcells = max([self._shape(l)[<NUM_LIT:0>] for l in left] +<EOL>[self._shape(right)[<NUM_LIT:0>]])<EOL>hcells = sum([self._shape(l)[<NUM_LIT:1>] for l in left] +<EOL>[self._shape(right)[<NUM_LIT:1>]])<EOL><DEDENT>return hcells, vcells<EOL>
Calculate appropriate figure size based on left and right data.