'Overwrites the current Statistics returned by `get_stats`.
Implementers of Pipeline should call `_set_stats` from within `transform`.
Args:
stats: An iterable of Statistic objects.
Raises:
InvalidStatisticsException: If `stats` is not iterable, or if any
object in the list is not a `Statistic` instance.'

def _set_stats(self, stats):

    if (not hasattr(stats, '__iter__')):
        raise InvalidStatisticsException(('Expecting    iterable,    got    type    %s' % type(stats)))
    self._stats = [self._prepend_name(stat) for stat in stats]
