code: def snapshot(self):
          
          return dict((category, dict((name, metric.value())
                                      for name, metric in list(metrics.items())))
                      for category, metrics in
                      list(self._store.items()))
docs: Return a nested dictionary snapshot of all metrics and their
          values at this time. Example:
          {
              'category': {
                  'metric1_name': 42.0,
                  'metric2_name': 'foo'
              }
          }