@Nullable
    public static PyType getActualReturnType(@NotNull PyFunction function, @Nullable PyExpression returnExpr,
                                             @NotNull TypeEvalContext context) {
      PyType returnTypeExpected = getExpectedReturnType(function, context);
      return returnExpr != null ? tryPromotingType(returnExpr, returnTypeExpected, context) : PyNoneType.INSTANCE;
    }
@Nullable
    public static PyType getActualReturnType(@NotNull PyFunction function, @Nullable PyExpression returnExpr,
                                             @NotNull TypeEvalContext context)