def match_preview(self, index, *args):
        if not self.p.cwdidx:
            return
        if not self.p.fileops.recursive and index.parent() != self.p.cwdidx:
            return
        target = helpers.splitpath_os(self.p.get_path(index))
        if self.p.cwd in target[0] and target in self.p.targets:
            idx = self.p.targets.index(target)
            try:
                # If preview differs from its original name, show the preview.
                if target[1] + target[2] != self.p.previews[idx][1]:
                    for i in ["utf-8", "latin1"]:
                        try:
                            return self.p.previews[idx][1].decode(i)
                        except __HOLE__:
                            pass
                    return self.p.previews[idx][1]
                # Otherwise show "\1" to indicate that nothing changed.
                else:
                    return "\\1"
            except IndexError:
                return "err"
dataset/ETHPy150Open mikar/demimove/demimove/gui.py/DirModel.match_preview