def normalize_query_params(param_name, value, replacements=None):
    """Turns `True`->`true`, `False`->`false` and replaces param name if needed."""
    if replacements and param_name in replacements.keys():
        param_name = replacements[param_name]
    return (param_name, 'true' if value == True else 'false' if value == 
        False else value)
