@decorators.raise_if_nothing_inferred<EOL>@decorators.path_wrapper<EOL>def infer_import_from(self, context=None, asname=True):
name = context.lookupname<EOL>if name is None:<EOL><INDENT>raise exceptions.InferenceError(node=self, context=context)<EOL><DEDENT>if asname:<EOL><INDENT>name = self.real_name(name)<EOL><DEDENT>try:<EOL><INDENT>module = self.do_import_module()<EOL><DEDENT>except exceptions.AstroidBuildingError as exc:<EOL><INDENT>raise exceptions.InferenceError(node=self, context=context) from exc<EOL><DEDENT>try:<EOL><INDENT>context = contextmod.copy_context(context)<EOL>context.lookupname = name<EOL>stmts = module.getattr(name, ignore_locals=module is self.root())<EOL>return bases._infer_stmts(stmts, context)<EOL><DEDENT>except exceptions.AttributeInferenceError as error:<EOL><INDENT>raise exceptions.InferenceError(<EOL>error.message, target=self, attribute=name, context=context<EOL>) from error<EOL><DEDENT>
infer a ImportFrom node: return the imported module/object