def __getitem__(self, index):
        """ Get a single item.

        >>> kvl = KeyValueList([('red', 'rose'), ('blue', 'sea'),
        ... ('green', 'grass'), ('blue', 'sky')])
        >>> kvl[2]
        ('green', 'grass')
        >>> kvl[9]
        Traceback (most recent call last):
          File "<stdin>", line 1, in ?
        IndexError: list index out of range

        """
        try:
            got = list.__getitem__(self, index)
        except __HOLE__:
            try:
                return next(self.get(index))
            except StopIteration:
                return None
        else:
            if isinstance(index, slice):
                return KeyValueList(got)
            else:
                return got
dataset/ETHPy150Open nigelsmall/httpstream/httpstream/kvlist.py/KeyValueList.__getitem__