@Nullable
  public static PyType getTargetTypeFromTupleAssignment(@NotNull PyExpression target,
                                                        @NotNull PySequenceExpression parentTupleOrList,
                                                        @NotNull PyTupleType assignedTupleType) {
    final int count = assignedTupleType.getElementCount();
    final PyExpression[] elements = parentTupleOrList.getElements();
    if (elements.length == count || assignedTupleType.isHomogeneous()) {
      final int index = ArrayUtil.indexOf(elements, target);
      if (index >= 0) {
        return assignedTupleType.getElementType(index);
      }
      for (int i = 0; i < count; i++) {
        PyExpression element = PyPsiUtils.flattenParens(elements[i]);
        if (element instanceof PyTupleExpression || element instanceof PyListLiteralExpression) {
          final PyType elementType = assignedTupleType.getElementType(i);
          if (elementType instanceof PyTupleType nestedAssignedTupleType) {
            final PyType result = getTargetTypeFromTupleAssignment(target, (PySequenceExpression)element, nestedAssignedTupleType);
            if (result != null) {
              return result;
            }
          }
        }
      }
    }
    return null;
  }
@Nullable
  public static PyType getTargetTypeFromTupleAssignment(@NotNull PyExpression target,
                                                        @NotNull PySequenceExpression parentTupleOrList,
                                                        @NotNull PyTupleType assignedTupleType)