def infer_named_tuple(node, context=None):
 (class_node, name, attributes) = infer_func_form(node, nodes.Tuple._proxied, context=context)
 fake = AstroidBuilder(MANAGER).string_build(("\nclass %(name)s(tuple):\n    _fields = %(fields)r\n    def _asdict(self):\n        return self.__dict__\n    @classmethod\n    def _make(cls, iterable, new=tuple.__new__, len=len):\n        return new(cls, iterable)\n    def _replace(_self, **kwds):\n        result = _self._make(map(kwds.pop, %(fields)r, _self))\n        if kwds:\n            raise ValueError('Got unexpected field names: %%r' %% list(kwds))\n        return result\n    " % {'name': name, 'fields': attributes}))
 class_node.locals['_asdict'] = fake.body[0].locals['_asdict']
 class_node.locals['_make'] = fake.body[0].locals['_make']
 class_node.locals['_replace'] = fake.body[0].locals['_replace']
 class_node.locals['_fields'] = fake.body[0].locals['_fields']
 return iter([class_node])

def infer_named_tuple ( node , context = None ) : ( class_node , name , attributes ) = infer_func_form ( node , nodes . Tuple . _proxied , context = context ) fake = AstroidBuilder ( MANAGER ) . string_build ( ( "\nclass %(name)s(tuple):\n    _fields = %(fields)r\n    def _asdict(self):\n        return self.__dict__\n    @classmethod\n    def _make(cls, iterable, new=tuple.__new__, len=len):\n        return new(cls, iterable)\n    def _replace(_self, **kwds):\n        result = _self._make(map(kwds.pop, %(fields)r, _self))\n        if kwds:\n            raise ValueError('Got unexpected field names: %%r' %% list(kwds))\n        return result\n    " % { 'name' : name , 'fields' : attributes } ) ) class_node . locals [ '_asdict' ] = fake . body [ 0 ] . locals [ '_asdict' ] class_node . locals [ '_make' ] = fake . body [ 0 ] . locals [ '_make' ] class_node . locals [ '_replace' ] = fake . body [ 0 ] . locals [ '_replace' ] class_node . locals [ '_fields' ] = fake . body [ 0 ] . locals [ '_fields' ] return iter ( [ class_node ] )
specific inference function for namedtuple callfunc node .