def mutate_image_dict_to_v1(image):
 visibility = image.pop('visibility')
 is_image_public = ('public' == visibility)
 image['is_public'] = is_image_public
 return image

def mutate_image_dict_to_v1 ( image ) : visibility = image . pop ( 'visibility' ) is_image_public = ( 'public' == visibility ) image [ 'is_public' ] = is_image_public return image
replaces a v2-style image dictionarys visibility member with the equivalent v1-style is_public member .