def apply(self, clip):
        """Apply the effect to the clip."""
        if self.new_duration is None:
            self.new_duration = clip.duration

        if self.soonness < 0:
            raise ValueError("'sooness' should be a positive number")

        return clip.time_transform(
            lambda t: self._f_accel_decel(
                t=t,
                old_duration=clip.duration,
                new_duration=self.new_duration,
                abruptness=self.abruptness,
                soonness=self.soonness,
            )
        ).with_duration(self.new_duration)
Apply the effect to the clip.
moviepy/video/fx/AccelDecel.py