def _remove_code_blocks(self, text: str) -> str:
        """Main method to remove code blocks from the input text.
        Handles interruptions and delegates to specific methods based on the current state.
        """
        if self._interrupted:
            self._in_code_block = False
            return text

        # Pattern to match three consecutive backticks (code block delimiter)
        code_block_pattern = r"```"
        match = re.search(code_block_pattern, text)

        if self._in_code_block:
            return self._handle_in_code_block(match, text)

        return self._handle_not_in_code_block(match, text, code_block_pattern)
Main method to remove code blocks from the input text.
        Handles interruptions and delegates to specific methods based on the current state.
        
src/pipecat/utils/text/markdown_text_filter.py