def generate_video(
        self,
        length: int = 32,
        first_label: LabelName = LabelName.NORMAL,
        p_state_switch: float = 0.2,
    ) -> tuple[list[np.ndarray], list[np.ndarray]]:
        """Generate video clip with a random sequence of anomalous frames.

        Args:
            length (int): Length of the video sequence in number of frames.
            first_label (LabelName): Label of the first frame (normal or abnormal).
            p_state_switch (float): Probability of transitioning between normal and anomalous in consecutive frames.

        Returns:
            tuple[list[np.ndarray], list[np.ndarray]]: List of frames and list of masks.
        """
        frames: list[np.ndarray] = []
        masks: list[np.ndarray] = []
        state = 1 if first_label == LabelName.NORMAL else -1
        for _ in range(length):
            state = state * -1 if self.rng.random() < p_state_switch else state
            label = LabelName.NORMAL if state == 1 else LabelName.ABNORMAL
            frame, mask = self.generate_image(label=label)
            frames.append(frame)
            masks.append(mask)
        return frames, masks
Generate video clip with a random sequence of anomalous frames.

        Args:
            length (int): Length of the video sequence in number of frames.
            first_label (LabelName): Label of the first frame (normal or abnormal).
            p_state_switch (float): Probability of transitioning between normal and anomalous in consecutive frames.

        Returns:
            tuple[list[np.ndarray], list[np.ndarray]]: List of frames and list of masks.
        
tests/helpers/data.py