<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_warning_handler(codec, handler, data=None):
 """Wraps openjp2 library function opj_set_warning_handler. Set the warning handler use by openjpeg. Parameters codec : CODEC_TYPE Codec initialized by create_compress function. handler : python function The callback function to be used. user_data : anything User/client data. Raises ------ RuntimeError If the OpenJPEG library routine opj_set_warning_handler fails. """

    OPENJP2.opj_set_warning_handler.argtypes = [CODEC_TYPE,
                                                ctypes.c_void_p,
                                                ctypes.c_void_p]
    OPENJP2.opj_set_warning_handler.restype = check_error

    OPENJP2.opj_set_warning_handler(codec, handler, data)