<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def workaround_lowering_pass(ir_blocks, query_metadata_table):
 """Extract locations from TernaryConditionals and rewrite their Filter blocks as necessary."""

    new_ir_blocks = []

    for block in ir_blocks:
        if isinstance(block, Filter):
            new_block = _process_filter_block(query_metadata_table, block)
        else:
            new_block = block
        new_ir_blocks.append(new_block)

    return new_ir_blocks