boolean (PsiElement statement, int offset) { if (!(statement instanceof PyFromImportStatement fromImportStatement)) { return false; } PsiElement leftParen = fromImportStatement.getLeftParen(); if (leftParen != null && offset >= leftParen.getTextRange().getEndOffset()) { return true; } return false; }