private static boolean allowedUnpacking(@NotNull PyStarExpression starExpression) {
    if (!starExpression.isUnpacking()) {
      return false;
    }

    // Additional contexts where unpacking is prohibited depending on the language version are covered in CompatibilityVisitor.
    final PsiElement parent = PsiTreeUtil.skipParentsOfType(starExpression, PyParenthesizedExpression.class);
    if (parent instanceof PyTupleExpression) {
      final PsiElement tupleParent = parent.getParent();
      if (tupleParent instanceof PyYieldExpression && ((PyYieldExpression)tupleParent).isDelegating()) {
        return false;
      }
    }
    return true;
  }
private static boolean allowedUnpacking(@NotNull PyStarExpression starExpression)