def add_from_names_to_locals(self, node):
_key_func = lambda node: node.fromlineno<EOL>def sort_locals(my_list):<EOL><INDENT>my_list.sort(key=_key_func)<EOL><DEDENT>for (name, asname) in node.names:<EOL><INDENT>if name == "<STR_LIT:*>":<EOL><INDENT>try:<EOL><INDENT>imported = node.do_import_module()<EOL><DEDENT>except exceptions.AstroidBuildingError:<EOL><INDENT>continue<EOL><DEDENT>for name in imported.public_names():<EOL><INDENT>node.parent.set_local(name, node)<EOL>sort_locals(node.parent.scope().locals[name])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>node.parent.set_local(asname or name, node)<EOL>sort_locals(node.parent.scope().locals[asname or name])<EOL><DEDENT><DEDENT>
Store imported names to the locals

        Resort the locals if coming from a delayed node