When importing a module twice and using the module inside a function, the linting says that the first import statement is unused, which is quite confusing. Instead of telling me that the first one is unused, it would be better if it told me that the second one is redefining a previous import.
Thank you for the report!
We inherit this behaviour from PyCharm, and I found a known related bug-report in their tracker:
PY-32329 false positive ‘unused import statement’
But since the behaviour could be different for *.ipynb and *.py files, I reported a separate ticket for Jupyter:
PY-47504 False positive “unused import statement” in ipynb file
Feel free to upvote and follow this tickets.