code: def layout(self, dimensions=None, **kwargs):
          
          dimensions = self._valid_dimensions(dimensions)
          if len(dimensions) == self.ndims:
              with item_check(False):
                  return NdLayout(self, **kwargs).reindex(dimensions)
          return self.groupby(dimensions, container_type=NdLayout, **kwargs)
docs: Group by supplied dimension(s) and lay out groups
  
          Groups data by supplied dimension(s) laying the groups along
          the dimension(s) out in a NdLayout.
  
          Args:
              dimensions: Dimension(s) to group by
  
          Returns:
              NdLayout with supplied dimensions