'Flatten a set of results by creating a separate object for each
sample in the results.'

@staticmethod
def _flatten(results):

    flattened = []
    common_props = dict([(k, results.get(k)) for k in results.iterkeys() if (k != 'samples')])
    metric_type = results['metric']['type']
    for sample in results['samples']:
        if sample['success']:
            flattened.extend(METRIC_HANDLER[metric_type](common_props, sample))
    return flattened
