def infer_name(self, context=None):
frame, stmts = self.lookup(self.name)<EOL>if not stmts:<EOL><INDENT>parent_function = _higher_function_scope(self.scope())<EOL>if parent_function:<EOL><INDENT>_, stmts = parent_function.lookup(self.name)<EOL><DEDENT>if not stmts:<EOL><INDENT>raise exceptions.NameInferenceError(<EOL>name=self.name, scope=self.scope(), context=context<EOL>)<EOL><DEDENT><DEDENT>context = contextmod.copy_context(context)<EOL>context.lookupname = self.name<EOL>return bases._infer_stmts(stmts, context, frame)<EOL>
infer a Name: use name lookup rules