def _get_digits()

in pytouch/datasets/digit.py [0:0]


    def _get_digits(self, root, exclude):
        digit_set = []
        for target_class in sorted(self.class_to_idx.keys()):
            class_idx = self.class_to_idx[target_class]
            class_dir = os.path.join(root, target_class)
            for (
                class_dir,
                dirs,
                files,
            ) in os.walk(class_dir, topdown=True):
                if exclude is not None:
                    dirs[:] = list(filter(lambda x: x not in exclude, dirs))
                for fname in sorted(files):
                    if "baseline" not in fname:
                        path = os.path.join(class_dir, fname)
                        serial_number = path.split(os.path.sep)[-2]
                        item = path, class_idx, serial_number
                        digit_set.append(item)
        return digit_set