private static @Nullable PyType resolveOverloadsCallType(@NotNull List<PyCallableType> overloads,
                                                           @NotNull PyCallSiteExpression callSite,
                                                           @NotNull TypeEvalContext context) {
    List<PyExpression> arguments = callSite.getArguments(overloads.get(0).getCallable());
    List<PyCallableType> matchingOverloads = ContainerUtil.filter(
      overloads,
      overload -> matchesByArgumentTypes((PyFunction)overload.getCallable(), callSite, context)
    );
    if (matchingOverloads.isEmpty()) {
      return StreamEx.of(overloads)
        .map(overload -> overload.getCallType(context, callSite))
        .collect(PyTypeUtil.toUnion());
    }
    if (matchingOverloads.size() == 1) {
      return matchingOverloads.get(0).getCallType(context, callSite);
    }
    boolean someArgumentsHaveUnknownType = ContainerUtil.exists(arguments, arg -> context.getType(arg) == null);
    if (someArgumentsHaveUnknownType) {
      return StreamEx.of(matchingOverloads)
        .map(overload -> overload.getCallType(context, callSite))
        .collect(PyTypeUtil.toUnion());
    }
    return StreamEx.of(matchingOverloads)
      .findFirst()
      .map(callableType -> callableType.getCallType(context, callSite))
      .orElse(null);
  }
private static @Nullable PyType resolveOverloadsCallType(@NotNull List<PyCallableType> overloads,
                                                           @NotNull PyCallSiteExpression callSite,
                                                           @NotNull TypeEvalContext context)