Change the set of accounts that this image is shared with.
 The parameter is an array of account ID's.

 Note that this routine will "unshare" with any accounts
 not included in the list passed in so the list should
 be comprehensive
979702
def shared_with_accounts= (account_id_list)
      already_sharing_with = self.shared_with_accounts

      accounts_to_add = account_id_list.select { |account_id| !already_sharing_with.include?(account_id) }

      # Note, using the network API, it is possible to "unshare" an image template
      # with the account that owns it, however, this leads to a rather odd state
      # where the image has allocated resources (that the account may be charged for)
      # but no way to delete those resources. For that reason this model
      # always includes the account ID that owns the image in the list of
      # accounts the image will be shared with.
      my_account_id = self['accountId']
      accounts_to_add.push(my_account_id) if !already_sharing_with.include?(my_account_id) && !accounts_to_add.include?(my_account_id)

      accounts_to_remove = already_sharing_with.select { |account_id| (account_id != my_account_id) && !account_id_list.include?(account_id) }

      accounts_to_add.each {|account_id| self.service.permitSharingAccess account_id }
      accounts_to_remove.each {|account_id| self.service.denySharingAccess account_id }
    end
903503
def _remove_account(self, accounts):
        
        for account in to_list(accounts):
            if account not in self.accounts:
                msg = 'attempt to remove unknown account %s' % account
                raise Exception(msg)
            if account not in self.unlocked_accounts:
                raise Exception('account %s should be unlocked' % account)
            account.acquired_event.disconnect(self._on_account_acquired)
            account.released_event.disconnect(self._on_account_released)
            self.accounts.remove(account)
            self.unlocked_accounts.remove(account)
88122
def get_account_batch(account_ids)
      resp = request('/users/get_account_batch', account_ids: account_ids)
      resp.map { |a| BasicAccount.new(a) }
    end
310244
def unShare(sharedItem):
    
    sharedItem.store.query(Share, Share.sharedItem == sharedItem).deleteFromStore()
469094
def update_profile_image(self, filename, file_=None):
        
        headers, post_data = API._pack_image(filename, 700, f=file_)
        return bind_api(
            api=self,
            path='/account/update_profile_image.json',
            method='POST',
            payload_type='user',
            allowed_param=['include_entities', 'skip_status'],
            require_auth=True
        )(self, post_data=post_data, headers=headers)
1064838
def list_accounts_add(self, id, account_ids):
        
        id = self.__unpack_id(id)
        
        if not isinstance(account_ids, list):
            account_ids = [account_ids]
        account_ids = list(map(lambda x: self.__unpack_id(x), account_ids))
        
        params = self.__generate_params(locals(), ['id'])        
        self.__api_request('POST', '/api/v1/lists/{0}/accounts'.format(id), params)
590976
def unshare_project(project_id, usernames,**kwargs):
    

    user_id = kwargs.get('user_id')
    proj_i = _get_project(project_id)
    proj_i.check_share_permission(user_id)

    for username in usernames:
        user_i = _get_user(username)
        #Set the owner ship on the network itself
        proj_i.unset_owner(user_i.id, write=write, share=share)
    db.DBSession.flush()
717913
def all_accounts
      all = []
      single_proxy("LIST_ACCOUNTS", {}, nil, true).each do |account|
        all << account
        sub_accounts = single_proxy("GET_SUB_ACCOUNTS_OF_ACCOUNT",
                             {
                                account_id: account["id"],
                                recursive: true,
                             },
                             nil,
                             true)
        all = all.concat(sub_accounts)
      end
      all
    end
1338739
def update_image(self, image_id, user_name, desc=None):
        """"""
        desc = desc if desc else ''
        data = {"username": user_name,
                "description": desc}

        return self._post('/images/%s' % image_id, data)
891572
public void setSharedImagePermissionsList(java.util.Collection<SharedImagePermissions> sharedImagePermissionsList) {
        if (sharedImagePermissionsList == null) {
            this.sharedImagePermissionsList = null;
            return;
        }

        this.sharedImagePermissionsList = new java.util.ArrayList<SharedImagePermissions>(sharedImagePermissionsList);
    }
546697
public void setUnprocessedAccounts(java.util.Collection<Result> unprocessedAccounts) {
        if (unprocessedAccounts == null) {
            this.unprocessedAccounts = null;
            return;
        }

        this.unprocessedAccounts = new java.util.ArrayList<Result>(unprocessedAccounts);
    }
1248112
@RequestMapping(value = "{accountId}", method = RequestMethod.DELETE)
    public Ack deleteAccount(@PathVariable ID accountId) {
        return accountService.deleteAccount(accountId);
    }
1183592
def upgradeShare1to2(oldShare):
    ""
    sharedInterfaces = []
    attrs = set(oldShare.sharedAttributeNames.split(u','))
    for iface in implementedBy(oldShare.sharedItem.__class__):
        if set(iface) == attrs or attrs == set('*'):
            sharedInterfaces.append(iface)

    newShare = oldShare.upgradeVersion('sharing_share', 1, 2,
                                       shareID=oldShare.shareID,
                                       sharedItem=oldShare.sharedItem,
                                       sharedTo=oldShare.sharedTo,
                                       sharedInterfaces=sharedInterfaces)
    return newShare
1064866
def image_meta_set(self,
                       image_id=None,
                       name=None,
                       **kwargs):  # pylint: disable=C0103
        '''
        
        '''
        nt_ks = self.compute_conn
        if name:
            for image in nt_ks.images.list():
                if image.name == name:
                    image_id = image.id  # pylint: disable=C0103
        if not image_id:
            return {'Error': 'A valid image name or id was not specified'}
        nt_ks.images.set_meta(image_id, kwargs)
        return {image_id: kwargs}
79903
def update(self, *args, **kwargs):
        

        data = self._clean_data(*args, **kwargs)
        if 'images' in data:
            images = data['images']
            for img in images:
                self._update_image(img)
        else:
            self._update_data(data=data)
427453
def remove_account_alias(self, account, alias):
        
        self.request('RemoveAccountAlias', {
            'id': self._get_or_fetch_id(account, self.get_account),
            'alias': alias,
        })
9812
void setAccount(String account)
    {
        final String oldAccount = this.account;

        this.account = account;
        firePropertyChange(PROPERTY_ACCOUNT, oldAccount, account);
    }