PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly, @NotNull LocalInspectionToolSession session) { if (!(holder.getFile() instanceof PyFile) && !(holder.getFile() instanceof RequirementsFile) && !isPythonInTemplateLanguages(holder.getFile())) { return PsiElementVisitor.EMPTY_VISITOR; } return new Visitor(holder, ignoredPackages, PyInspectionVisitor.getContext(session)); }