@Nullable
  @Override
  public List<? extends RatedResolveResult> resolveMember(@NotNull String name,
                                                          @Nullable PyExpression location,
                                                          @NotNull AccessDirection direction,
                                                          @NotNull PyResolveContext resolveContext) {

    final List<PsiElement> importedModuleCandidates = ResolveResultList.getElements(myImportedModule.multiResolve());
    final SmartList<RatedResolveResult> primaryResults = new SmartList<>();
    for (PsiElement moduleLocation : importedModuleCandidates) {
      final PsiFileSystemItem resolvedModuleOrPackage = PyUtil.as(moduleLocation, PsiFileSystemItem.class);
      if (resolvedModuleOrPackage != null) {
        final List<? extends RatedResolveResult> results =
          PyModuleType.resolveMemberInPackageOrModule(myImportedModule, resolvedModuleOrPackage, name, location, resolveContext);

        if (results != null) {
          primaryResults.addAll(results);
        }
      }
    }

    if (!primaryResults.isEmpty()) {
      return PyUtil.filterTopPriorityResults(primaryResults);
    }

    for (PsiElement moduleLocation : importedModuleCandidates) {
      final PsiFileSystemItem resolvedModuleOrPackage = PyUtil.as(moduleLocation, PsiFileSystemItem.class);
      if (resolvedModuleOrPackage == null) {
        continue;
      }
      //if it's a  synthetic import element
      if (myImportedModule.getImportElement() == null) {
        final PsiFile resolvingFromFile = location != null ? location.getContainingFile() : null;
        final List<RatedResolveResult> fallbackResults =
          ResolveImportUtil.resolveChildren(resolvedModuleOrPackage, name, resolvingFromFile, false, true,
                                            false, false);

        return ResolveResultList.asImportedResults(fallbackResults, null);
      }
    }
    return null;
  }
@Nullable
  @Override
  public List<? extends RatedResolveResult> resolveMember(@NotNull String name,
                                                          @Nullable PyExpression location,
                                                          @NotNull AccessDirection direction,
                                                          @NotNull PyResolveContext resolveContext)