Repository: ManimCommunity/manim
File: manim/animation/speedmodifier.py (Python)

Code before:
        super().__init__(
            self.anim.mobject,
            rate_func=self.rate_func,
            run_time=total_time * self.anim.run_time,
            **kwargs,
        )

    def setup(self, anim):
        if type(anim) is Wait:
            return ChangedWait(
                run_time=anim.run_time,
                stop_condition=anim.stop_condition,
                frozen_frame=anim.is_static_wait,
            )
        return prepare_animation(anim)

    def get_total_time(self) -> float:
        prevnode = 0
        m = self.speedinfo[0]
        total_time = 0
        for node, n in list(self.speedinfo.items())[1:]:
            dur = node - prevnode
            total_time += dur * self.f_inv_1(m, n)
            prevnode = node
            m = n
        # print(total_time)
        return total_time

    @classmethod
    def add_updater(
        self,
        mobject: Mobject,
        update_function: Updater,
        index: int | None = None,
        call_updater: bool = False,
    ):
        parameters = get_parameters(update_function)
        if "dt" in parameters:
            mobject.add_updater(
                lambda m, dt: update_function(
                    m, ChangeSpeed.dt if ChangeSpeed.changed else dt
                ),
                index=index,
                call_updater=call_updater,
            )
        else:
            mobject.add_updater(update_function, index=index, call_updater=call_updater)

    def interpolate(self, alpha: float) -> None:
        self.anim.interpolate(alpha)


Review comment (bug):
Debug print, should be removed.

```suggestion
```

Code after:

            self.conditions.append(condition)

            def function(
                t,
                curr_time=curr_time,
                init_speed=init_speed,
                final_speed=final_speed,
                dur=dur,
                prevnode=prevnode,
            ):
                return (
                    self.speed_modifier(
                        (scaled_total_time * t - curr_time) / dur,
                        init_speed,
                        final_speed,
                    )
                    * dur
                    + prevnode
                )

            self.functions.append(function)

            curr_time += self.f_inv_1(init_speed, final_speed) * dur
            prevnode = node
            init_speed = final_speed

        def func(t):
            if t == 1:
                ChangeSpeed.is_changing_dt = False
            new_t = piecewise(
                self.rate_func(t),
                [condition(self.rate_func(t)) for condition in self.conditions],
                self.functions,
            )
            if self.affects_speed_updaters:
                ChangeSpeed.dt = (new_t - self.t) * self.anim.run_time
                self.t = new_t
            return new_t

        self.anim.set_rate_func(func)

        super().__init__(
            self.anim.mobject,
            rate_func=self.rate_func,
            run_time=scaled_total_time * self.anim.run_time,
            **kwargs,
        )

    def setup(self, anim):
        if type(anim) is Wait: