@Override
  public Object @NotNull [] getVariants() {
    PyExpression qualifier = myElement.getQualifier();
    if (qualifier != null) {
      qualifier = CompletionUtilCoreImpl.getOriginalOrSelf(qualifier);
    }
    if (qualifier == null) {
      return EMPTY_ARRAY;
    }
    final PyQualifiedExpression element = CompletionUtilCoreImpl.getOriginalOrSelf(myElement);

    PyType qualifierType = TypeEvalContext.codeCompletion(element.getProject(), element.getContainingFile()).getType(qualifier);
    ProcessingContext ctx = new ProcessingContext();
    final Set<String> namesAlready = new HashSet<>();
    ctx.put(PyType.CTX_NAMES, namesAlready);
    final Collection<Object> variants = new ArrayList<>();
    if (qualifierType != null) {
      if (qualifierType instanceof PyStructuralType && ((PyStructuralType)qualifierType).isInferredFromUsages()) {
        final PyClassType guessedType = guessClassTypeByName();
        if (guessedType != null) {
          Collections.addAll(variants, guessedType.getCompletionVariants(myElement.getName(), myElement, ctx));
        }
      }
      if (qualifier instanceof PyQualifiedExpression qualifierExpression) {
        final QualifiedName qualifiedName = qualifierExpression.asQualifiedName();
        if (qualifiedName != null) {
          final Collection<PyTargetExpression> attrs = collectAssignedAttributes(qualifiedName, qualifier);
          for (PyTargetExpression expression : attrs) {
            final String name = expression.getName();
            if (name != null && name.endsWith(CompletionInitializationContext.DUMMY_IDENTIFIER.trim())) {
              continue;
            }
            if (qualifierType instanceof PyClassType && name != null) {
              variants.add(LookupElementBuilder.createWithSmartPointer(name, expression)
                             .withTypeText(qualifierType.getName())
                             .withIcon(IconManager.getInstance().getPlatformIcon(com.intellij.ui.PlatformIcons.Field)));
              namesAlready.add(name);
            }
          }
        }
        Collections.addAll(variants, qualifierType.getCompletionVariants(element.getName(), element, ctx));
      }
      else {
        return qualifierType.getCompletionVariants(element.getName(), element, ctx);
      }
    }
    else {
      final PyClassType guessedType = guessClassTypeByName();
      if (guessedType != null) {
        Collections.addAll(variants, guessedType.getCompletionVariants(myElement.getName(), myElement, ctx));
      }
      if (qualifier instanceof PyReferenceExpression) {
        Collections.addAll(variants, collectSeenMembers(qualifier.getText(), ctx));
      }
    }

    StreamEx.of(PyHasAttrHelper.INSTANCE.getNamesFromHasAttrs(element, qualifier))
      .filter(it -> namesAlready.add(it))
      .into(variants);

    return variants.toArray();
  }
@Override
  public Object @NotNull [] getVariants()