Relax type import detection for names that do not come from the ``typing`` module

Close #3191
3 files changed