def METHOD_NAME(qos):
    data = {}
    for curve, attrs in qos.items():
        data[curve] = []
        if 'm1' in attrs:
            data[curve] += [
                'm1',
                '%sbit' % attrs.get('m1', 0),
                'd',
                '%sus' % attrs.get('d', 0),
            ]
        if 'm2' in attrs:
            data[curve] += ['m2', '%sbit' % attrs.get('m2', 0)]
    return data