class_docstr: A Layout is an ViewableTree with ViewableElement objects as leaf
  values. Unlike ViewableTree, a Layout supports a rich display,
  displaying leaf items in a grid style layout. In addition to the
  usual ViewableTree indexing, Layout supports indexing of items by
  their row and column index in the layout.
  
  The maximum number of columns in such a layout may be controlled
  with the cols method.
class_docstr_tok: ["A","Layout","is","an","ViewableTree","with","ViewableElement","objects","as","leaf","values",".","Unlike","ViewableTree",",","a","Layout","supports","a","rich","display",",","displaying","leaf","items","in","a","grid","style","layout",".","In","addition","to","the","usual","ViewableTree","indexing",",","Layout","supports","indexing","of","items","by","their","row","and","column","index","in","the","layout",".","The","maximum","number","of","columns","in","such","a","layout","may","be","controlled","with","the","cols","method","."]
docstr: Tuple indicating the number of rows and columns in the Layout.
code: def shape(self):
      "Tuple indicating the number of rows and columns in the Layout."
      num = len(self)
      if num <= self._max_cols:
          return (1, num)
      nrows = num // self._max_cols
      last_row_cols = num % self._max_cols
      return nrows + (1 if last_row_cols else 0), min(
          num, self._max_cols
      )
  
imports: import numpy
  import param
  from .None import traversal
  from .dimension import Dimension, Dimensioned, ViewableElement, ViewableTree
  from .ndmapping import NdMapping, UniformNdMapping
label_desc: Use image node_id 3 for calling the Layout obj's underlying member method code with example usage: obj.shape() and returns: unknown,  min, int,  num