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