class_docstr: A base class of GridSpec that specifies the geometry of the grid
  that a subplot will be placed.
class_docstr_tok: ["A","base","class","of","GridSpec","that","specifies","the","geometry","of","the","grid","that","a","subplot","will","be","placed","."]
docstr: Create and return a SuplotSpec instance.
          
docstr_tok: ["Create","and","return","a","SuplotSpec","instance","."]
code: def __getitem__(self, key):
      """Create and return a SuplotSpec instance."""
      nrows, ncols = self.get_geometry()
  
      def _normalize(key, size):  # Includes last index.
          if isinstance(key, slice):
              start, stop, _ = key.indices(size)
              if stop > start:
                  return start, stop - 1
          else:
              if key < 0:
                  key += size
              if 0 <= key < size:
                  return key, key
          raise IndexError("invalid index")
  
      if isinstance(key, tuple):
          try:
              k1, k2 = key
          except ValueError:
              raise ValueError("unrecognized subplot spec")
          num1, num2 = np.ravel_multi_index(
              [_normalize(k1, nrows), _normalize(k2, ncols)],
              (nrows, ncols),
          )
      else:  # Single key
          num1, num2 = _normalize(key, nrows * ncols)
  
      return SubplotSpec(self, num1, num2)
  
imports: from __future__ import absolute_import, division, print_function
  import six
  import copy
  import logging
  import warnings
  import numpy
  import matplotlib
  from matplotlib import _pylab_helpers, tight_layout, rcParams
  from matplotlib.transforms import Bbox
  import matplotlib._layoutbox
  from matplotlib.cbook import mplDeprecation
label_desc: Use image node_id 10 for calling the GridSpecBase obj's underlying member method code with example usage: obj.__getitem__(key) and returns: SubplotSpec, start,  unknown, key,  key