def infer_typing_namedtuple(node, context=None):
<EOL>try:<EOL><INDENT>func = next(node.func.infer())<EOL><DEDENT>except InferenceError:<EOL><INDENT>raise UseInferenceDefault<EOL><DEDENT>if func.qname() != "<STR_LIT>":<EOL><INDENT>raise UseInferenceDefault<EOL><DEDENT>if len(node.args) != <NUM_LIT:2>:<EOL><INDENT>raise UseInferenceDefault<EOL><DEDENT>if not isinstance(node.args[<NUM_LIT:1>], (nodes.List, nodes.Tuple)):<EOL><INDENT>raise UseInferenceDefault<EOL><DEDENT>names = []<EOL>for elt in node.args[<NUM_LIT:1>].elts:<EOL><INDENT>if not isinstance(elt, (nodes.List, nodes.Tuple)):<EOL><INDENT>raise UseInferenceDefault<EOL><DEDENT>if len(elt.elts) != <NUM_LIT:2>:<EOL><INDENT>raise UseInferenceDefault<EOL><DEDENT>names.append(elt.elts[<NUM_LIT:0>].as_string())<EOL><DEDENT>typename = node.args[<NUM_LIT:0>].as_string()<EOL>if names:<EOL><INDENT>field_names = "<STR_LIT>".format("<STR_LIT:U+002C>".join(names))<EOL><DEDENT>else:<EOL><INDENT>field_names = "<STR_LIT>"<EOL><DEDENT>node = extract_node(<EOL>"<STR_LIT>".format(typename=typename, fields=field_names)<EOL>)<EOL>return infer_named_tuple(node, context)<EOL>
Infer a typing.NamedTuple(...) call.