void (@NotNull PyTargetExpression target) { final TypeEvalContext context = TypeEvalContext.userInitiated(target.getProject(), target.getContainingFile()); final AnnotationInfo info = generateNestedTypeHint(target, context); if (isInstanceAttribute(target, context)) { final List<PyTargetExpression> classLevelAttrs = findClassLevelDefinitions(target, context); if (classLevelAttrs.isEmpty()) { PyTypeHintGenerationUtil.insertStandaloneAttributeTypeComment(target, context, info, true); } else { // Use existing class level definition (say, assignment of the default value) for annotation PyTypeHintGenerationUtil.insertVariableTypeComment(classLevelAttrs.get(0), context, info, true); } } else { PyTypeHintGenerationUtil.insertVariableTypeComment(target, context, info, true); } }