def color_lines(self, data):
        decoded_data = self._decode(data)
        # TODO: This will only work if all lines are received at once. Instead
        # of direclty splitting lines, we should buffer the data lines until
        # the last character is a line break
        lines = decoded_data.splitlines(True)  # Keep line breaks
        colored_lines = [self.colorize_cmake(l) for l in lines]
        colored_data = ''.join(colored_lines)
        encoded_data = self._encode(colored_data)
        return encoded_data
Apply colorization rules to each line in data
dataset/ETHPy150Open catkin/catkin_tools/catkin_tools/jobs/commands/cmake.py/CMakeIOBufferProtocol.color_lines