code: def InterpolateGrouping(self, pattern):
      
      components = []
      offset = 0
      for match in GROUPING_PATTERN.finditer(pattern):
        components.append([pattern[offset:match.start()]])
  
        # Expand the attribute into the set of possibilities:
        alternatives = match.group(1).split(",")
        components.append(set(alternatives))
        offset = match.end()
  
      components.append([pattern[offset:]])
      # Now calculate the cartesian products of all these sets to form all
      # strings.
      for vector in itertools.product(*components):
        yield u"".join(vector)
docs: Interpolate inline globbing groups.