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)
      keys = self.keys[:1] if self.dynamic else self.keys
      frame_ranges = dict(
          [
              (key, self.compute_ranges(layout, key, frame_ranges))
              for key in 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.
          empty = isinstance(view.main, Empty)
          if empty or view.main is None:
              continue
          elif not view.traverse(lambda x: x, [Element]):
              self.param.warning(
                  f"{view.main} is empty, skipping subplot."
              )
              continue
          else:
              layout_count += 1
          num = 0 if empty else layout_count
          subplots, adjoint_layout = self._create_subplots(
              view, positions, layout_dimensions, frame_ranges, num=num
          )
  
          # 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: from collections import defaultdict
  from itertools import groupby
  import numpy
  import param
  from bokeh.layouts import gridplot
  from bokeh.models import Axis, ColorBar, Column, ColumnDataSource, Div, Legend, Row, Title
  from bokeh.models.layouts import TabPanel, Tabs
  from ...core import AdjointLayout, Element, Empty, GridSpace, HoloMap, Layout, NdLayout, Store
  from ...core.options import SkipRendering
  from ...core.util import _STANDARD_CALENDARS, cftime_to_timestamp, cftime_types, get_method_owner, is_param_method, unique_iterator, wrap_tuple, wrap_tuple_streams
  from ...selection import NoOpSelectionDisplay
  from ..links import Link
  from ..plot import CallbackPlot, DimensionedPlot, GenericAdjointLayoutPlot, GenericCompositePlot, GenericElementPlot, GenericLayoutPlot, GenericOverlayPlot
  from ..util import attach_streams, collate, displayable
  from .links import LinkCallback
  from .util import cds_column_replace, decode_bytes, empty_plot, filter_toolboxes, get_default, make_axis, merge_tools, select_legends, sync_legends, theme_attr_json, update_shared_sources
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