def _filter_sources(self, sources):
filtered, hosts = [], []<EOL>for source in sources:<EOL><INDENT>if '<STR_LIT:error>' in source:<EOL><INDENT>continue<EOL><DEDENT>filtered.append(source)<EOL>hosts.append(source['<STR_LIT>'])<EOL><DEDENT>return sorted(filtered, key=lambda s:<EOL>self._hosts_by_success(hosts).index(s['<STR_LIT>']))<EOL>
Remove sources with errors and return ordered by host success.

        :param sources: List of potential sources to connect to.
        :type sources: list
        :returns: Sorted list of potential sources without errors.
        :rtype: list