

def _apply_validator_chain(chain, value, handler):
    'Apply validators in sequence to a value.'
    if hasattr(chain, 'validate'):
        chain = [chain]
    for validator in chain:
        if hasattr(validator, 'validate'):
            value = validator.validate(value, handler)
        else:
            raise web.HTTPError(500)
    return value

dataset/ETHPy150Open refinery29/chassis/chassis/util/params.py _apply_validator_chain/original