'Set the selected row.  If ``index`` is specified, then select
row ``index``.  Otherwise, if ``delta`` is specified, then move
the current selection by ``delta`` (negative numbers for up,
positive numbers for down).  This will not move the selection
past the top or the bottom of the list.
:param see: If true, then call ``self.see()`` with the newly
selected index, to ensure that it is visible.'

def select(self, index=None, delta=None, see=True):

    if ((index is not None) and (delta is not None)):
        raise ValueError('specify    index    or    delta,    but    not    both')
    if (delta is not None):
        if (len(self.curselection()) == 0):
            index = ((-1) + delta)
        else:
            index = (int(self.curselection()[0]) + delta)
    self.selection_clear(0, 'end')
    if (index is not None):
        index = min(max(index, 0), (self.size() - 1))
        self.selection_set(index)
        if see:
            self.see(index)
