code: def _init_layout(self, layout):
      # Situate all the Layouts in the grid and compute the gridspec
      # indices for all the axes required by each LayoutPlot.
      layout_count = 0
      collapsed_layout = layout.clone(shared_data=False, id=layout.id)
      frame_ranges = self.compute_ranges(layout, None, None)
      frame_ranges = dict(
          [
              (key, self.compute_ranges(layout, key, frame_ranges))
              for key in self.keys
          ]
      )
      layout_items = layout.grid_items()
      layout_dimensions = (
          layout.kdims if isinstance(layout, NdLayout) else None
      )
      layout_subplots, layouts, paths = {}, {}, {}
      for r, c in self.coords:
          # Get view at layout position and wrap in AdjointLayout
          key, view = layout_items.get(
              (c, r) if self.transpose else (r, c), (None, None)
          )
          view = (
              view
              if isinstance(view, AdjointLayout)
              else AdjointLayout([view])
          )
          layouts[(r, c)] = view
          paths[r, c] = key
  
          # Compute the layout type from shape
          layout_lens = {1: "Single", 2: "Dual", 3: "Triple"}
          layout_type = layout_lens.get(len(view), "Single")
  
          # Get the AdjoinLayout at the specified coordinate
          positions = AdjointLayoutPlot.layout_dict[layout_type][
              "positions"
          ]
  
          # Create temporary subplots to get projections types
          # to create the correct subaxes for all plots in the layout
          layout_key, _ = layout_items.get((r, c), (None, None))
          if isinstance(layout, NdLayout) and layout_key:
              layout_dimensions = dict(
                  zip(layout_dimensions, layout_key)
              )
  
          # Generate the axes and create the subplots with the appropriate
          # axis objects, handling any Empty objects.
          obj = layouts[(r, c)]
          empty = isinstance(obj.main, Empty)
          if empty:
              obj = AdjointLayout([])
          else:
              layout_count += 1
          subplot_data = self._create_subplots(
              obj,
              positions,
              layout_dimensions,
              frame_ranges,
              num=0 if empty else layout_count,
          )
          subplots, adjoint_layout = subplot_data
  
          # Generate the AdjointLayoutsPlot which will coordinate
          # plotting of AdjointLayouts in the larger grid
          plotopts = self.lookup_options(view, "plot").options
          layout_plot = AdjointLayoutPlot(
              adjoint_layout, layout_type, subplots, **plotopts
          )
          layout_subplots[(r, c)] = layout_plot
          if layout_key:
              collapsed_layout[layout_key] = adjoint_layout
      return collapsed_layout, layout_subplots, paths
  
imports: import param
  from holoviews.plotting.util import attach_streams
  from ...core import AdjointLayout, Empty, GridMatrix, GridSpace, HoloMap, NdLayout
  from ...core.options import Store
  from ...core.util import wrap_tuple
  from ...element import Histogram
  from ..plot import CallbackPlot, DimensionedPlot, GenericAdjointLayoutPlot, GenericCompositePlot, GenericElementPlot, GenericLayoutPlot
  from .util import configure_matching_axes_from_dims, figure_grid
label_desc: Use image node_id 3 for calling the LayoutPlot obj's underlying member method code with example usage: obj._init_layout(layout) and returns: collapsed_layout,  layout_subplots,  paths