<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def advance_to_checkpoint(self, checkpoint):
 """ Advance to the specified checkpoint, passing all preceding checkpoints including the specified checkpoint. """

        if checkpoint in self._checkpoints:
            for cp in self._checkpoints:
                self.insert(cp)
                if cp == checkpoint:
                    return cp
        else:
            raise InvalidCheckpointError(checkpoint)