def infer_argument(self, funcnode, name, context):
if name in self.duplicated_keywords:<EOL><INDENT>raise exceptions.InferenceError(<EOL>"<STR_LIT>" "<STR_LIT>",<EOL>call_site=self,<EOL>func=funcnode,<EOL>arg=name,<EOL>context=context,<EOL>)<EOL><DEDENT>try:<EOL><INDENT>return self.keyword_arguments[name].infer(context)<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>if len(self.positional_arguments) > len(funcnode.args.args):<EOL><INDENT>if not funcnode.args.vararg:<EOL><INDENT>raise exceptions.InferenceError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>call_site=self,<EOL>func=funcnode,<EOL>arg=name,<EOL>context=context,<EOL>)<EOL><DEDENT><DEDENT>positional = self.positional_arguments[: len(funcnode.args.args)]<EOL>vararg = self.positional_arguments[len(funcnode.args.args) :]<EOL>argindex = funcnode.args.find_argname(name)[<NUM_LIT:0>]<EOL>kwonlyargs = {arg.name for arg in funcnode.args.kwonlyargs}<EOL>kwargs = {<EOL>key: value<EOL>for key, value in self.keyword_arguments.items()<EOL>if key not in kwonlyargs<EOL>}<EOL>if len(positional) < len(funcnode.args.args):<EOL><INDENT>for func_arg in funcnode.args.args:<EOL><INDENT>if func_arg.name in kwargs:<EOL><INDENT>arg = kwargs.pop(func_arg.name)<EOL>positional.append(arg)<EOL><DEDENT><DEDENT><DEDENT>if argindex is not None:<EOL><INDENT>if argindex == <NUM_LIT:0> and funcnode.type in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>if context.boundnode is not None:<EOL><INDENT>boundnode = context.boundnode<EOL><DEDENT>else:<EOL><INDENT>boundnode = funcnode.parent.frame()<EOL><DEDENT>if isinstance(boundnode, nodes.ClassDef):<EOL><INDENT>method_scope = funcnode.parent.scope()<EOL>if method_scope is boundnode.metaclass():<EOL><INDENT>return iter((boundnode,))<EOL><DEDENT><DEDENT>if funcnode.type == "<STR_LIT>":<EOL><INDENT>if not isinstance(boundnode, bases.Instance):<EOL><INDENT>boundnode = bases.Instance(boundnode)<EOL><DEDENT>return iter((boundnode,))<EOL><DEDENT>if funcnode.type == "<STR_LIT>":<EOL><INDENT>return iter((boundnode,))<EOL><DEDENT><DEDENT>if funcnode.type in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>argindex -= <NUM_LIT:1><EOL><DEDENT>try:<EOL><INDENT>return self.positional_arguments[argindex].infer(context)<EOL><DEDENT>except IndexError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if funcnode.args.kwarg == name:<EOL><INDENT>if self.has_invalid_keywords():<EOL><INDENT>raise exceptions.InferenceError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>keyword_arguments=self.keyword_arguments,<EOL>unpacked_kwargs=self._unpacked_kwargs,<EOL>call_site=self,<EOL>func=funcnode,<EOL>arg=name,<EOL>context=context,<EOL>)<EOL><DEDENT>kwarg = nodes.Dict(<EOL>lineno=funcnode.args.lineno,<EOL>col_offset=funcnode.args.col_offset,<EOL>parent=funcnode.args,<EOL>)<EOL>kwarg.postinit(<EOL>[(nodes.const_factory(key), value) for key, value in kwargs.items()]<EOL>)<EOL>return iter((kwarg,))<EOL><DEDENT>if funcnode.args.vararg == name:<EOL><INDENT>if self.has_invalid_arguments():<EOL><INDENT>raise exceptions.InferenceError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>positional_arguments=self.positional_arguments,<EOL>unpacked_args=self._unpacked_args,<EOL>call_site=self,<EOL>func=funcnode,<EOL>arg=name,<EOL>context=context,<EOL>)<EOL><DEDENT>args = nodes.Tuple(<EOL>lineno=funcnode.args.lineno,<EOL>col_offset=funcnode.args.col_offset,<EOL>parent=funcnode.args,<EOL>)<EOL>args.postinit(vararg)<EOL>return iter((args,))<EOL><DEDENT>try:<EOL><INDENT>return funcnode.args.default_value(name).infer(context)<EOL><DEDENT>except exceptions.NoDefault:<EOL><INDENT>pass<EOL><DEDENT>raise exceptions.InferenceError(<EOL>"<STR_LIT>" "<STR_LIT>",<EOL>call_site=self,<EOL>func=funcnode,<EOL>arg=name,<EOL>context=context,<EOL>)<EOL>
infer a function argument value according to the call context

        Arguments:
            funcnode: The function being called.
            name: The name of the argument whose value is being inferred.
            context: Inference context object