private static @Nullable PyTupleType widenUnionOfTuplesToTupleOfUnions(@NotNull PyUnionType unionType, int elementCount) {
    boolean consistsOfSameSizeTuples = ContainerUtil.all(unionType.getMembers(), member -> member instanceof PyTupleType tupleType &&
                                                                                           !tupleType.isHomogeneous() &&
                                                                                           elementCount == tupleType.getElementCount());
    if (!consistsOfSameSizeTuples) {
      return null;
    }
    List<PyType> newTupleElements = IntStreamEx.range(elementCount)
      .mapToObj(index -> PyTypeUtil.toStream(unionType)
        .select(PyTupleType.class)
        .map(tupleType -> tupleType.getElementType(index))
        .collect(PyTypeUtil.toUnion()))
      .toList();
    PyClass tupleClass = ((PyTupleType)ContainerUtil.getFirstItem(unionType.getMembers())).getPyClass();
    return new PyTupleType(tupleClass, newTupleElements, false);
  }
private static @Nullable PyTupleType widenUnionOfTuplesToTupleOfUnions(@NotNull PyUnionType unionType, int elementCount)