import collections


def group_block_devices_by_type(block_device_mapping):
    """Return devices grouped by driver volume type."""
    block_devices = collections.defaultdict(list)
    for volume in block_device_mapping:
        connection_info = volume['connection_info']
        volume_type = connection_info.get('driver_volume_type')
        block_devices[volume_type].append(volume)
    return block_devices