def ListImages(region):
 all_images = GetImages(region, GetOwnerIDs(region))
 running_images = set([i.image_id for i in ListInstances(region)])
 if (len(all_images) == 0):
  print ('No images in region %s' % region)
  return
 print ('# %-14s %-8s %-40s %-40s' % ('ID', 'Active', 'Name', 'Description'))
 for i in all_images:
  active_str = ('ACTIVE' if (i.id in running_images) else '')
  print ('%-16s %-8s %-40s %-40s' % (i.id, active_str, i.name, i.description))

def ListImages ( region ) : all_images = GetImages ( region , GetOwnerIDs ( region ) ) running_images = set ( [ i . image_id for i in ListInstances ( region ) ] ) if ( len ( all_images ) == 0 ) : print ( 'No images in region %s' % region ) return print ( '# %-14s %-8s %-40s %-40s' % ( 'ID' , 'Active' , 'Name' , 'Description' ) ) for i in all_images : active_str = ( 'ACTIVE' if ( i . id in running_images ) else '' ) print ( '%-16s %-8s %-40s %-40s' % ( i . id , active_str , i . name , i . description ) )
display the list of images in a given region .