code: def _delete(self, pos, idx):
          
          _maxes, _lists, _keys, _index = self._maxes, self._lists, self._keys, self._index
  
          keys_pos = _keys[pos]
          lists_pos = _lists[pos]
  
          del keys_pos[idx]
          del lists_pos[idx]
          self._len -= 1
  
          len_keys_pos = len(keys_pos)
  
          if len_keys_pos > self._half:
  
              _maxes[pos] = keys_pos[-1]
  
              if len(_index) > 0:
                  child = self._offset + pos
                  while child > 0:
                      _index[child] -= 1
                      child = (child - 1) >> 1
                  _index[0] -= 1
  
          elif len(_keys) > 1:
  
              if not pos:
                  pos += 1
  
              prev = pos - 1
              _keys[prev].extend(_keys[pos])
              _lists[prev].extend(_lists[pos])
              _maxes[prev] = _keys[prev][-1]
  
              del _keys[pos]
              del _lists[pos]
              del _maxes[pos]
              del _index[:]
  
              self._expand(prev)
  
          elif len_keys_pos:
  
              _maxes[pos] = keys_pos[-1]
  
          else:
  
              del _keys[pos]
              del _lists[pos]
              del _maxes[pos]
              del _index[:]
docs: Delete the item at the given (pos, idx).
  
          Combines lists that are less than half the load level.
  
          Updates the index when the sublist length is more than half the load
          level. This requires decrementing the nodes in a traversal from the leaf
          node to the root. For an example traversal see self._loc.