<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_until(self, end_time: Time, with_logging=True) -> int: """Run the simulation until the provided end time. Parameters end_time The time to run the simulation until. The simulation will run until its clock is greater than or equal to the provided end time. with_logging Whether or not to log the simulation steps. Only works in an ipython environment. Returns ------- The number of steps the simulation took. """

        if not isinstance(end_time, type(self.clock.time)):
            raise ValueError(f"Provided time must be an instance of {type(self.clock.time)}")

        iterations = int(ceil((end_time - self.clock.time)/self.clock.step_size))
        self.take_steps(number_of_steps=iterations, with_logging=with_logging)
        assert self.clock.time - self.clock.step_size < end_time <= self.clock.time
        return iterations