def __getitem__(self, idx):
        if isinstance(idx, slice):
            n = self.__class__(self._header, self._keyword)
            n._indices = idx.indices(self._count)
            return n
        elif not isinstance(idx, int):
            raise ValueError('%s index must be an integer' % self._keyword)

        idx = list(range(*self._indices))[idx]
        return self._header[(self._keyword, idx)]
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/header.py/_HeaderCommentaryCards.__getitem__/original