def modify_previews(self, previews):
        if self.countcheck:
            lenp, base, step = len(previews), self.countbase, self.countstep
            countlen = len(str(lenp))
            countrange = xrange(base, lenp * step + 1, step)
            if self.countfill:
                count = (str(i).rjust(countlen, "0") for i in countrange)
            else:
                count = (str(i) for i in countrange)

        modified = []
        for preview in previews:
            name = preview[1]
            if not self.remext and not self.keepext:
                name += preview[2]
            if self.casecheck:
                name = self.apply_case(name)
            if self.spacecheck:
                name = self.apply_space(name)
            if self.deletecheck:
                name = self.apply_delete(name)
            if self.removecheck:
                name = self.apply_remove(name)
            if self.insertcheck:
                name = self.apply_insert(name)
            if self.matchcheck:
                name = self.apply_replace(name)
            if self.countcheck:
                try:
                    name = self.apply_count(name, count.next())
                except __HOLE__:
                    pass

            if self.keepext:
                name += preview[2]

            preview = ((preview[0], preview[1] + preview[2]), name)
            modified.append(preview)

        return modified
dataset/ETHPy150Open mikar/demimove/demimove/fileops.py/FileOps.modify_previews