def _boolean(value):
    """
    Map a boolean-like value to a Python bool instance.
    """
    try:
        return bool(int(value))
    except ValueError:
        pass
    value = value.lower()
    if value in ['true', 'yes']:
        return True
    elif value in ['false', 'no']:
        return False
    raise ValueError('Unrecognised boolean-like value %r' % value)
