class_docstr: Plot a group of elements in a grid layout based on a GridSpace element
  object.
class_docstr_tok: ["Plot","a","group","of","elements","in","a","grid","layout","based","on","a","GridSpace","element","object","."]
code: def _create_subplots(self, layout, ranges):
      if isinstance(self.plot_size, tuple):
          width, height = self.plot_size
      else:
          width, height = self.plot_size, self.plot_size
  
      subplots = {}
      frame_ranges = self.compute_ranges(layout, None, ranges)
      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
          ]
      )
      collapsed_layout = layout.clone(shared_data=False, id=layout.id)
      for i, coord in enumerate(layout.keys(full_grid=True)):
          r = i % self.rows
          c = i // self.rows
  
          if not isinstance(coord, tuple):
              coord = (coord,)
          view = layout.data.get(coord, None)
          # Create subplot
          if view is not None:
              vtype = (
                  view.type
                  if isinstance(view, HoloMap)
                  else view.__class__
              )
              opts = self.lookup_options(view, "plot").options
          else:
              vtype = None
  
          if type(view) in (Layout, NdLayout):
              raise SkipRendering("Cannot plot nested Layouts.")
          if not displayable(view):
              view = collate(view)
  
          # Create axes
          kwargs = {}
          if width is not None:
              kwargs["frame_width"] = width
          if height is not None:
              kwargs["frame_height"] = height
          if c == 0:
              kwargs["align"] = "end"
          if c == 0 and r != 0:
              kwargs["xaxis"] = None
          if c != 0 and r == 0:
              kwargs["yaxis"] = None
          if r != 0 and c != 0:
              kwargs["xaxis"] = None
              kwargs["yaxis"] = None
  
          if "border" not in kwargs:
              kwargs["border"] = 3
  
          if (
              self.show_legend
              and c == (self.cols - 1)
              and r == (self.rows - 1)
          ):
              kwargs["show_legend"] = True
              kwargs["legend_position"] = "right"
          else:
              kwargs["show_legend"] = False
  
          if not self.shared_xaxis:
              kwargs["xaxis"] = None
  
          if not self.shared_yaxis:
              kwargs["yaxis"] = None
  
          # Create subplot
          plotting_class = Store.registry[self.renderer.backend].get(
              vtype, None
          )
          if plotting_class is None:
              if view is not None:
                  self.param.warning(
                      "Bokeh plotting class for %s type not found, "
                      "object will not be rendered." % vtype.__name__
                  )
          else:
              subplot = plotting_class(
                  view,
                  dimensions=self.dimensions,
                  show_title=False,
                  subplot=True,
                  renderer=self.renderer,
                  root=self.root,
                  ranges=frame_ranges,
                  uniform=self.uniform,
                  keys=self.keys,
                  **dict(opts, **kwargs),
              )
              collapsed_layout[coord] = (
                  subplot.layout
                  if isinstance(subplot, GenericCompositePlot)
                  else subplot.hmap
              )
              subplots[coord] = subplot
      return subplots, collapsed_layout
  
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 2 for calling the GridPlot obj's underlying member method code with example usage: obj._create_subplots(layout, ranges) and returns: subplots,  collapsed_layout