def METHOD_NAME(self):
    todo_shards = []
    for task in self.todo:
        shard = [task.shard.start, task.shard.end]
        if task.shard.record_indices:
            shard.append(task.shard.record_indices)
        todo_shards.append(shard)
    doing_shards = []
    for task_id in self.doing:
        task = self.doing[task_id].task
        shard = [task.shard.start, task.shard.end]
        if task.shard.record_indices:
            shard.append(task.shard.record_indices)
        doing_shards.append(shard)
    return DatasetShardCheckpoint(
        dataset_name=self._dataset_splitter.dataset_name,
        todo=todo_shards,
        doing=doing_shards,
        epoch=self._dataset_splitter.epoch,
    )