static @Nullable PyType getCalleeType(@NotNull PyCallExpression call,
                                        @NotNull PyResolveContext resolveContext) {
    final List<PyType> callableTypes = new ArrayList<>();
    final TypeEvalContext context = resolveContext.getTypeEvalContext();

    final List<QualifiedRatedResolveResult> results =
      PyUtil.filterTopPriorityResults(
        forEveryScopeTakeOverloadsOtherwiseImplementations(
          multiResolveCallee(call.getCallee(), resolveContext),
          RatedResolveResult::getElement,
          context
        )
      );

    for (QualifiedRatedResolveResult resolveResult : results) {
      final PsiElement element = resolveResult.getElement();
      if (element != null) {
        final PyType typeFromProviders =
          Ref.deref(PyReferenceExpressionImpl.getReferenceTypeFromProviders(element, resolveContext.getTypeEvalContext(), call));

        if (PyTypeUtil.toStream(typeFromProviders).allMatch(it -> it instanceof PyCallableType)) {
          PyTypeUtil.toStream(typeFromProviders).forEachOrdered(callableTypes::add);
          continue;
        }
      }

      for (ClarifiedResolveResult clarifiedResolveResult : clarifyResolveResult(resolveResult, resolveContext)) {
        ContainerUtil.addIfNotNull(callableTypes, toCallableType(call, clarifiedResolveResult, context));
      }
    }

    return PyUnionType.union(callableTypes);
  }
static @Nullable PyType getCalleeType(@NotNull PyCallExpression call,
                                        @NotNull PyResolveContext resolveContext)