parameters: (self, left, right, vertical)
return_statement: return hcells, vcells
docstring: Calculate appropriate figure size based on left and right data.
docstring_summary: Calculate appropriate figure size based on left and right data.
docstring_tokens: Calculate appropriate figure size based on left and right data .
function: def _get_cells(self, left, right, vertical):
          """
          Calculate appropriate figure size based on left and right data.
          """
  
          if vertical:
              # calculate required number of cells
              vcells = max(sum(self._shape(l)[0] for l in left),
                           self._shape(right)[0])
              hcells = (max(self._shape(l)[1] for l in left) +
                        self._shape(right)[1])
          else:
              vcells = max([self._shape(l)[0] for l in left] +
                           [self._shape(right)[0]])
              hcells = sum([self._shape(l)[1] for l in left] +
                           [self._shape(right)[1]])
          return hcells, vcells
function_tokens: def _get_cells ( self , left , right , vertical ) : if vertical : # calculate required number of cells vcells = max ( sum ( self . _shape ( l ) [ 0 ] for l in left ) , self . _shape ( right ) [ 0 ] ) hcells = ( max ( self . _shape ( l ) [ 1 ] for l in left ) + self . _shape ( right ) [ 1 ] ) else : vcells = max ( [ self . _shape ( l ) [ 0 ] for l in left ] + [ self . _shape ( right ) [ 0 ] ] ) hcells = sum ( [ self . _shape ( l ) [ 1 ] for l in left ] + [ self . _shape ( right ) [ 1 ] ] ) return hcells , vcells