def get_image_desc(self, idx):
    'Look up an image descriptor given the id'
    matching = [img_desc for img_desc in self._images if (img_desc['id'] == idx)]
    if (len(matching) == 1):
        return matching[0]
    else:
        raise ValueError(('No image found with id %s' % idx))
Look up an image descriptor given the id
def get_image_desc(self, idx):
    
    matching = [img_desc for img_desc in self._images if (img_desc['id'] == idx)]
    if (len(matching) == 1):
        return matching[0]
    else:
        raise ValueError(('No image found with id %s' % idx))