def _get_sorted_names(self):
depend_dict = {}<EOL>for name, info_module in self.info_modules.items():<EOL><INDENT>depend_dict[name] = getattr(info_module, '<STR_LIT>', [])<EOL><DEDENT>package_names = []<EOL>for name in list(depend_dict.keys()):<EOL><INDENT>if not depend_dict[name]:<EOL><INDENT>package_names.append(name)<EOL>del depend_dict[name]<EOL><DEDENT><DEDENT>while depend_dict:<EOL><INDENT>for name, lst in list(depend_dict.items()):<EOL><INDENT>new_lst = [n for n in lst if n in depend_dict]<EOL>if not new_lst:<EOL><INDENT>package_names.append(name)<EOL>del depend_dict[name]<EOL><DEDENT>else:<EOL><INDENT>depend_dict[name] = new_lst<EOL><DEDENT><DEDENT><DEDENT>return package_names<EOL>
Return package names sorted in the order as they should be
        imported due to dependence relations between packages.