private static boolean inCaseClauseParentheses(@NotNull PsiElement statement, int offset) {
    if (!(statement instanceof PyAstCaseClause caseClause)) {
      return false;
    }
    final PyAstPattern pattern = caseClause.getPattern();
    if (pattern == null) {
      return false;
    }

    final PsiElement leftParen = PyPsiUtilsCore.getChildByFilter(pattern, PyTokenTypes.OPEN_BRACES, 0);
    return leftParen != null && offset >= leftParen.getTextRange().getEndOffset();
  }
private static boolean inCaseClauseParentheses(@NotNull PsiElement statement, int offset)