'Replace dict( (a,b) for ... ) by an inlined { a:b for ... }'

def _handle_simple_function_dict(self, node, pos_args):

    if (len(pos_args) == 0):
        return ExprNodes.DictNode(node.pos, key_value_pairs=[], constant_result={})
    if (len(pos_args) > 1):
        return node
    if (not isinstance(pos_args[0], ExprNodes.GeneratorExpressionNode)):
        return node
    gen_expr_node = pos_args[0]
    loop_node = gen_expr_node.loop
    yield_statements = _find_yield_statements(loop_node)
    if (not yield_statements):
        return node
    for (yield_expression, _) in yield_statements:
        if (not isinstance(yield_expression, ExprNodes.TupleNode)):
            return node
        if (len(yield_expression.args) != 2):
            return node
    result_node = ExprNodes.InlinedGeneratorExpressionNode(node.pos, gen_expr_node, orig_func='dict', comprehension_type=Builtin.dict_type)
    for (yield_expression, yield_stat_node) in yield_statements:
        append_node = ExprNodes.DictComprehensionAppendNode(yield_expression.pos, key_expr=yield_expression.args[0], value_expr=yield_expression.args[1], target=result_node.target)
        Visitor.recursively_replace_node(gen_expr_node, yield_stat_node, append_node)
    return result_node
