<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lower_unsupported_metafield_expressions(ir_blocks):
 """Raise exception if an unsupported metafield is encountered in any LocalField expression."""

    def visitor_fn(expression):
        """Visitor function raising exception for any unsupported metafield."""
        if not isinstance(expression, expressions.LocalField):
            return expression
        if expression.field_name not in constants.UNSUPPORTED_META_FIELDS:
            return expression
        raise NotImplementedError(
            u'Encountered unsupported metafield {} in LocalField {} during construction of '
            u'SQL query tree for IR blocks {}.'.format(
                constants.UNSUPPORTED_META_FIELDS[expression.field_name], expression, ir_blocks))

    new_ir_blocks = [
        block.visit_and_update_expressions(visitor_fn)
        for block in ir_blocks
    ]
    return new_ir_blocks