# Path: xpaw/stats.py
# class StatsCollector:
#     def __init__(self):
#         self._stats = {}
# 
#     def get(self, key, default=None):
#         return self._stats.get(key, default)
# 
#     def set(self, key, value):
#         self._stats[key] = value
# 
#     def set_default(self, key, default=None):
#         self._stats.setdefault(key, default)
# 
#     def set_min(self, key, value):
#         self._stats[key] = min(self._stats.setdefault(key, value), value)
# 
#     def set_max(self, key, value):
#         self._stats[key] = max(self._stats.setdefault(key, value), value)
# 
#     def inc(self, key, value=1, start=0):
#         self._stats[key] = self._stats.setdefault(key, start) + value
# 
#     def clear(self):
#         self._stats.clear()
# 
#     def remove(self, key):
#         if key in self._stats:
#             del self._stats[key]
# 
#     @property
#     def stats(self):
#         return self._stats
# 
#     def set_stats(self, stats):
#         self._stats = stats
# 
# class DummyStatsCollector(StatsCollector):
#     def get(self, key, default=None):
#         return default
# 
#     def set(self, key, value):
#         pass
# 
#     def set_default(self, key, default=None):
#         pass
# 
#     def set_min(self, key, value):
#         pass
# 
#     def set_max(self, key, value):
#         pass
# 
#     def inc(self, key, value=1, start=0):
#         pass
# 
#     def set_stats(self, stats):
#         pass


from xpaw.stats import StatsCollector, DummyStatsCollector
        stats.set('key3', 5)
        assert stats.get('key3') == 5
        stats.set_min('key3', 4)
        assert stats.get('key3') == 4
        stats.set_min('key3', 6)
        assert stats.get('key3') == 4
        stats.set_min('key4', 1)
        assert stats.get('key4') == 1
        stats.set_default('key5', 6)
        assert stats.get('key5') == 6
        stats.set_default('key5', 5)
        assert stats.get('key5') == 6

    def test_inc_value(self):
        stats = StatsCollector()
        stats.set('key1', 1)
        stats.inc('key1')
        assert stats.get('key1') == 2
        stats.inc('key1', 2)
        assert stats.get('key1') == 4
        stats.inc('key1', 5, start=0)
        assert stats.get('key1') == 9
        stats.inc('key2')
        assert stats.get('key2') == 1
        stats.inc('key3', start=1)
        assert stats.get('key3') == 2
        stats.inc('key4', 2, start=3)
        assert stats.get('key4') == 5

    def test_clear_stats(self):

# Path: xpaw/stats.py
# class StatsCollector:
#     def __init__(self):
#         self._stats = {}
# 
#     def get(self, key, default=None):
#         return self._stats.get(key, default)
# 
#     def set(self, key, value):
#         self._stats[key] = value
# 
#     def set_default(self, key, default=None):
#         self._stats.setdefault(key, default)
# 
#     def set_min(self, key, value):
#         self._stats[key] = min(self._stats.setdefault(key, value), value)
# 
#     def set_max(self, key, value):
#         self._stats[key] = max(self._stats.setdefault(key, value), value)
# 
#     def inc(self, key, value=1, start=0):
#         self._stats[key] = self._stats.setdefault(key, start) + value
# 
#     def clear(self):
#         self._stats.clear()
# 
#     def remove(self, key):
#         if key in self._stats:
#             del self._stats[key]
# 
#     @property
#     def stats(self):
#         return self._stats
# 
#     def set_stats(self, stats):
#         self._stats = stats
# 
# class DummyStatsCollector(StatsCollector):
#     def get(self, key, default=None):
#         return default
# 
#     def set(self, key, value):
#         pass
# 
#     def set_default(self, key, default=None):
#         pass
# 
#     def set_min(self, key, value):
#         pass
# 
#     def set_max(self, key, value):
#         pass
# 
#     def inc(self, key, value=1, start=0):
#         pass
# 
#     def set_stats(self, stats):
#         pass


# Path: tests/test_stats.py
from xpaw.stats import StatsCollector, DummyStatsCollector

        stats.set('key3', 5)
        assert stats.get('key3') == 5
        stats.set_min('key3', 4)
        assert stats.get('key3') == 4
        stats.set_min('key3', 6)
        assert stats.get('key3') == 4
        stats.set_min('key4', 1)
        assert stats.get('key4') == 1
        stats.set_default('key5', 6)
        assert stats.get('key5') == 6
        stats.set_default('key5', 5)
        assert stats.get('key5') == 6

    def test_inc_value(self):
        stats = StatsCollector()
        stats.set('key1', 1)
        stats.inc('key1')
        assert stats.get('key1') == 2
        stats.inc('key1', 2)
        assert stats.get('key1') == 4
        stats.inc('key1', 5, start=0)
        assert stats.get('key1') == 9
        stats.inc('key2')
        assert stats.get('key2') == 1
        stats.inc('key3', start=1)
        assert stats.get('key3') == 2
        stats.inc('key4', 2, start=3)
        assert stats.get('key4') == 5

    def test_clear_stats(self):

        stats = StatsCollector()