code: def contains_one_of(self, elements):
          
          if sum(e in self._subject for e in elements) != 1:
              raise self._error_factory(_format("Expected {} to have exactly one of {}", self._subject, elements))
          return ChainInspector(self._subject)
docs: Ensures :attr:`subject` contains exactly one of *elements*, which must be an iterable.