@Nullable
  default FindUsagesHandlerBase createFindUsagesHandler(@NotNull PsiElement element, boolean forHighlightUsages) {
    if (element instanceof PyImportedModule) {
      final PsiElement resolved = ((PyImportedModule)element).resolve();
      if (resolved != null) {
        element = resolved;
      }
    }
    if (element instanceof PsiFileSystemItem) {
      return createModuleFindUsagesHandler((PsiFileSystemItem)element);
    }
    if (element instanceof PyFunction) {
      if (!forHighlightUsages) {
        TypeEvalContext context = TypeEvalContext.userInitiated(element.getProject(), null);
        final Collection<PsiElement> superMethods = PySuperMethodsSearch.search((PyFunction)element, true, context).findAll();
        if (superMethods.size() > 0) {
          final PsiElement next = superMethods.iterator().next();
          // TODO should do this for Jython functions overriding Java methods too
          if (next instanceof PyFunction && !isInObject((PyFunction)next)) {
            if (PythonUiService.getInstance().showYesDialog(element.getProject(), PyPsiBundle
                                                              .message("python.find.usages.base.method.question",
                                                                       ((PyFunction)element).getName(), ((PyFunction)next).getContainingClass().getName()),
                                                            PyPsiBundle.message("python.find.usages"))) {
              List<PsiElement> allMethods = new ArrayList<>();
              allMethods.add(element);
              allMethods.addAll(superMethods);
              return new PyFunctionFindUsagesHandler(element, allMethods);
            }
            else {
              return new PyFunctionFindUsagesHandler(element);
            }
          }
        }
      }
      return new PyFunctionFindUsagesHandler(element);
    }
    if (element instanceof PyClass) {
      return new PyClassFindUsagesHandler((PyClass)element);
    }
    if (element instanceof PyTargetExpression) {
      return new PyTargetExpressionFindUsagesHandler(((PyTargetExpression)element));
    }
    return null;
  }
@Nullable
  default FindUsagesHandlerBase createFindUsagesHandler(@NotNull PsiElement element, boolean forHighlightUsages)