code: def collapse_pane(self, side):
          
          # TODO: this is too tied to one configuration, need to figure
          # out how to generalize this
          hsplit = self.w['hpnl']
          sizes = hsplit.get_sizes()
          lsize, msize, rsize = sizes
          if self._lsize is None:
              self._lsize, self._rsize = lsize, rsize
          self.logger.debug("left=%d mid=%d right=%d" % (
              lsize, msize, rsize))
          if side == 'right':
              if rsize < 10:
                  # restore pane
                  rsize = self._rsize
                  msize -= rsize
              else:
                  # minimize pane
                  self._rsize = rsize
                  msize += rsize
                  rsize = 0
          elif side == 'left':
              if lsize < 10:
                  # restore pane
                  lsize = self._lsize
                  msize -= lsize
              else:
                  # minimize pane
                  self._lsize = lsize
                  msize += lsize
                  lsize = 0
          hsplit.set_sizes([lsize, msize, rsize])
docs: Toggle collapsing the left or right panes.