def _infer_stmts(stmts, context, frame=None):
inferred = False<EOL>if context is not None:<EOL><INDENT>name = context.lookupname<EOL>context = context.clone()<EOL><DEDENT>else:<EOL><INDENT>name = None<EOL>context = contextmod.InferenceContext()<EOL><DEDENT>for stmt in stmts:<EOL><INDENT>if stmt is util.Uninferable:<EOL><INDENT>yield stmt<EOL>inferred = True<EOL>continue<EOL><DEDENT>context.lookupname = stmt._infer_name(frame, name)<EOL>try:<EOL><INDENT>for inferred in stmt.infer(context=context):<EOL><INDENT>yield inferred<EOL>inferred = True<EOL><DEDENT><DEDENT>except exceptions.NameInferenceError:<EOL><INDENT>continue<EOL><DEDENT>except exceptions.InferenceError:<EOL><INDENT>yield util.Uninferable<EOL>inferred = True<EOL><DEDENT><DEDENT>if not inferred:<EOL><INDENT>raise exceptions.InferenceError(<EOL>"<STR_LIT>",<EOL>stmts=stmts,<EOL>frame=frame,<EOL>context=context,<EOL>)<EOL><DEDENT>
Return an iterator on statements inferred by each statement in *stmts*.