@Nullable
  public static PyType getReturnTypeOfMember(@NotNull PyType type,
                                             @NotNull String memberName,
                                             @Nullable PyExpression location,
                                             @NotNull TypeEvalContext context) {
    final PyResolveContext resolveContext = PyResolveContext.defaultContext(context);
    final List<? extends RatedResolveResult> resolveResults = type.resolveMember(memberName, location, AccessDirection.READ,
                                                                                 resolveContext);

    if (resolveResults != null) {
      final List<PyType> types = new ArrayList<>();

      for (RatedResolveResult resolveResult : resolveResults) {
        final PyType returnType = getReturnType(resolveResult.getElement(), context);

        if (returnType != null) {
          types.add(returnType);
        }
      }

      return PyUnionType.union(types);
    }

    return null;
  }
@Nullable
  public static PyType getReturnTypeOfMember(@NotNull PyType type,
                                             @NotNull String memberName,
                                             @Nullable PyExpression location,
                                             @NotNull TypeEvalContext context)