code: def to_dict(self):
          
          return dict(
              variants=self.variants,
              distinct=self.distinct,
              sort_key=self.sort_key,
              sources=self.sources,
              source_to_metadata_dict=self.source_to_metadata_dict)
docs: Since Collection.to_dict() returns a state dictionary with an
          'elements' field we have to rename it to 'variants'.