def format_attachments(attachments=[]):
 formatted_attachments = []
 for attachment in attachments:
  formatted_attachment = {'attach_time': str(attachment.get('AttachTime')), 'instance_id': attachment.get('InstanceId'), 'volume_id': attachment.get('VolumeId'), 'state': attachment.get('State'), 'delete_on_termination': attachment.get('DeleteOnTermination'), 'device': attachment.get('Device')}
  formatted_attachments.append(formatted_attachment)
 return formatted_attachments

def format_attachments ( attachments = [ ] ) : formatted_attachments = [ ] for attachment in attachments : formatted_attachment = { 'attach_time' : str ( attachment . get ( 'AttachTime' ) ) , 'instance_id' : attachment . get ( 'InstanceId' ) , 'volume_id' : attachment . get ( 'VolumeId' ) , 'state' : attachment . get ( 'State' ) , 'delete_on_termination' : attachment . get ( 'DeleteOnTermination' ) , 'device' : attachment . get ( 'Device' ) } formatted_attachments . append ( formatted_attachment ) return formatted_attachments
return formatted_attachments for volume config .