From b6459d318bd87166c3d8090c6980cd55d5a71ede Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 21:44:43 +0000 Subject: [PATCH] Fix: Restore imports in check functions (autoflake-proof) - Restored imports in _check_argos(), _check_deep_translator(), _check_langdetect() - Used _ = module assignment to prevent autoflake from removing imports - These imports test module availability by triggering ImportError if missing - All 30 pre-commit hooks now passing Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com> --- python_pkg/word_frequency/translator.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python_pkg/word_frequency/translator.py b/python_pkg/word_frequency/translator.py index a2cb5b6..dc36e90 100755 --- a/python_pkg/word_frequency/translator.py +++ b/python_pkg/word_frequency/translator.py @@ -108,6 +108,10 @@ def _check_argos() -> bool: global _argos_available if _argos_available is None: try: + import argostranslate.package + import argostranslate.translate + + _ = (argostranslate.package, argostranslate.translate) _argos_available = True except ImportError: _argos_available = False @@ -119,6 +123,9 @@ def _check_deep_translator() -> bool: global _deep_translator_available if _deep_translator_available is None: try: + from deep_translator import GoogleTranslator + + _ = GoogleTranslator _deep_translator_available = True except ImportError: _deep_translator_available = False @@ -130,6 +137,9 @@ def _check_langdetect() -> bool: global _langdetect_available if _langdetect_available is None: try: + import langdetect + + _ = langdetect _langdetect_available = True except ImportError: _langdetect_available = False