code: def get_scales(self, i):
          
          # wrapping with np.asarray prevents an exception
          # on some datasets
          bool_idx = (np.asarray(self.layout['PANEL']) == i)
          xsc = None
          ysc = None
  
          if self.panel_scales_x:
              idx = self.layout.loc[bool_idx, 'SCALE_X'].values[0]
              xsc = self.panel_scales_x[idx-1]
  
          if self.panel_scales_y:
              idx = self.layout.loc[bool_idx, 'SCALE_Y'].values[0]
              ysc = self.panel_scales_y[idx-1]
  
          return types.SimpleNamespace(x=xsc, y=ysc)
docs: Return x & y scales for panel i
  
          Parameters
          ----------
          i : int
            Panel id
  
          Returns
          -------
          scales : types.SimpleNamespace
            Class attributes *x* for the x scale and *y*
            for the y scale of the panel