def validate_bool_arg(args, name):
    """Validate a boolean argument."""
    value = args.get(name) if isinstance(args, dict) else args
    if not value:
        return False
    if value.lower() in ('n', 'no', '0', 'off', 'disabled'):
        return False
    elif value.lower() in ('y', 'yes', '1', 'on', 'enabled'):
        return True
    raise ValueError('invalid boolean for {0}: {1}'.format(name, value))
