def get_device_name_for_instance(instance, bdms, device):
 mappings = block_device.instance_block_mapping(instance, bdms)
 return get_next_device_name(instance, mappings.values(), mappings['root'], device)

def get_device_name_for_instance ( instance , bdms , device ) : mappings = block_device . instance_block_mapping ( instance , bdms ) return get_next_device_name ( instance , mappings . values ( ) , mappings [ 'root' ] , device )
validates a device name for instance .