ThreeState (@Nullable PyCallable resolved, @NotNull PyExpression qualifier, @NotNull TypeEvalContext context) { if (isQualifiedByClass(resolved, qualifier, context)) { return ThreeState.NO; } final PyType qualifierType = context.getType(qualifier); // TODO: handle UnionType if (qualifierType instanceof PyModuleType) { return ThreeState.UNSURE; } return ThreeState.YES; // NOTE. best guess: unknown qualifier is more probably an instance. }