PyPattern (@NotNull PyPattern pattern) { if (pattern instanceof PyGroupPattern) { return unwrapGroupAndAsPatterns(((PyGroupPattern)pattern).getPattern()); } if (pattern instanceof PyAsPattern) { return unwrapGroupAndAsPatterns(((PyAsPattern)pattern).getPattern()); } return pattern; }