def _fold_metrics(self, metrics):
        # Store the metrics as a dictionary by queue type
        metrics_by_type = {}
        for metric in metrics:
            key = type(metric)
            metrics_by_type.setdefault(key, [])
            metrics_by_type[key].append(metric)

        # Fold over the metrics
        data = []
        now = time.time()
        for cls,metrics in metrics_by_type.iteritems():
            data.extend(cls.fold(metrics, now, **self.metrics_settings.get(cls, {})))

        return data
Handles the communication with the API when creating a new
dataset/ETHPy150Open kiip/statsite/statsite/aggregator.py/Aggregator._fold_metrics--crossover with--dataset/ETHPy150Open rackspace/pyrax/pyrax/clouddns.py/CloudDNSManager._create