@staticmethod
def If(ctx, node, output_str):
    if_pattern = CodeTemplate('if ($condition):\n    $block_0_body\n    $if_out = $ret_0\nelse:\n    $block_1_body\n    $if_out = $ret_1\n    ')
    if_out_str = output_str
    condition_str = ctx.infer_attr_value(node.node_config('condition'))
    assert (len(node.blocks) == 2)
    blocks = ([''] * 2)
    block_ret = ([''] * 2)
    for (i, block) in enumerate(node.blocks):
        for inner_node in block.nodes:
            (forward_str, output_str) = ctx._get_forward_str(inner_node)
            blocks[i] += (forward_str + '\n')
        block_ret[i] = ','.join([ctx.infer_attr_value(ret_val) for ret_val in block.return_struct])
    (block_0_body, block_1_body) = blocks
    (ret_0_str, ret_1_str) = block_ret
    return if_pattern.substitute(condition=condition_str, block_0_body=block_0_body, block_1_body=block_1_body, if_out=if_out_str, ret_0=ret_0_str, ret_1=ret_1_str)
@staticmethod
def If(ctx, node, output_str):
    if_pattern = CodeTemplate('if ($condition):\n    $block_0_body\n    $if_out = $ret_0\nelse:\n    $block_1_body\n    $if_out = $ret_1\n    ')
    if_out_str = output_str
    condition_str = ctx.infer_attr_value(node.node_config('condition'))
    assert (len(node.blocks) == 2)
    blocks = ([] * 2)
    block_ret = ([] * 2)
    for (i, block) in enumerate(node.blocks):
        for inner_node in block.nodes:
            (forward_str, output_str) = ctx._get_forward_str(inner_node)
            blocks[i] += (forward_str + '\n')
        block_ret[i] = ','.join([ctx.infer_attr_value(ret_val) for ret_val in block.return_struct])
    (block_0_body, block_1_body) = blocks
    (ret_0_str, ret_1_str) = block_ret
    return if_pattern.substitute(condition=condition_str, block_0_body=block_0_body, block_1_body=block_1_body, if_out=if_out_str, ret_0=ret_0_str, ret_1=ret_1_str)