def _SelectNewestCosImage(images):
    'Selects newest COS image from the list.'
    cos_images = sorted([image for image in images if image.name.startswith(COS_MAJOR_RELEASE)], key=(lambda x: times.ParseDateTime(x.creationTimestamp)))
    if (not cos_images):
        raise NoCosImageException()
    return cos_images[(- 1)].selfLink
Selects newest COS image from the list.
def _SelectNewestCosImage(images):
    
    cos_images = sorted([image for image in images if image.name.startswith(COS_MAJOR_RELEASE)], key=(lambda x: times.ParseDateTime(x.creationTimestamp)))
    if (not cos_images):
        raise NoCosImageException()
    return cos_images[(- 1)].selfLink