code: def loc_to_index(self, loc):
          
          if loc is None:
              return self._active_renderer_index
          elif isinstance(loc, int):
              return loc
          elif isinstance(loc, collections.Iterable):
              assert len(loc) == 2, '"loc" must contain two items'
              return loc[0]*self.shape[0] + loc[1]
docs: Return index of the render window given a location index.
  
          Parameters
          ----------
          loc : int, tuple, or list
              Index of the renderer to add the actor to.  For example,
              ``loc=2`` or ``loc=(1, 1)``.
  
          Returns
          -------
          idx : int
              Index of the render window.