<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_handler(column_name, value, predicate_refs):
 """handle predicate's return value"""


    # only does validate when attribute value is not None
    # else, just return it, let sqlalchemy decide if the value was legal according to `nullable` argument's value
    if value is not None:
        for predicate_ref in predicate_refs:
            predicate, predicate_name, predicate_args = _decode_predicate_ref(predicate_ref)
            validate_result = predicate(value, *predicate_args)

            if isinstance(validate_result, dict) and 'value' in validate_result:
                value = validate_result['value']
            elif type(validate_result) != bool:
                raise Exception(
                    'predicate (name={}) can only return bool or dict(value=new_value) value'.format(predicate_name))
            elif not validate_result:
                raise ModelInvalid(u'db model validate failed: column={}, value={}, predicate={}, arguments={}'.format(
                    column_name, value, predicate_name, ','.join(map(str, predicate_args))
                ))
    return value