def _set_awb_gains(self, value):
    self._check_camera_open()
    try:
        (red_gain, blue_gain) = value
    except (ValueError, TypeError):
        red_gain = blue_gain = value
    if (not ((0.0 <= red_gain <= 8.0) and (0.0 <= blue_gain <= 8.0))):
        raise PiCameraValueError(('Invalid gain(s) in (%f, %f) (valid range: 0.0-8.0)' % (red_gain, blue_gain)))
    mp = mmal.MMAL_PARAMETER_AWB_GAINS_T(mmal.MMAL_PARAMETER_HEADER_T(mmal.MMAL_PARAMETER_CUSTOM_AWB_GAINS, ct.sizeof(mmal.MMAL_PARAMETER_AWB_GAINS_T)), mo.to_rational(red_gain), mo.to_rational(blue_gain))
    self._camera.control.params[mmal.MMAL_PARAMETER_CUSTOM_AWB_GAINS] = mp
def _set_awb_gains(self, value):
    self._check_camera_open()
    try:
        (red_gain, blue_gain) = value
    except (ValueError, TypeError):
        red_gain = blue_gain = value
    if (not ((0.0 <= red_gain <= 8.0) and (0.0 <= blue_gain <= 8.0))):
        raise PiCameraValueError(('Invalid gain(s) in (%f, %f) (valid range: 0.0-8.0)' % (red_gain, blue_gain)))
    mp = mmal.MMAL_PARAMETER_AWB_GAINS_T(mmal.MMAL_PARAMETER_HEADER_T(mmal.MMAL_PARAMETER_CUSTOM_AWB_GAINS, ct.sizeof(mmal.MMAL_PARAMETER_AWB_GAINS_T)), mo.to_rational(red_gain), mo.to_rational(blue_gain))
    self._camera.control.params[mmal.MMAL_PARAMETER_CUSTOM_AWB_GAINS] = mp