code: def add_subgroups(self, subgroups):
          
          if subgroups is None:
              subgroups = {}
          _subgroups = {}
          for sg in subgroups:
              assert isinstance(sg, SubGroupDefinition)
              _subgroups[sg.name] = sg
          self.subgroups = _subgroups
docs: Add a list of SubGroupDefinition objects to this composite.
  
          Note that in contrast to :meth:`BaseTrack`, which takes a single
          dictionary indicating the particular subgroups for the track, this
          method takes a list of :class:`SubGroupDefinition` objects representing
          the allowed subgroups for the composite.
  
          :param subgroups:
              List of SubGroupDefinition objects.