QualifiedResolveResult (@NotNull PyResolveContext resolveContext) { final List<QualifiedRatedResolveResult> resolveResults = multiFollowAssignmentsChain(resolveContext); return resolveResults .stream() .filter(result -> !result.isImplicit()) .findFirst() .map(QualifiedResolveResult.class::cast) .orElseGet( () -> { final QualifiedResolveResult first = ContainerUtil.getFirstItem(resolveResults); return first == null ? QualifiedResolveResult.EMPTY : first; } ); }