boolean (@NotNull PsiElement element, @NotNull TypeEvalContext context) { PsiElement parent = element.getParent(); if (parent instanceof PyTupleExpression) parent = parent.getParent(); PySubscriptionExpression subscription = ObjectUtils.tryCast(parent, PySubscriptionExpression.class); if (subscription == null) return false; PyReferenceExpression operand = ObjectUtils.tryCast(subscription.getOperand(), PyReferenceExpression.class); if (operand == null) return false; Collection<String> resolvedNames = resolveToQualifiedNames(operand, context); return ContainerUtil.exists(resolvedNames, name -> LITERAL.equals(name) || LITERAL_EXT.equals(name)); }