def _get_sensors()

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


    def _get_sensors(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[:] = self._exclude_sensors(dirs, exclude)
                for fname in sorted(files):
                    path = os.path.join(class_dir, fname)
                    # if self.baseline not in path:
                    sensor_type = path.split(os.path.sep)[-3]
                    serial_number = path.split(os.path.sep)[-2]
                    _log.debug(
                        f"Found sensor type {sensor_type} with serial {serial_number}"
                    )
                    item = path, class_idx, sensor_type, serial_number
                    digit_set.append(item)
        return digit_set