def bool_filter(val):
    """
    Convert true/false string to Python bool. Otherwise, return string.
    """
    trues = ['True', 'TRUE', 'true', 'yes', 'Yes']
    falses = ['False', 'FALSE', 'false', 'no', 'No']
    if any([val == t for t in trues]):
        return True
    elif any([val == f for f in falses]):
        return False
    else:
        return val