def infer_named_tuple(node, context=None):
tuple_base_name = nodes.Name(name="<STR_LIT>", parent=node.root())<EOL>class_node, name, attributes = infer_func_form(<EOL>node, tuple_base_name, context=context<EOL>)<EOL>call_site = arguments.CallSite.from_call(node)<EOL>func = next(extract_node("<STR_LIT>").infer())<EOL>try:<EOL><INDENT>rename = next(call_site.infer_argument(func, "<STR_LIT>", context)).bool_value()<EOL><DEDENT>except InferenceError:<EOL><INDENT>rename = False<EOL><DEDENT>if rename:<EOL><INDENT>attributes = _get_renamed_namedtuple_attributes(attributes)<EOL><DEDENT>replace_args = "<STR_LIT:U+002CU+0020>".join("<STR_LIT>".format(arg=arg) for arg in attributes)<EOL>field_def = (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>field_defs = "<STR_LIT:\n>".join(<EOL>field_def.format(name=name, index=index)<EOL>for index, name in enumerate(attributes)<EOL>)<EOL>fake = AstroidBuilder(MANAGER).string_build(<EOL>"""<STR_LIT>"""<EOL>% {<EOL>"<STR_LIT:name>": name,<EOL>"<STR_LIT>": attributes,<EOL>"<STR_LIT>": field_defs,<EOL>"<STR_LIT>": replace_args,<EOL>}<EOL>)<EOL>class_node.locals["<STR_LIT>"] = fake.body[<NUM_LIT:0>].locals["<STR_LIT>"]<EOL>class_node.locals["<STR_LIT>"] = fake.body[<NUM_LIT:0>].locals["<STR_LIT>"]<EOL>class_node.locals["<STR_LIT>"] = fake.body[<NUM_LIT:0>].locals["<STR_LIT>"]<EOL>class_node.locals["<STR_LIT>"] = fake.body[<NUM_LIT:0>].locals["<STR_LIT>"]<EOL>for attr in attributes:<EOL><INDENT>class_node.locals[attr] = fake.body[<NUM_LIT:0>].locals[attr]<EOL><DEDENT>return iter([class_node])<EOL>
Specific inference function for namedtuple Call node