code: def enum_subpattern(p):
      subpattern_id, d = p
      patterns = list(enum_gen(d))
  
      '''
      if subpattern_id:
          subpat_iter = EnumSubpatternIterator(subpattern_id, patterns)
          SUBPATTERNS[subpattern_id] = subpat_iter
          return subpat_iter
      else:
          return patterns
          '''
      return patternf enum_subpattern(p):
      subpattern_id, d = p
      patterns = list(enum_gen(d))
  
      '''
      if subpattern_id:
          subpat_iter = EnumSubpatternIterator(subpattern_id, patterns)
          SUBPATTERNS[subpattern_id] = subpat_iter
          return subpat_iter
      else:
          return patterns
          '''
      return patterns
docs: if subpattern_id:
          subpat_iter = EnumSubpatternIterator(subpattern_id, patterns)
          SUBPATTERNS[subpattern_id] = subpat_iter
          return subpat_iter
      else:
          return patterns