def __getitem__(self, index):
        index = normalize_slice(len(self), index)
        counter = 0
        parts = []
        for chunk in self.basefmtstrs:
            if index.start < counter + len(chunk) and index.stop > counter:
                start = max(0, index.start - counter)
                end = min(index.stop - counter, len(chunk))
                if end - start == len(chunk):
                    parts.append(chunk)
                else:
                    s_part = chunk.s[max(0, index.start - counter): index.stop - counter]
                    parts.append(Chunk(s_part, chunk.atts))
            counter += len(chunk)
            if index.stop < counter:
                break
        return FmtStr(*parts) if parts else fmtstr('')
dataset/ETHPy150Open thomasballinger/curtsies/curtsies/formatstring.py/FmtStr.__getitem__/original