'Retrieve Table rows by value slice.
Parameters
item : column element, list, ndarray, slice or tuple
Can be a value of the table primary index, a list/ndarray
of such values, or a value slice (both endpoints are included).
If a tuple is provided, the first element must be
an index to use instead of the primary key, and the
second element must be as above.'

def __getitem__(self, item):

    if isinstance(item, tuple):
        (key, item) = item
    else:
        key = self.table.primary_key
    index = self.indices[key]
    if (len(index.columns) > 1):
        raise ValueError(u'Cannot    use    .loc    on    multi-column    indices')
    if isinstance(item, slice):
        start = (MinValue() if (item.start is None) else item.start)
        stop = (MaxValue() if (item.stop is None) else item.stop)
        rows = index.range((start,), (stop,))
    else:
        if (not isinstance(item, (list, np.ndarray))):
            item = [item]
        rows = []
        for key in item:
            rows.extend(index.find((key,)))
    if (len(rows) == 0):
        raise KeyError(u'No    matches    found    for    key    {0}'.format(item))
    elif (len(rows) == 1):
        return self.table[rows[0]]
    return self.table[rows]
