INNER CODE UNIT · Python

worker

atenreiro/opensquat · opensquat/app.py:205

    def worker(self):
        """
        Method that will compute all the similarity calculations between
        the keywords and domain names.
        """
        with concurrent.futures.ProcessPoolExecutor() as executor:
            keyword_infos = [
                (keyword, i + 1, self.keywords_total)
                for i, keyword in enumerate(self.list_file_keywords) if keyword
            ]

            worker_func = functools.partial(self.verify_keyword_task, self.squatting_detector, self.list_file_domains)

            futs = [executor.submit(worker_func, k_info) for k_info in keyword_infos]

        for fut in futs:
            result_buffer, keyword, result_domains = fut.result()
            print(result_buffer.getvalue())

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…