code: def modify_image_attribute(self, image_id, attribute='launchPermission',
                                 operation='add', user_ids=None, groups=None,
                                 product_codes=None):
          
          params = {'ImageId' : image_id,
                    'Attribute' : attribute,
                    'OperationType' : operation}
          if user_ids:
              self.build_list_params(params, user_ids, 'UserId')
          if groups:
              self.build_list_params(params, groups, 'UserGroup')
          if product_codes:
              self.build_list_params(params, product_codes, 'ProductCode')
          return self.get_status('ModifyImageAttribute', params, verb='POST')
docs: Changes an attribute of an image.
  
          :type image_id: string
          :param image_id: The image id you wish to change
  
          :type attribute: string
          :param attribute: The attribute you wish to change
  
          :type operation: string
          :param operation: Either add or remove (this is required for changing
                            launchPermissions)
  
          :type user_ids: list
          :param user_ids: The Amazon IDs of users to add/remove attributes
  
          :type groups: list
          :param groups: The groups to add/remove attributes
  
          :type product_codes: list
          :param product_codes: Amazon DevPay product code. Currently only one
                                product code can be associated with an AMI. Once
                                set, the product code cannot be changed or reset.