<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _validate_j2k_colorspace(self, cparams, colorspace):
 """ Cannot specify a colorspace with J2K. """

        if cparams.codec_fmt == opj2.CODEC_J2K and colorspace is not None:
            msg = 'Do not specify a colorspace when writing a raw codestream.'
            raise IOError(msg)